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

# InjectNoiseNode

*class* `samplomatic.samplex.nodes.InjectNoiseNode(register_name: str, sign_register_name: str, noise_ref: str, num_subsystems: int, modifier_ref: str = '')`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/samplex/nodes/inject_noise_node.py#L20-L97)

Bases: [`SamplingNode`](/docs/api/samplomatic/auto/samplex-nodes-sampling-node "samplomatic.samplex.nodes.sampling_node.SamplingNode")

A node that produces samples for injecting noise.

The node uses a [`qiskit.quantum_info.PauliLindbladMap`](/docs/api/qiskit/qiskit.quantum_info.PauliLindbladMap) as the distribution to draw samples from. This map can be modified at sample time:

- `noise_scales`, a dictionary from `StrRef` to floats. If `modifier_ref` is in the dictionary, the distribution is replaced with the one generated by by [`qiskit.quantum_info.PauliLindbladMap.scale_rates()`](/docs/api/qiskit/qiskit.quantum_info.PauliLindbladMap#scale_rates).
- `local_scales`, a dictionary from `StrRef` to lists of floats. If `modifier_ref` is in the dictionary, the rates of [`qiskit.quantum_info.PauliLindbladMap`](/docs/api/qiskit/qiskit.quantum_info.PauliLindbladMap) are scaled individually.

**Parameters**

- **register\_name** – The name of the register to store the samples.
- **sign\_register\_name** – The name of the register to store the signs.
- **noise\_ref** – Unique identifier of the Pauli Lindblad map to draw samples from.
- **num\_subsystems** – The number of subsystems this node generates gates for.
- **modifier\_ref** – Unique identifier for modifiers applied to the Pauli Lindblad map before sampling.

**Attributes Summary**

|                                                                                                                                                                  |                                              |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- |
| [`outgoing_register_type`](#samplomatic.samplex.nodes.InjectNoiseNode.outgoing_register_type "samplomatic.samplex.nodes.InjectNoiseNode.outgoing_register_type") | The virtual gate type of outgoing registers. |

**Methods Summary**

|                                                                                                                                               |                                                                         |
| --------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| [`get_style`](#samplomatic.samplex.nodes.InjectNoiseNode.get_style "samplomatic.samplex.nodes.InjectNoiseNode.get_style")()                   | Return the style of this node when plotted.                             |
| [`instantiates`](#samplomatic.samplex.nodes.InjectNoiseNode.instantiates "samplomatic.samplex.nodes.InjectNoiseNode.instantiates")()          | Return a manifest of new virtual registers that this node instantiates. |
| [`sample`](#samplomatic.samplex.nodes.InjectNoiseNode.sample "samplomatic.samplex.nodes.InjectNoiseNode.sample")(registers, rng, inputs, ...) | Sample this node.                                                       |

**Attributes Documentation**

### outgoing\_register\_type

**Methods Documentation**

### get\_style

`get_style()`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/samplex/nodes/inject_noise_node.py#L89-L97)

Return the style of this node when plotted.

### instantiates

`instantiates() → dict[str, tuple[int, VirtualType]]`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/samplex/nodes/inject_noise_node.py#L60-L64)

Return a manifest of new virtual registers that this node instantiates.

> **Note**
>
> - To change the type or size of a register, both instantiate and remove it.
> - Do not specify `reads_from()` or `writes_to()` for an instantiated register, these powers are implicit.

### sample

`sample(registers, rng, inputs, num_randomizations)`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/samplex/nodes/inject_noise_node.py#L66-L77)

Sample this node.

**Parameters**

- **registers** – Where to sample into.
- **rng** – A randomness generator.
- **inputs** – Inputs of the sampling program.
- **num\_randomizations** – How many randomizations to draw.
