---
title: PreInjectNoise (latest version)
description: API reference for samplomatic.pre_samplex.PreInjectNoise in the latest version of samplomatic
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/samplomatic/auto/pre-samplex-pre-inject-noise
---

# PreInjectNoise

*class* `samplomatic.pre_samplex.PreInjectNoise(subsystems: Partition[int], direction: Direction, register_type: VirtualType, ref: str, modifier_ref: str, sign_idx: str, *, trace_info: TraceInfo | None = None, twirl_gate: str | None = None)`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/pre_samplex/graph_data.py#L432-L449)

Bases: [`PreEmit`](/docs/api/samplomatic/auto/pre-samplex-pre-emit "samplomatic.pre_samplex.graph_data.PreEmit")

The inject noise emit node type used during samplex building.

**Attributes Summary**

|                                                                                                                                 |                                                                                  |
| ------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| [`direction`](#samplomatic.pre_samplex.PreInjectNoise.direction "samplomatic.pre_samplex.PreInjectNoise.direction")             | The direction of virtual gates that can interact with this node.                 |
| [`modifier_ref`](#samplomatic.pre_samplex.PreInjectNoise.modifier_ref "samplomatic.pre_samplex.PreInjectNoise.modifier_ref")    | Unique identifier for modifiers to apply to the Pauli Lindblad map on this node. |
| [`ref`](#samplomatic.pre_samplex.PreInjectNoise.ref "samplomatic.pre_samplex.PreInjectNoise.ref")                               | Unique identifier of the Pauli Lindblad map to use for noise injection.          |
| [`register_type`](#samplomatic.pre_samplex.PreInjectNoise.register_type "samplomatic.pre_samplex.PreInjectNoise.register_type") | The virtual register type of the noise injection.                                |
| [`sign_idx`](#samplomatic.pre_samplex.PreInjectNoise.sign_idx "samplomatic.pre_samplex.PreInjectNoise.sign_idx")                | The index of the output array to write the sign to.                              |
| [`subsystems`](#samplomatic.pre_samplex.PreInjectNoise.subsystems "samplomatic.pre_samplex.PreInjectNoise.subsystems")          | The subsystems that virtual gates act on.                                        |
| [`trace_info`](#samplomatic.pre_samplex.PreInjectNoise.trace_info "samplomatic.pre_samplex.PreInjectNoise.trace_info")          | Debug trace information, populated when building with `debug=True`.              |
| [`twirl_gate`](#samplomatic.pre_samplex.PreInjectNoise.twirl_gate "samplomatic.pre_samplex.PreInjectNoise.twirl_gate")          | The gate name used for gate-dependent sampling, or `None`.                       |

**Methods Summary**

|                                                                                                                       |                                                                                                                                                                  |
| --------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`get_style`](#samplomatic.pre_samplex.PreInjectNoise.get_style "samplomatic.pre_samplex.PreInjectNoise.get_style")() | Summarizes the style of this node when plotted via [`plot_graph()`](/docs/api/samplomatic/auto/visualization-plot-graph "samplomatic.visualization.plot_graph"). |

**Attributes Documentation**

### direction

Type: [`Direction`](/docs/api/samplomatic/auto/constants-direction "samplomatic.constants.Direction")

Default value: `<dataclasses._MISSING_TYPE object>`

The direction of virtual gates that can interact with this node.

### modifier\_ref

Type: [`str`](https://docs.python.org/3/builtins/stdtypes.html#str)

Default value: `<dataclasses._MISSING_TYPE object>`

Unique identifier for modifiers to apply to the Pauli Lindblad map on this node.

### ref

Type: [`str`](https://docs.python.org/3/builtins/stdtypes.html#str)

Default value: `<dataclasses._MISSING_TYPE object>`

Unique identifier of the Pauli Lindblad map to use for noise injection.

### register\_type

Type: [`VirtualType`](/docs/api/samplomatic/auto/virtual-registers-virtual-type "samplomatic.virtual_registers.virtual_type.VirtualType")

Default value: `<dataclasses._MISSING_TYPE object>`

The virtual register type of the noise injection.

### sign\_idx

Type: [`str`](https://docs.python.org/3/builtins/stdtypes.html#str)

Default value: `<dataclasses._MISSING_TYPE object>`

The index of the output array to write the sign to.

### subsystems

Type: [`Partition`](/docs/api/samplomatic/auto/partition-partition "samplomatic.partition.Partition")\[[`int`](https://docs.python.org/3/builtins/functions.html#int)]

Default value: `<dataclasses._MISSING_TYPE object>`

The subsystems that virtual gates act on.

### trace\_info

Type: `TraceInfo` | [`None`](https://docs.python.org/3/builtins/constants.html#None)

Default value: `None`

Debug trace information, populated when building with `debug=True`.

### twirl\_gate

Type: [`str`](https://docs.python.org/3/builtins/stdtypes.html#str) | [`None`](https://docs.python.org/3/builtins/constants.html#None)

Default value: `None`

The gate name used for gate-dependent sampling, or `None`.

**Methods Documentation**

### get\_style

`get_style() → NodeStyle`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/pre_samplex/graph_data.py#L448-L449)

Summarizes the style of this node when plotted via [`plot_graph()`](/docs/api/samplomatic/auto/visualization-plot-graph "samplomatic.visualization.plot_graph").
