---
title: extend_annotations (latest version)
description: API reference for samplomatic.utils.extend_annotations in the latest version of samplomatic
source: https://quantum.cloud.ibm.com/docs/en/api/samplomatic/auto/utils-extend-annotations
---

# extend\_annotations

`samplomatic.utils.extend_annotations(circuit: QuantumCircuit, *annotations: Annotation) → QuantumCircuit`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/utils/map_annotations.py#L117-L141)

Return a new circuit with the given annotations appended to every box.

**Parameters**

- **circuit** – The circuit whose boxes to extend.
- **\*annotations** – One or more annotation instances to append.

**Returns**

A new circuit where each box’s annotations are the original list followed by `annotations`.

```python
from qiskit.circuit import QuantumCircuit
from samplomatic import Twirl, InjectNoise
from samplomatic.utils import extend_annotations

circuit = QuantumCircuit(2)
with circuit.box([Twirl()]):
    circuit.cx(0, 1)

with_noise = extend_annotations(circuit, InjectNoise("ref"))
```
