tqec.circuit.measurement.Measurement#
- class Measurement(qubit: GridQubit, offset: int)[source]#
A unique representation for each measurement in a quantum circuit.
This class aims at being able to represent measurements in a quantum circuit in a unique and easily usable way.
Note
This is not a global representation as the offset is always relative to the end of the quantum circuit considered.
- qubit#
qubit on which the represented measurement is performed.
- offset#
negative offset representing the number of measurements performed on the provided qubit after the represented measurement. A value of -1 means that the represented measurement is the last one applied on qubit.
- Type:
int
- Raises:
TQECException – if the provided offset is not strictly negative.
Methods
__init__
(qubit, offset)map_qubit
(qubit_map)Returns a new instance representing a measurement on the qubit obtained from self.qubit and the provided qubit_map.
offset_spatially_by
(x, y)Returns a new instance offset by the provided spatial coordinates.
offset_temporally_by
(t)Returns a new instance offset by the provided temporal coordinates.
Attributes