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

# samplomatic.InjectNoise

*class* `samplomatic.InjectNoise(ref: str, modifier_ref: str = '', site: InjectionSite | Literal['before', 'after'] = 'after')`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/annotations/inject_noise.py#L33-L77)

Directive to inject noise into a `box` instruction.

The resulting [`Samplex`](/docs/api/samplomatic/auto/samplex-samplex "samplomatic.samplex.Samplex") built from a circuit with a box with this annotation requires a [`qiskit.quantum_info.PauliLindbladMap`](/docs/api/qiskit/qiskit.quantum_info.PauliLindbladMap) with `ref` to at sample time. The qubits of the map are indexed in physical qubit order, in other words, the order of the qubits in the outer-most circuit, restricted to those used by the box.

**Parameters**

- **ref** – A unique identifier of the Pauli Lindblad map from which to inject noise.
- **modifier\_ref** – A unique identifier for modifiers to apply to the Pauli Lindblad map before injection.
- **site** – Whether to inject the noise before or after the hard content of the box.

### \_\_init\_\_

`__init__(ref: str, modifier_ref: str = '', site: InjectionSite | Literal['before', 'after'] = 'after')`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/annotations/inject_noise.py#L52-L60)

## Methods

|                                                                                                                 |   |
| --------------------------------------------------------------------------------------------------------------- | - |
| [`__init__`](#samplomatic.InjectNoise.__init__ "samplomatic.InjectNoise.__init__")(ref\[, modifier\_ref, site]) |   |

## Attributes

|                |   |
| -------------- | - |
| `ref`          |   |
| `modifier_ref` |   |
| `site`         |   |
| `namespace`    |   |
