tqec.circuit.measurement_map.MeasurementRecordsMap#
- class MeasurementRecordsMap(mapping: dict[~tqec.circuit.qubit.GridQubit, list[int]] = <factory>)[source]#
A mapping from measurements appearing in a circuit and their record offsets.
This class stores record offsets which are, by essence, relative to a certain position in a circuit. This means that this class and the measurement offsets it stores are meaningless without knowledge about the circuit containing the represented measurements and the position(s) in the circuit at which the instance at hand is valid.
- Raises:
TQECException – if at least one of the provided measurement record offsets is non-negative (>=0).
TQECException – if, for any of the provided qubits, the provided offsets are not sorted.
TQECException – if any measurement offset is duplicated.
- __init__(mapping: dict[~tqec.circuit.qubit.GridQubit, list[int]] = <factory>) None #
Methods
__init__
([mapping])from_circuit
(circuit[, qubit_map])Build a
MeasurementMap
from a circuit.from_scheduled_circuit
(circuit)Build a
MeasurementMap
from a scheduled circuit.with_added_measurements
(mrecords_map[, ...])Build a new
MeasurementRecordsMap
with measurements from self appearing before measurements from the provided mrecords_map.Attributes
mapping