pytket.circuit.OpType¶
Enum for available operations compatible with the tket Circuit
class.
Warning
All parametrised OpTypes which take angles (e.g. Rz, CPhase, FSim) expect parameters in multiples of pi (half-turns). This may differ from other quantum programming tools you have used, which have specified angles in radians, or perhaps even degrees. Therefore, for instance circuit.add_gate(OpType.Rx, 1, [0]) is equivalent in terms of the unitary to circuit.add_gate(OpType.X, [0])
- class pytket._tket.circuit.OpType¶
Enum for available operations compatible with tket
Circuit
s.Members:
Phase : Global phase:
Z : Pauli Z:
X : Pauli X:
Y : Pauli Y:
S :
Sdg :
T :
Tdg :
V :
Vdg :
SX :
SXdg :
H : Hadamard gate:
Rx :
Ry :
Rz :
U1 :
. U-gates are used by IBM. See https://qiskit.org/documentation/tutorials/circuits/3_summary_of_quantum_operations.html for more information on U-gates.U2 :
, defined by matrix multiplicationU3 :
GPI :
GPI2 :
AAMS :
TK1 :
TK2 :
CX : Controlled
gateCY : Controlled
gateCZ : Controlled
gateCH : Controlled
gateCV : Controlled
gateCVdg : Controlled
gateCSX : Controlled
gateCSXdg : Controlled
gateCS : Controlled
gateCSdg : Controlled
gateCRz :
Controlled gateCRx :
Controlled gateCRy :
Controlled gateCU1 :
Controlled gate. Note that this is not equivalent to a up to global phase, differing by an extra on the control qubit.CU3 :
Controlled gate. Similar rules apply.CCX : Toffoli gate
ECR :
SWAP : Swap gate
CSWAP : Controlled swap gate
noop : Identity gate. These gates are not permanent and are automatically stripped by the compiler
Barrier : Meta-operation preventing compilation through it. Not automatically stripped by the compiler
Label : Label for control flow jumps. Does not appear within a circuit
Branch : A control flow jump to a label dependent on the value of a given Bit. Does not appear within a circuit
Goto : An unconditional control flow jump to a Label. Does not appear within a circuit.
Stop : Halts execution immediately. Used to terminate a program. Does not appear within a circuit.
BRIDGE : A CX Bridge over 3 qubits. Used to apply a logical CX between the first and third qubits when they are not adjacent on the device, but both neighbour the second qubit. Acts as the identity on the second qubit
Measure : Z-basis projective measurement, storing the measurement outcome in a specified bit
Reset : Resets the qubit to
CircBox : Represents an arbitrary subcircuit
PhasePolyBox : An operation representing arbitrary circuits made up of CX and Rz gates, represented as a phase polynomial together with a boolean matrix representing an additional linear transformation.
Unitary1qBox : Represents an arbitrary one-qubit unitary operation by its matrix
Unitary2qBox : Represents an arbitrary two-qubit unitary operation by its matrix
Unitary3qBox : Represents an arbitrary three-qubit unitary operation by its matrix
ExpBox : A two-qubit operation corresponding to a unitary matrix defined as the exponential
of an arbitrary 4x4 hermitian matrix .PauliExpBox : An operation defined as the exponential
of a tensor of Pauli operations.PauliExpPairBox : A pair of (not necessarily commuting) Pauli exponentials
performed in sequence.PauliExpCommutingSetBox : An operation defined as a setof commuting exponentials of the form
of a tensor of Pauli operations.TermSequenceBox : An unordered collection of Pauli exponentials that can be synthesised in any order, causing a change in the unitary operation. Synthesis order depends on the synthesis strategy chosen only.
QControlBox : An arbitrary n-controlled operation
ToffoliBox : A permutation of classical basis states
ConjugationBox : An operation composed of ‘action’, ‘compute’ and ‘uncompute’ circuits
DummyBox : A placeholder operation that holds resource data
CustomGate :
A user-defined operation, based on aCircuit
with parameters substituted in place of bound symbolic variables in , as defined by theCustomGateDef
.Conditional : An operation to be applied conditionally on the value of some classical register
ISWAP :
PhasedISWAP :
(equivalent to: Rz(p)[0]; Rz(-p)[1]; ISWAP(t); Rz(-p)[0]; Rz(p)[1])XXPhase :
YYPhase :
ZZPhase :
XXPhase3 : A 3-qubit gate XXPhase3(α) consists of pairwise 2-qubit XXPhase(α) interactions. Equivalent to XXPhase(α)[0, 1] XXPhase(α)[1, 2] XXPhase(α)[0, 2].
PhasedX :
(matrix-multiplication order)NPhasedX :
(n-qubit gate composed of identical PhasedX in parallel.CnRx :
:= n-controlled gate.CnRy :
:= n-controlled gate.CnRz :
:= n-controlled gate.CnX : n-controlled X gate.
CnY : n-controlled Y gate.
CnZ : n-controlled Z gate.
ZZMax :
, a maximally entangling ZZPhaseESWAP :
FSim :
Sycamore :
ISWAPMax :
ClassicalTransform : A general classical operation where all inputs are also outputs
WASM : Op containing a classical wasm function call
SetBits : An operation to set some bits to specified values
CopyBits : An operation to copy some bit values
RangePredicate : A classical predicate defined by a range of values in binary encoding
ExplicitPredicate : A classical predicate defined by a truth table
ExplicitModifier : An operation defined by a truth table that modifies one bit
MultiBit : A classical operation applied to multiple bits simultaneously
ClassicalExpBox : A box for holding compound classical operations on Bits.
MultiplexorBox : A multiplexor (i.e. uniformly controlled operations)
MultiplexedRotationBox : A multiplexed rotation gate (i.e. uniformly controlled single-axis rotations)
MultiplexedU2Box : A multiplexed U2 gate (i.e. uniformly controlled U2 gate)
MultiplexedTensoredU2Box : A multiplexed tensored-U2 gate
StatePreparationBox : A box for preparing quantum states using multiplexed-Ry and multiplexed-Rz gates
DiagonalBox : A box for synthesising a diagonal unitary matrix into a sequence of multiplexed-Rz gates
ClExpr : A classical expression
- static from_name(arg0: str) pytket._tket.circuit.OpType ¶
Construct from name
- property name¶