Skip to main content
IBM Quantum Platform

strip_annotations

samplomatic.utils.strip_annotations(circuit: QuantumCircuit) → QuantumCircuit

GitHub

Return a new circuit with all annotations removed from every box.

Parameters

circuit – The circuit whose box annotations to strip.

Returns

A new circuit with empty annotation lists on every box.

from qiskit.circuit import QuantumCircuit
from samplomatic import Twirl
from samplomatic.utils import strip_annotations

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

bare = strip_annotations(circuit)
Was this page helpful?
Report a bug, typo, or request content on GitHub.