deltakit.explorer.codes.CSSStage#
- class deltakit.explorer.codes.CSSStage(stabilisers: Sequence[Sequence[Stabiliser]] | None = None, num_rounds: int = 0, first_round_measurements: Sequence[MPP | OneQubitMeasurementGate] | None = None, first_round_gates: Iterable[OneQubitCliffordGate | TwoOperandGate] | None = None, final_round_resets: Iterable[OneQubitResetGate] | None = None, observable_definitions: Mapping[int, Iterable[Qubit | MPP | OneQubitMeasurementGate]] | None = None, use_ancilla_qubits: bool | None = None)#
Bases:
objectClass representing a computational stage in a CSS code experiment. Such a stage can consist of some initial qubit measurements, some number of rounds of syndrome extraction and some final qubit resets. A full experiment can then be constructed by putting together several stages.
- Parameters:
stabilisers (Optional[Sequence[Sequence[Stabiliser]]]) – The stabilisers to be measured using syndrome extraction. Each sequence gives those stabilisers which are to be measured simultaneously, and thus each stabiliser within a sequence should have the same length. The sequences are in order of measurement. By default, None.
num_rounds (int, optional) – The number of rounds of syndrome extraction to be performed. By default, 0.
first_round_measurements (Optional[Sequence[Union[MPP, OneQubitMeasurementGate]]]) – Measurement gates to be included before the first round of syndrome extraction. By default, None.
first_round_gates (Optional[Iterable[Union[OneQubitCliffordGate, TwoOperandGate]]]) –
Clifford unitary gates to be included before the first round of syndrome extraction. The gates can be general as long as
no qubit appears in two gates, and
each gate acts on at least one data qubit.
By default, None.
final_round_resets (Optional[Iterable[OneQubitResetGate]]) – Reset gates to be included after the final round of syndrome extraction. By default, None.
observable_definitions (Optional[Dict[int, Iterable[Union[Qubit, MPP, OneQubitMeasurementGate]]]]) – Definitions of observables to be included after the initial measurements and first round of syndrome extraction. The dictionary keys give the observable indices and the values give the measurements which should be included in the observable. A measurement is specified with a qubit, in which case the most recent one-qubit measurement performed upon the qubit should be included, or a measurement gate, in which case the outcome of the most recent time the measurement gate was performed should be included. By default, None.
use_ancilla_qubits (bool) – Specifies whether the Code will use an ordered sequence of Stabilisers or not. If the code is ordered, one ancilla qubit must be provided for each stabiliser. If the code is not ordered, no ancilla qubits must be provided.
- measurements_as_stabilisers#
First round of measurements as a Tuple of Stabilisers. For each measurement, the measured operator and the qubit used to measure the outcome are given by Stabiliser attributes paulis and ancilla_qubit, respectively.
- Type:
Tuple[Stabiliser, …]
- final_round_resets#
Final round resets as a Tuple of Stabilisers. For each reset, the reset basis and qubit to reset are given by Stabiliser attributes paulis and ancilla_qubit, respectively.
- Type:
Tuple[Stabiliser, …]
- ordered_stabilisers#
Stabilisers in order of measurement.
- Type:
Tuple[Stabiliser, …]
- resets_only#
Whether the stage consists only of final round resets.
- Type:
bool
- allowable_final_stage#
Whether the stage can be used as the final stage in an experiment.
- Type:
bool
- first_round#
The circuit for the first round of syndrome extraction, including the first round data qubit measurements and the subsequent observable definitions.
- Type: