Block¶
- class guppyft.code.toy_k2.logical.Block[source]¶
A ToyK2 logical block.
- cx_intra(target: int) None[source]¶
Logical CX within the block, targeting the specified logical qubit.
- Parameters:
target – The index of the logical qubit that acts as target (0 or 1). The other logical qubit acts as control.
- measure_z_all() BlockMeasurement[source]¶
Measure both qubits of the block in the Z basis.
This operation destroys the logical block.
- project_z(idx: int) QubitMeasurement[source]¶
Project the chosen logical qubit onto the Z basis without consuming it.
- Parameters:
idx – The index of the logical qubit to apply the measurement to (0 or 1).
- qed_cycle() None[source]¶
Performs an error detection cycle on the block.
This consists of a syndrome extraction followed by discarding of the shot if the syndrome is not trivial.