Block¶
- class guppyft.code.toy_k2.logical.Block[source]¶
A ToyK2 logical block.
- static __new__()[source]¶
Fault-tolerant preparation of a logical \(|00\\rangle\) state.
- Return type:
- cx_intra(target)[source]¶
Logical CX within the block, targeting the specified logical qubit.
- Return type:
- 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()[source]¶
Measure both qubits of the block in the Z basis.
This operation destroys the logical block.
- Return type:
- project_z(idx)[source]¶
Project the chosen logical qubit onto the Z basis without consuming it.
- Return type:
- Parameters:
idx – The index of the logical qubit to apply the measurement to (0 or 1).
- qed_cycle()[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.
- Return type: