[docs]classSteaneTypesExtension:"""Extension providing the Steane logical types."""
[docs]def__call__(self)->Extension:"""Returns the Steane types extension."""returnload_extension("guppyft.steane.types")
@functools.cached_propertydefsteane_qubit_def(self)->TypeDef:"""A Steane logical qubit. This is the generic type definition. For the instantiated type, see `steane_qubit`. """returnself().get_type("qubit")
@functools.cached_propertydefsteane_measurement_def(self)->TypeDef:"""A Steane logical measurement type. This is the generic type definition. For the instantiated type, see `steane_measurement`. """returnself().get_type("measurement")
[docs]classSteaneOpsExtension:"""Extension providing the Steane logical operations."""
[docs]def__call__(self)->Extension:"""Returns the Steane ops extension."""returnload_extension("guppyft.steane.ops",["guppyft.std.types"])
@functools.cached_propertydefprep_zero_def(self)->OpDef:"""Prepare a logical qubit in the all-zero state. This is the generic operation definition. For the instantiated operation, see `prep_zero`."""returnself().get_op("prep_zero")
[docs]defprep_zero(self)->ExtOp:"""Allocate a block in the all-zero state."""returnself.prep_zero_def.instantiate([])
@functools.cached_propertydeffree_def(self)->OpDef:"""Free a logical qubit. This is the generic operation definition. For the instantiated operation, see `free`."""returnself().get_op("free")
[docs]deffree(self)->ExtOp:"""Free a block."""returnself.free_def.instantiate([])
@functools.cached_propertydefmeasure_z_def(self)->OpDef:"""Destructive measurement of a logical qubit in the Z basis. This is the generic operation definition. For the instantiated operation, see `measure_z`."""returnself().get_op("measure_z")
[docs]defmeasure_z(self)->ExtOp:"""Destructive measurement of a logical qubit in the Z basis."""returnself.measure_z_def.instantiate([])
@functools.cached_propertydefqec_cycle_def(self)->OpDef:"""Perform a QEC cycle on a logical qubit. This is the generic operation definition. For the instantiated operation, see `qec_cycle`."""returnself().get_op("qec_cycle")
[docs]defqec_cycle(self)->ExtOp:"""Perform a QEC cycle on a logical qubit."""returnself.qec_cycle_def.instantiate([])
@functools.cached_propertydefdecode_def(self)->OpDef:"""Decode a measurement of a Steane logical qubit. This is the generic operation definition. For the instantiated operation, see `decode`."""returnself().get_op("decode")
[docs]defdecode(self)->ExtOp:"""Decode a measurement of a Steane logical qubit."""returnself.decode_def.instantiate([])
@functools.cached_propertydefx_def(self)->OpDef:"""Apply an X gate to one qubit. This is the generic operation definition. For the instantiated operation, see `x`."""returnself().get_op("x")
[docs]defx(self)->ExtOp:"""Apply an X gate to one qubit."""returnself.x_def.instantiate([])
@functools.cached_propertydefy_def(self)->OpDef:"""Apply a Y gate to one qubit. This is the generic operation definition. For the instantiated operation, see `y`."""returnself().get_op("y")
[docs]defy(self)->ExtOp:"""Apply an Y gate to one qubit."""returnself.y_def.instantiate([])
@functools.cached_propertydefz_def(self)->OpDef:"""Apply a Z gate to one qubit. This is the generic operation definition. For the instantiated operation, see `z`."""returnself().get_op("z")
[docs]defz(self)->ExtOp:"""Apply a Z gate to one qubit."""returnself.z_def.instantiate([])
@functools.cached_propertydefh_def(self)->OpDef:"""Apply an H gate to one qubit. This is the generic operation definition. For the instantiated operation, see `h`."""returnself().get_op("h")
[docs]defh(self)->ExtOp:"""Apply an H gate to one qubit."""returnself.h_def.instantiate([])
@functools.cached_propertydefs_def(self)->OpDef:"""Apply an S gate to one qubit. This is the generic operation definition. For the instantiated operation, see `s`."""returnself().get_op("s")
[docs]defs(self)->ExtOp:"""Apply an S gate to one qubit."""returnself.s_def.instantiate([])
@functools.cached_propertydefsdg_def(self)->OpDef:"""Apply an Sdg gate to one qubit. This is the generic operation definition. For the instantiated operation, see `sdg`."""returnself().get_op("sdg")
[docs]defsdg(self)->ExtOp:"""Apply an Sdg gate to one qubit."""returnself.sdg_def.instantiate([])
@functools.cached_propertydefrz_def(self)->OpDef:"""Apply an Rz gate to one qubit. This is the generic operation definition. For the instantiated operation, see `rz`."""returnself().get_op("rz")
[docs]defrz(self)->ExtOp:"""Apply an Rz gate to one qubit."""returnself.rz_def.instantiate([])
@functools.cached_propertydefprep_t_state_def(self)->OpDef:"""Prepare a magic state that can be used to produce T-like states (T and Tdg). This is the generic operation definition. For the instantiated operation, see `prep_t_state`."""returnself().get_op("prep_t_state")
[docs]defprep_t_state(self)->ExtOp:"""Prepare a magic state that can be used to produce T-like states (T and Tdg)."""returnself.prep_t_state_def.instantiate([])
@functools.cached_propertydefinject_t_def(self)->OpDef:"""Perform a T gate by injecting a magic state. This is the generic operation definition. For the instantiated operation, see `inject_t`."""returnself().get_op("inject_t")
[docs]definject_t(self)->ExtOp:"""Perform a T gate by injecting a magic state."""returnself.inject_t_def.instantiate([])
@functools.cached_propertydefinject_tdg_def(self)->OpDef:"""Perform a Tdg gate by injecting a magic state. This is the generic operation definition. For the instantiated operation, see `inject_tdg`."""returnself().get_op("inject_tdg")
[docs]definject_tdg(self)->ExtOp:"""Perform a Tdg gate by injecting a magic state."""returnself.inject_tdg_def.instantiate([])
@functools.cached_propertydefcx_def(self)->OpDef:"""Apply a CX gate to two qubits. This is the generic operation definition. For the instantiated operation, see `cx`."""returnself().get_op("cx")
[docs]defcx(self)->ExtOp:"""Apply a CX gate to two qubits."""returnself.cx_def.instantiate([])
@functools.cached_propertydefcz_def(self)->OpDef:"""Apply a CZ gate to two qubits. This is the generic operation definition. For the instantiated operation, see `cz`."""returnself().get_op("cz")
[docs]defcz(self)->ExtOp:"""Apply a CZ gate to two qubits."""returnself.cz_def.instantiate([])
@functools.cached_propertydefswap_def(self)->OpDef:"""Apply a SWAP gate to two qubits. This is the generic operation definition. For the instantiated operation, see `swap`."""returnself().get_op("swap")
[docs]defswap(self)->ExtOp:"""Apply a SWAP gate to two qubits."""returnself.swap_def.instantiate([])