tqecd.fragment.Fragment#
- class Fragment(circuit: Circuit)[source]#
- __init__(circuit: Circuit)[source]#
A sub-circuit guaranteed to end with a moment filled by measurement instructions.
Fragment instances represent sub-circuits that contain:
- zero or more moments composed of reset and any other instructions
except measurement instructions,
- zero or more moments composed of “computation” instructions (anything
that is not a measurement or a reset),
- one moment composed of measurement and any other instructions
except reset instructions.
- Raises:
TQECDException – if the provided stim.Circuit instance contains a stim.CircuitRepeatBlock instance.
TQECDException – if any moment from the provided circuit contains both a reset and a measurement operation.
TQECDException – if the provided circuit does not end with at least one measurement.
- Parameters:
circuit – the circuit represented by the instance.
Methods
__init__(circuit)A sub-circuit guaranteed to end with a moment filled by measurement instructions.
get_tableau()Attributes
circuitmeasurementsGet the measurement instructions at the back on the Fragment.
measurements_qubitsnum_measurementsresetsGet the reset instructions at the front on the Fragment.