IcebergOpsExtension¶
- class guppyft.extensions.iceberg.IcebergOpsExtension[source]¶
Extension providing the Iceberg logical operations.
- property alloc_dynq_def: OpDef¶
Allocate a dynamic logical qubit in the zero state.
This is the generic operation definition. For the instantiated operation, see alloc_dynq.
- alloc_zero(k: int) ExtOp[source]¶
Allocate a block in the all-zero state.
- Parameters:
k – The number of logical qubits encoded in the block.
- property alloc_zero_def: OpDef¶
Allocate a block in the all-zero state.
This is the generic operation definition. For the instantiated operation, see alloc_zero.
- borrow(k: int) ExtOp[source]¶
Convert a block to a borrowed block.
- Parameters:
k – The number of logical qubits encoded in the block.
- property borrow_def: OpDef¶
Convert a block to a borrowed block.
This is the generic operation definition. For the instantiated operation, see borrow.
- check_pre_block(k: int) ExtOp[source]¶
Check if a PreBlock is in a valid logical state.
- Parameters:
k – The number of logical qubits encoded in the block.
- property check_pre_block_def: OpDef¶
Check if a PreBlock is in a valid logical state.
This is the generic operation definition. For the instantiated operation, see check.
- cx_all(k: int) ExtOp[source]¶
Apply CX gates to all corresponding pairs of logical qubits in two blocks.
The blocks must have the same size. For every index, the qubit in the first block controls a CX targeting the qubit with that index in the second block.
- Parameters:
k – The number of logical qubits encoded in the blocks.
- property cx_all_def: OpDef¶
Apply CX gates to all corresponding pairs of logical qubits in two blocks.
The blocks must have the same size. For every index, the qubit in the first block controls a CX targeting the qubit with that index in the second block.
This is the generic operation definition. For the instantiated operation, see cx_all.
- property cx_dynq_def: OpDef¶
CX gate on two dynamic logical qubits.
This is the generic operation definition. For the instantiated operation, see cx_dynq.
- cx_interblock(k: int) ExtOp[source]¶
Apply a CX gate to one logical qubit in each of two different blocks.
The blocks must have the same size. The qubit indices are runtime inputs.
- Parameters:
k – The number of logical qubits encoded in the blocks.
- property cx_interblock_def: OpDef¶
Apply a CX gate to one logical qubit in each of two different blocks.
The blocks must have the same size. The qubit indices are runtime inputs.
This is the generic operation definition. For the instantiated operation, see cx_interblock.
- cx_intrablock(k: int) ExtOp[source]¶
Apply a CX gate to two logical qubits within a block.
- Parameters:
k – The number of logical qubits encoded in the block.
- property cx_intrablock_def: OpDef¶
Apply a CX gate to two logical qubits within a block.
This is the generic operation definition. For the instantiated operation, see cx_intrablock.
- fan_in(k: int) ExtOp[source]¶
Fan in to one qubit from the rest.
- Parameters:
k – The number of logical qubits encoded in the block.
- property fan_in_def: OpDef¶
Fan in to one qubit from the rest.
This is the generic operation definition. For the instantiated operation, see fan_in.
- fan_out(k: int) ExtOp[source]¶
Fan out from one qubit to the rest.
- Parameters:
k – The number of logical qubits encoded in the block.
- property fan_out_def: OpDef¶
Fan out from one qubit to the rest.
This is the generic operation definition. For the instantiated operation, see fan_out.
- free(k: int) ExtOp[source]¶
Free a block.
- Parameters:
k – The number of logical qubits encoded in the block.
- property free_def: OpDef¶
Free a block.
This is the generic operation definition. For the instantiated operation, see free.
- property free_dynq_def: OpDef¶
Discard a dynamic logical qubit.
This is the generic operation definition. For the instantiated operation, see free_dynq.
- h_all(k: int) ExtOp[source]¶
Apply an H gate to all qubits.
- Parameters:
k – The number of logical qubits encoded in the block.
- property h_all_def: OpDef¶
Apply an H gate to all qubits.
This is the generic operation definition. For the instantiated operation, see h_all.
- measure_all(k: int) ExtOp[source]¶
Destructively measure all qubits in the Z basis.
- Parameters:
k – The number of logical qubits encoded in the block.
- property measure_all_def: OpDef¶
Destructively measure all qubits in the Z basis.
This is the generic operation definition. For the instantiated operation, see measure_all.
- measure_syndrome(k: int) ExtOp[source]¶
Perform a syndrome measurement, producing (X,Z) error indicators.
- Parameters:
k – The number of logical qubits encoded in the block.
- property measure_syndrome_def: OpDef¶
Perform a syndrome measurement, producing (X,Z) error indicators.
This is the generic operation definition. For the instantiated operation, see measure_syndrome.
- pauli_exp_x_all(k: int) ExtOp[source]¶
Apply the logical all-X Pauli exponential.
\[\exp(-i \theta X^{\otimes k} / 2)\]The operation’s angle \(\theta\) is in radians and \(k\) is the number of logical qubits in the block.
- Parameters:
k – The number of logical qubits encoded in the block.
- property pauli_exp_x_all_def: OpDef¶
Apply the logical all-X Pauli exponential.
\[\exp(-i \theta X^{\otimes k} / 2)\]The operation’s angle \(\theta\) is in radians and \(k\) is the number of logical qubits in the block.
This is the generic operation definition. For the instantiated operation, see
pauli_exp_x_all.
- pauli_exp_x_all_except_at(k: int) ExtOp[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)\]The operation’s angle \(\theta\) is in radians and \(k\) is the number of logical qubits in the block.
- Parameters:
k – The number of logical qubits encoded in the block.
- property pauli_exp_x_all_except_at_def: OpDef¶
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)\]The operation’s angle \(\theta\) is in radians and \(k\) is the number of logical qubits in the block.
This is the generic operation definition. For the instantiated operation, see
pauli_exp_x_all_except_at.
- pauli_exp_x_all_except_z_at(k: int) ExtOp[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)\]The operation’s angle \(\theta\) is in radians and \(k\) is the number of logical qubits in the block.
- Parameters:
k – The number of logical qubits encoded in the block.
- property pauli_exp_x_all_except_z_at_def: OpDef¶
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)\]The operation’s angle \(\theta\) is in radians and \(k\) is the number of logical qubits in the block.
This is the generic operation definition. For the instantiated operation, see
pauli_exp_x_all_except_z_at.
- pauli_exp_y_all(k: int) ExtOp[source]¶
Apply the logical all-Y Pauli exponential.
\[\exp(-i \theta Y^{\otimes k} / 2)\]The operation’s angle \(\theta\) is in radians and \(k\) is the number of logical qubits in the block.
- Parameters:
k – The number of logical qubits encoded in the block.
- property pauli_exp_y_all_def: OpDef¶
Apply the logical all-Y Pauli exponential.
\[\exp(-i \theta Y^{\otimes k} / 2)\]The operation’s angle \(\theta\) is in radians and \(k\) is the number of logical qubits in the block.
This is the generic operation definition. For the instantiated operation, see
pauli_exp_y_all.
- pauli_exp_z_all(k: int) ExtOp[source]¶
Apply the logical all-Z Pauli exponential.
\[\exp(-i \theta Z^{\otimes k} / 2)\]The operation’s angle \(\theta\) is in radians and \(k\) is the number of logical qubits in the block.
- Parameters:
k – The number of logical qubits encoded in the block.
- property pauli_exp_z_all_def: OpDef¶
Apply the logical all-Z Pauli exponential.
\[\exp(-i \theta Z^{\otimes k} / 2)\]The operation’s angle \(\theta\) is in radians and \(k\) is the number of logical qubits in the block.
This is the generic operation definition. For the instantiated operation, see
pauli_exp_z_all.
- pauli_exp_z_all_except_at(k: int) ExtOp[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)\]The operation’s angle \(\theta\) is in radians and \(k\) is the number of logical qubits in the block.
- Parameters:
k – The number of logical qubits encoded in the block.
- property pauli_exp_z_all_except_at_def: OpDef¶
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)\]The operation’s angle \(\theta\) is in radians and \(k\) is the number of logical qubits in the block.
This is the generic operation definition. For the instantiated operation, see
pauli_exp_z_all_except_at.
- pauli_exp_z_all_except_x_at(k: int) ExtOp[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)\]The operation’s angle \(\theta\) is in radians and \(k\) is the number of logical qubits in the block.
- Parameters:
k – The number of logical qubits encoded in the block.
- property pauli_exp_z_all_except_x_at_def: OpDef¶
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)\]The operation’s angle \(\theta\) is in radians and \(k\) is the number of logical qubits in the block.
This is the generic operation definition. For the instantiated operation, see
pauli_exp_z_all_except_x_at.
- put(k: int) ExtOp[source]¶
Return a dynamic logical qubit to its originating block.
- Parameters:
k – The number of logical qubits encoded in the block.
- property put_def: OpDef¶
Return a dynamic logical qubit to its originating block.
This is the generic operation definition. For the instantiated operation, see put.
- restore(k: int) ExtOp[source]¶
Convert a complete borrowed block to a block.
- Parameters:
k – The number of logical qubits encoded in the block.
- property restore_def: OpDef¶
Convert a complete borrowed block to a block.
This is the generic operation definition. For the instantiated operation, see restore.
- rx(k: int) ExtOp[source]¶
Apply an Rx gate to one qubit.
- Parameters:
k – The number of logical qubits encoded in the block.
- property rx_def: OpDef¶
Apply an Rx gate to one qubit.
This is the generic operation definition. For the instantiated operation, see rx.
- property rx_dynq_def: OpDef¶
Rx gate on a dynamic logical qubit.
This is the generic operation definition. For the instantiated operation, see rx_dynq.
- rz(k: int) ExtOp[source]¶
Apply an Rz gate to one qubit.
- Parameters:
k – The number of logical qubits encoded in the block.
- property rz_def: OpDef¶
Apply an Rz gate to one qubit.
This is the generic operation definition. For the instantiated operation, see rz.
- property rz_dynq_def: OpDef¶
Rz gate on a dynamic logical qubit.
This is the generic operation definition. For the instantiated operation, see rz_dynq.
- swap_intrablock(k: int) ExtOp[source]¶
Apply a SWAP gate to two logical qubits within a block.
- Parameters:
k – The number of logical qubits encoded in the block.
- property swap_intrablock_def: OpDef¶
Apply a SWAP gate to two logical qubits within a block.
This is the generic operation definition. For the instantiated operation, see swap_intrablock.
- take(k: int) ExtOp[source]¶
Extraction of a dynamic logical qubit from a borrowed block.
- Parameters:
k – The number of logical qubits encoded in the borrowed block.
- property take_def: OpDef¶
Extraction of a dynamic logical qubit from a borrowed block.
This is the generic operation definition. For the instantiated operation, see take.
- property try_alloc_dynq_def: OpDef¶
Try to allocate a dynamic logical qubit in the zero state.
This is the generic operation definition. For the instantiated operation, see try_alloc_dynq.
- try_alloc_zero(k: int) ExtOp[source]¶
Allocate a PreBlock in the all-zero state.
- Parameters:
k – The number of logical qubits encoded in the block.
- property try_alloc_zero_def: OpDef¶
Allocate a PreBlock in the all-zero state.
This is the generic operation definition. For the instantiated operation, see alloc_zero.
- try_measure_one_x(k: int) ExtOp[source]¶
Non-destructively measure one qubit in the X basis.
This operation is fallible and produces a future optional bool. A “none” value indicates a probable single-qubit error; QED may then be used to detect whether this was just a measurement error or whether it affected the data qubits.
- Parameters:
k – The number of logical qubits encoded in the block.
- property try_measure_one_x_def: OpDef¶
Non-destructively measure one qubit in the X basis.
This operation is fallible and produces a future optional bool. A “none” value indicates a probable single-qubit error; QED may then be used to detect whether this was just a measurement error or whether it affected the data qubits.
This is the generic operation definition. For the instantiated operation, see try_measure_one_x.
- try_measure_one_z(k: int) ExtOp[source]¶
Non-destructively measure one qubit in the Z basis.
This operation is fallible and produces a future optional bool. A “none” value indicates a probable single-qubit error; QED may then be used to detect whether this was just a measurement error or whether it affected the data qubits.
- Parameters:
k – The number of logical qubits encoded in the block.
- property try_measure_one_z_def: OpDef¶
Non-destructively measure one qubit in the Z basis.
This operation is fallible and produces a future optional bool. A “none” value indicates a probable single-qubit error; QED may then be used to detect whether this was just a measurement error or whether it affected the data qubits.
This is the generic operation definition. For the instantiated operation, see try_measure_one_z.
- property try_measure_x_dynq: ExtOp¶
Fallible non-destructive measurement of a dynamic logical qubit in the X basis.
- property try_measure_x_dynq_def: OpDef¶
Fallible non-destructive measurement of a dynamic logical qubit in the X basis.
This is the generic operation definition. For the instantiated operation, see try_measure_x_dynq.
- property try_measure_z_dynq: ExtOp¶
Fallible non-destructive measurement of a dynamic logical qubit in the Z basis.
- property try_measure_z_dynq_def: OpDef¶
Fallible non-destructive measurement of a dynamic logical qubit in the Z basis.
This is the generic operation definition. For the instantiated operation, see try_measure_z_dynq.
- x(k: int) ExtOp[source]¶
Apply an X gate to one qubit.
- Parameters:
k – The number of logical qubits encoded in the block.
- x_all(k: int) ExtOp[source]¶
Apply an X gate to all qubits.
- Parameters:
k – The number of logical qubits encoded in the block.
- property x_all_def: OpDef¶
Apply an X gate to all qubits.
This is the generic operation definition. For the instantiated operation, see x_all.
- x_all_except_at(k: int) ExtOp[source]¶
Apply an X gate to all but one qubit.
- Parameters:
k – The number of logical qubits encoded in the block.
- property x_all_except_at_def: OpDef¶
Apply an X gate to all but one qubit.
This is the generic operation definition. For the instantiated operation, see x_all_except_at.
- x_all_except_z_at(k: int) ExtOp[source]¶
Apply a Z gate to one qubit and an X to the rest.
- Parameters:
k – The number of logical qubits encoded in the block.
- property x_all_except_z_at_def: OpDef¶
Apply a Z gate to one qubit and an X to the rest.
This is the generic operation definition. For the instantiated operation, see x_all_except_z_at.
- property x_def: OpDef¶
Apply an X gate to one qubit.
This is the generic operation definition. For the instantiated operation, see x.
- property x_dynq_def: OpDef¶
X gate on a dynamic logical qubit.
This is the generic operation definition. For the instantiated operation, see x_dynq.
- xx_intrablock(k: int) ExtOp[source]¶
Apply an X gate to two logical qubits within a block.
- Parameters:
k – The number of logical qubits encoded in the block.
- property xx_intrablock_def: OpDef¶
Apply an X gate to two logical qubits within a block.
This is the generic operation definition. For the instantiated operation, see xx_intrablock.
- property xx_phase_dynq_def: OpDef¶
XXPhase gate on two dynamic logical qubits.
This is the generic operation definition. For the instantiated operation, see xx_phase_dynq.
- xx_phase_interblock(k: int) ExtOp[source]¶
Apply an XXPhase gate to one logical qubit in each of two different blocks.
The blocks must have the same size. The qubit indices are runtime inputs.
- Parameters:
k – The number of logical qubits encoded in the blocks.
- property xx_phase_interblock_def: OpDef¶
Apply an XXPhase gate to one logical qubit in each of two different blocks.
The blocks must have the same size. The qubit indices are runtime inputs.
This is the generic operation definition. For the instantiated operation, see xx_phase_interblock.
- xx_phase_intrablock(k: int) ExtOp[source]¶
Apply an XXPhase gate to two logical qubits within a block.
- Parameters:
k – The number of logical qubits encoded in the block.
- property xx_phase_intrablock_def: OpDef¶
Apply an XXPhase gate to two logical qubits within a block.
This is the generic operation definition. For the instantiated operation, see xx_phase_intrablock.
- y(k: int) ExtOp[source]¶
Apply a Y gate to one qubit.
- Parameters:
k – The number of logical qubits encoded in the block.
- y_all(k: int) ExtOp[source]¶
Apply a Y gate to all qubits.
- Parameters:
k – The number of logical qubits encoded in the block.
- property y_all_def: OpDef¶
Apply a Y gate to all qubits.
This is the generic operation definition. For the instantiated operation, see y_all.
- property y_def: OpDef¶
Apply a Y gate to one qubit.
This is the generic operation definition. For the instantiated operation, see y.
- property y_dynq_def: OpDef¶
Y gate on a dynamic logical qubit.
This is the generic operation definition. For the instantiated operation, see y_dynq.
- yy_intrablock(k: int) ExtOp[source]¶
Apply a Y gate to two logical qubits within a block.
- Parameters:
k – The number of logical qubits encoded in the block.
- property yy_intrablock_def: OpDef¶
Apply a Y gate to two logical qubits within a block.
This is the generic operation definition. For the instantiated operation, see yy_intrablock.
- property yy_phase_dynq_def: OpDef¶
YYPhase gate on two dynamic logical qubits.
This is the generic operation definition. For the instantiated operation, see yy_phase_dynq.
- yy_phase_interblock(k: int) ExtOp[source]¶
Apply a YYPhase gate to one logical qubit in each of two different blocks.
The blocks must have the same size. The qubit indices are runtime inputs.
- Parameters:
k – The number of logical qubits encoded in the blocks.
- property yy_phase_interblock_def: OpDef¶
Apply a YYPhase gate to one logical qubit in each of two different blocks.
The blocks must have the same size. The qubit indices are runtime inputs.
This is the generic operation definition. For the instantiated operation, see yy_phase_interblock.
- yy_phase_intrablock(k: int) ExtOp[source]¶
Apply a YYPhase gate to two logical qubits within a block.
- Parameters:
k – The number of logical qubits encoded in the block.
- property yy_phase_intrablock_def: OpDef¶
Apply a YYPhase gate to two logical qubits within a block.
This is the generic operation definition. For the instantiated operation, see yy_phase_intrablock.
- z(k: int) ExtOp[source]¶
Apply a Z gate to one qubit.
- Parameters:
k – The number of logical qubits encoded in the block.
- z_all(k: int) ExtOp[source]¶
Apply a Z gate to all qubits.
- Parameters:
k – The number of logical qubits encoded in the block.
- property z_all_def: OpDef¶
Apply a Z gate to all qubits.
This is the generic operation definition. For the instantiated operation, see z_all.
- z_all_except_at(k: int) ExtOp[source]¶
Apply a Z gate to all but one qubit.
- Parameters:
k – The number of logical qubits encoded in the block.
- property z_all_except_at_def: OpDef¶
Apply a Z gate to all but one qubit.
This is the generic operation definition. For the instantiated operation, see z_all_except_at.
- z_all_except_x_at(k: int) ExtOp[source]¶
Apply an X gate to one qubit and a Z to the rest.
- Parameters:
k – The number of logical qubits encoded in the block.
- property z_all_except_x_at_def: OpDef¶
Apply an X gate to one qubit and a Z to the rest.
This is the generic operation definition. For the instantiated operation, see z_all_except_x_at.
- property z_def: OpDef¶
Apply a Z gate to one qubit.
This is the generic operation definition. For the instantiated operation, see z.
- property z_dynq_def: OpDef¶
Z gate on a dynamic logical qubit.
This is the generic operation definition. For the instantiated operation, see z_dynq.
- zz_intrablock(k: int) ExtOp[source]¶
Apply a Z gate to two logical qubits within a block.
- Parameters:
k – The number of logical qubits encoded in the block.
- property zz_intrablock_def: OpDef¶
Apply a Z gate to two logical qubits within a block.
This is the generic operation definition. For the instantiated operation, see zz_intrablock.
- property zz_phase_dynq_def: OpDef¶
ZZPhase gate on two dynamic logical qubits.
This is the generic operation definition. For the instantiated operation, see zz_phase_dynq.
- zz_phase_interblock(k: int) ExtOp[source]¶
Apply a ZZPhase gate to one logical qubit in each of two different blocks.
The blocks must have the same size. The qubit indices are runtime inputs.
- Parameters:
k – The number of logical qubits encoded in the blocks.
- property zz_phase_interblock_def: OpDef¶
Apply a ZZPhase gate to one logical qubit in each of two different blocks.
The blocks must have the same size. The qubit indices are runtime inputs.
This is the generic operation definition. For the instantiated operation, see zz_phase_interblock.