Block¶
- class guppyft.code.iceberg.logical.Block[source]¶
An Iceberg logical block containing N logical qubits.
- borrow() BorrowedBlock[N][source]¶
Convert block to borrowed block to allow dynamic logical qubits to be borrowed.
- cx_intrablock(i: int, j: int) None[source]¶
CX gate within a block, with logical control i and logical target j.
- measure_syndrome() tuple[Measurement, Measurement][source]¶
Syndrome measurement.
- pauli_exp_x_all(phase: float) None[source]¶
Apply the logical all-X Pauli exponential.
\[\exp(-i \theta X^{\otimes k} / 2)\]where \(\theta\) is
phasein radians and \(k\) is the number of logical qubits in the block.
- pauli_exp_x_all_except_at(i: int, phase: float) None[source]¶
Apply the Pauli exponential with I at
iand X elsewhere.\[\exp(-i \theta ( X^{\otimes i} \otimes I \otimes X^{\otimes(k-i-1)} ) / 2)\]where \(\theta\) is
phasein radians and \(k\) is the number of logical qubits in the block.
- pauli_exp_x_all_except_z_at(i: int, phase: float) None[source]¶
Apply the Pauli exponential with Z at
iand X elsewhere.\[\exp(-i \theta ( X^{\otimes i} \otimes Z \otimes X^{\otimes(k-i-1)} ) / 2)\]where \(\theta\) is
phasein radians and \(k\) is the number of logical qubits in the block.
- pauli_exp_y_all(phase: float) None[source]¶
Apply the logical all-Y Pauli exponential.
\[\exp(-i \theta Y^{\otimes k} / 2)\]where \(\theta\) is
phasein radians and \(k\) is the number of logical qubits in the block.
- pauli_exp_z_all(phase: float) None[source]¶
Apply the logical all-Z Pauli exponential.
\[\exp(-i \theta Z^{\otimes k} / 2)\]where \(\theta\) is
phasein radians and \(k\) is the number of logical qubits in the block.
- pauli_exp_z_all_except_at(i: int, phase: float) None[source]¶
Apply the Pauli exponential with I at
iand Z elsewhere.\[\exp(-i \theta ( Z^{\otimes i} \otimes I \otimes Z^{\otimes(k-i-1)} ) / 2)\]where \(\theta\) is
phasein radians and \(k\) is the number of logical qubits in the block.
- pauli_exp_z_all_except_x_at(i: int, phase: float) None[source]¶
Apply the Pauli exponential with X at
iand Z elsewhere.\[\exp(-i \theta ( Z^{\otimes i} \otimes X \otimes Z^{\otimes(k-i-1)} ) / 2)\]where \(\theta\) is
phasein radians and \(k\) is the number of logical qubits in the block.
- static restore(block: BorrowedBlock[N]) Block[N][source]¶
Convert borrowed block (with all dynamic logical qubits restored) to block.
- ry(i: int, phase: float) None[source]¶
Ry rotation of
phaseradians on logical qubiti.Ry is not a primitive and is implemented here as .. math:
R_y(\theta) = R_x(-\pi/2) R_z(\theta) R_x(\pi/2)
where \(\theta\) is
phase.
- try_measure_one_x(i: int) Option[Measurement][source]¶
Fallible non-destructive measurement in the X basis of the qubit with index i.
- try_measure_one_z(i: int) Option[Measurement][source]¶
Fallible non-destructive measurement in the Z basis of the qubit with index i.
- xx_phase_intrablock(i: int, j: int, phase: float) None[source]¶
XXPhase rotation of phase radians on logical qubits i and j within a block.