#[non_exhaustive]pub enum OpType {
Show 122 variants
Input,
Output,
Create,
Discard,
ClInput,
ClOutput,
Barrier,
Label,
Branch,
Goto,
Stop,
ClassicalTransform,
WASM,
SetBits,
CopyBits,
RangePredicate,
ExplicitPredicate,
ExplicitModifier,
MultiBit,
Phase,
Z,
X,
Y,
S,
Sdg,
T,
Tdg,
V,
Vdg,
SX,
SXdg,
H,
Rx,
Ry,
Rz,
U3,
U2,
U1,
TK1,
TK2,
CX,
CY,
CZ,
CH,
CV,
CVdg,
CSX,
CSXdg,
CS,
CSdg,
CRz,
CRx,
CRy,
CU1,
CU3,
PhaseGadget,
CCX,
SWAP,
CSWAP,
BRIDGE,
noop,
Measure,
Collapse,
Reset,
ECR,
ISWAP,
PhasedX,
NPhasedX,
ZZMax,
XXPhase,
YYPhase,
ZZPhase,
XXPhase3,
ESWAP,
FSim,
Sycamore,
ISWAPMax,
PhasedISWAP,
CnRx,
CnRy,
CnRz,
CnX,
CnY,
CnZ,
GPI,
GPI2,
AAMS,
CircBox,
Unitary1qBox,
Unitary2qBox,
Unitary3qBox,
ExpBox,
PauliExpBox,
PauliExpPairBox,
PauliExpCommutingSetBox,
TermSequenceBox,
CliffBox,
PhasePolyBox,
Conditional,
StabiliserAssertionBox,
ProjectorAssertionBox,
CustomGate,
QControlBox,
UnitaryTableauBox,
ClassicalExpBox,
MultiplexorBox,
MultiplexedRotationBox,
MultiplexedU2Box,
MultiplexedTensoredU2Box,
ToffoliBox,
ConjugationBox,
DummyBox,
StatePreparationBox,
DiagonalBox,
ClExpr,
RNGInput,
RNGOutput,
RNGSeed,
RNGBound,
RNGIndex,
RNGNum,
JobShotNum,
}
Expand description
Operation types in a quantum circuit.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Input
Quantum input node of the circuit
Output
Quantum output node of the circuit
Create
Quantum node with no predecessors, implicitly in zero state.
Discard
Quantum node with no successors, not composable with input nodes of other circuits.
ClInput
Classical input node of the circuit
ClOutput
Classical output node of the circuit
Barrier
No-op that must be preserved by compilation
Label
FlowOp introducing a target for Branch or Goto commands
Branch
Execution jumps to a label if a condition bit is true (1), otherwise continues to next command
Goto
Execution jumps to a label unconditionally
Stop
Execution halts and the program terminates
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
Phase
Global phase $\alpha \mapsto [\e^{i\pi\alpha}]$
Z
\f$ \left[ \begin{array}{cc} 1 & 0 \ 0 & -1 \end{array} \right] \f$
X
\f$ \left[ \begin{array}{cc} 0 & 1 \ 1 & 0 \end{array} \right] \f$
Y
\f$ \left[ \begin{array}{cc} 0 & -i \ i & 0 \end{array} \right] \f$
S
\f$ \left[ \begin{array}{cc} 1 & 0 \ 0 & i \end{array} \right] = \mathrm{U1}(\frac12) \f$
Sdg
\f$ \left[ \begin{array}{cc} 1 & 0 \ 0 & -i \end{array} \right] = \mathrm{U1}(-\frac12) \f$
T
\f$ \left[ \begin{array}{cc} 1 & 0 \ 0 & e^{i\pi/4} \end{array} \right] = \mathrm{U1}(\frac14) \f$
Tdg
\f$ \left[ \begin{array}{cc} 1 & 0 \ 0 & e^{-i\pi/4} \end{array} \right] \equiv \mathrm{U1}(-\frac14) \f$
V
\f$ \frac{1}{\sqrt 2} \left[ \begin{array}{cc} 1 & -i \ -i & 1 \end{array} \right] = \mathrm{Rx}(\frac12) \f$
Vdg
\f$ \frac{1}{\sqrt 2} \left[ \begin{array}{cc} 1 & i \ i & 1 \end{array} \right] = \mathrm{Rx}(-\frac12) \f$
SX
\f$ \frac{1}{2} \left[ \begin{array}{cc} 1+i & 1-i \ 1-i & 1+i \end{array} \right] = e^{\frac{i\pi}{4}}\mathrm{Rx}(\frac12) \f$
SXdg
\f$ \frac{1}{2} \left[ \begin{array}{cc} 1-i & 1+i \ 1+i & 1-i \end{array} \right] = e^{\frac{-i\pi}{4}}\mathrm{Rx}(-\frac12) \f$
H
\f$ \frac{1}{\sqrt 2} \left[ \begin{array}{cc} 1 & 1 \ 1 & -1 \end{array} \right] \f$
Rx
\f$ \mathrm{Rx}(\alpha) = e^{-\frac12 i \pi \alpha X} = \left[ \begin{array}{cc} \cos\frac{\pi\alpha}{2} & -i\sin\frac{\pi\alpha}{2} \ -i\sin\frac{\pi\alpha}{2} & \cos\frac{\pi\alpha}{2} \end{array} \right] \f$
Ry
\f$ \mathrm{Ry}(\alpha) = e^{-\frac12 i \pi \alpha Y} = \left[ \begin{array}{cc} \cos\frac{\pi\alpha}{2} & -\sin\frac{\pi\alpha}{2} \ \sin\frac{\pi\alpha}{2} & \cos\frac{\pi\alpha}{2} \end{array} \right] \f$
Rz
\f$ \mathrm{Rz}(\alpha) = e^{-\frac12 i \pi \alpha Z} = \left[ \begin{array}{cc} e^{-\frac12 i \pi\alpha} & 0 \ 0 & e^{\frac12 i \pi\alpha} \end{array} \right] \f$
U3
\f$ \mathrm{U3}(\theta, \phi, \lambda) = \left[ \begin{array}{cc} \cos\frac{\pi\theta}{2} & -e^{i\pi\lambda} \sin\frac{\pi\theta}{2} \ e^{i\pi\phi} \sin\frac{\pi\theta}{2} & e^{i\pi(\lambda+\phi)} \cos\frac{\pi\theta}{2} \end{array} \right] = e^{\frac12 i\pi(\lambda+\phi)} \mathrm{Rz}(\phi) \mathrm{Ry}(\theta) \mathrm{Rz}(\lambda) \f$
U2
\f$ \mathrm{U2}(\phi, \lambda) = \mathrm{U3}(\frac12, \phi, \lambda) = e^{\frac12 i\pi(\lambda+\phi)} \mathrm{Rz}(\phi) \mathrm{Ry}(\frac12) \mathrm{Rz}(\lambda) \f$
U1
\f$ \mathrm{U1}(\lambda) = \mathrm{U3}(0, 0, \lambda) = e^{\frac12 i\pi\lambda} \mathrm{Rz}(\lambda) \f$
TK1
\f$ \mathrm{TK1}(\alpha, \beta, \gamma) = \mathrm{Rz}(\alpha) \mathrm{Rx}(\beta) \mathrm{Rz}(\gamma) \f$
TK2
\f$ \mathrm{TK2}(\alpha, \beta, \gamma) = \mathrm{XXPhase}(\alpha) \mathrm{YYPhase}(\beta) \mathrm{ZZPhase}(\gamma) \f$
CX
Controlled OpType::X
.
CY
Controlled OpType::Y
CZ
Controlled OpType::Z
CH
Controlled OpType::H
CV
Controlled OpType::V
\f$ \left[ \begin{array}{cccc} 1 & 0 & 0 & 0 \ 0 & 1 & 0 & 0 \ 0 & 0 & \frac{1}{\sqrt 2} & -i \frac{1}{\sqrt 2} \ 0 & 0 & -i \frac{1}{\sqrt 2} & \frac{1}{\sqrt 2} \end{array} \right] \f$
CVdg
Controlled OpType::Vdg
\f$ \left[ \begin{array}{cccc} 1 & 0 & 0 & 0 \ 0 & 1 & 0 & 0 \ 0 & 0 & \frac{1}{\sqrt 2} & i \frac{1}{\sqrt 2} \ 0 & 0 & i \frac{1}{\sqrt 2} & \frac{1}{\sqrt 2} \end{array} \right] \f$
CSX
Controlled OpType::SX
\f$ \left[ \begin{array}{cccc} 1 & 0 & 0 & 0 \ 0 & 1 & 0 & 0 \ 0 & 0 & \frac{1+i}{2} & \frac{1-i}{2} \ 0 & 0 & \frac{1-i}{2} & \frac{1+i}{2} \end{array} \right] \f$
CSXdg
Controlled OpType::SXdg
\f$ \left[ \begin{array}{cccc} 1 & 0 & 0 & 0 \ 0 & 1 & 0 & 0 \ 0 & 0 & \frac{1-i}{2} & \frac{1+i}{2} \ 0 & 0 & \frac{1+i}{2} & \frac{1-i}{2} \end{array} \right] \f$
CS
Controlled OpType::S
gate
CSdg
Controlled OpType::Sdg
gate
CRz
Controlled OpType::Rz
\f$ \mathrm{CRz}(\alpha) = \left[ \begin{array}{cccc} 1 & 0 & 0 & 0 \ 0 & 1 & 0 & 0 \ 0 & 0 & e^{-\frac12 i \pi\alpha} & 0 \ 0 & 0 & 0 & e^{\frac12 i \pi\alpha} \end{array} \right] \f$
The phase parameter \f$ \alpha \f$ is defined modulo \f$ 4 \f$.
CRx
Controlled OpType::Rx
\f$ \mathrm{CRx}(\alpha) = \left[ \begin{array}{cccc} 1 & 0 & 0 & 0 \ 0 & 1 & 0 & 0 \ 0 & 0 & \cos \frac{\pi \alpha}{2} & -i \sin \frac{\pi \alpha}{2} \ 0 & 0 & -i \sin \frac{\pi \alpha}{2} & \cos \frac{\pi \alpha}{2} \end{array} \right] \f$
The phase parameter \f$ \alpha \f$ is defined modulo \f$ 4 \f$.
CRy
Controlled OpType::Ry
\f$ \mathrm{CRy}(\alpha) = \left[ \begin{array}{cccc} 1 & 0 & 0 & 0 \ 0 & 1 & 0 & 0 \ 0 & 0 & \cos \frac{\pi \alpha}{2} & -\sin \frac{\pi \alpha}{2} \ 0 & 0 & \sin \frac{\pi \alpha}{2} & \cos \frac{\pi \alpha}{2} \end{array} \right] \f$
The phase parameter \f$ \alpha \f$ is defined modulo \f$ 4 \f$.
CU1
Controlled OpType::U1
\f$ \mathrm{CU1}(\alpha) = \left[ \begin{array}{cccc} 1 & 0 & 0 & 0 \ 0 & 1 & 0 & 0 \ 0 & 0 & 1 & 0 \ 0 & 0 & 0 & e^{i\pi\alpha} \end{array} \right] \f$
CU3
Controlled OpType::U3
PhaseGadget
\f$ \alpha \mapsto e^{-\frac12 i \pi\alpha Z^{\otimes n}} \f$
CCX
Controlled OpType::CX
SWAP
Swap two qubits
CSWAP
Controlled OpType::SWAP
BRIDGE
Three-qubit gate that swaps the first and third qubits
noop
Identity
Measure
Measure a qubit, producing a classical output
Collapse
Measure a qubit producing no output
Reset
Reset a qubit to the zero state
ECR
\f$ \frac{1}{\sqrt 2} \left[ \begin{array}{cccc} 0 & 0 & 1 & i \ 0 & 0 & i & 1 \ 1 & -i & 0 & 0 \ -i & 1 & 0 & 0 \end{array} \right] \f$
ISWAP
\f$ \alpha \mapsto e^{\frac14 i \pi\alpha (X \otimes X + Y \otimes Y)} = \left[ \begin{array}{cccc} 1 & 0 & 0 & 0 \ 0 & \cos\frac{\pi\alpha}{2} & i\sin\frac{\pi\alpha}{2} & 0 \ 0 & i\sin\frac{\pi\alpha}{2} & \cos\frac{\pi\alpha}{2} & 0 \ 0 & 0 & 0 & 1 \end{array} \right] \f$
Also known as an XY gate.
PhasedX
\f$ (\alpha, \beta) \mapsto \mathrm{Rz}(\beta) \mathrm{Rx}(\alpha) \mathrm{Rz}(-\beta) \f$
NPhasedX
PhasedX gates on multiple qubits
ZZMax
\f$ \mathrm{ZZPhase}(\frac12) \f$
XXPhase
\f$ \alpha \mapsto e^{-\frac12 i \pi\alpha (X \otimes X)} = \left[ \begin{array}{cccc} \cos\frac{\pi\alpha}{2} & 0 & 0 & -i\sin\frac{\pi\alpha}{2} \ 0 & \cos\frac{\pi\alpha}{2} & -i\sin\frac{\pi\alpha}{2} & 0 \ 0 & -i\sin\frac{\pi\alpha}{2} & \cos\frac{\pi\alpha}{2} & 0 \ -i\sin\frac{\pi\alpha}{2} & 0 & 0 & \cos\frac{\pi\alpha}{2} \end{array} \right] \f$
YYPhase
\f$ \alpha \mapsto e^{-\frac12 i \pi\alpha (Y \otimes Y)} = \left[ \begin{array}{cccc} \cos\frac{\pi\alpha}{2} & 0 & 0 & i\sin\frac{\pi\alpha}{2} \ 0 & \cos\frac{\pi\alpha}{2} & -i\sin\frac{\pi\alpha}{2} & 0 \ 0 & -i\sin\frac{\pi\alpha}{2} & \cos\frac{\pi\alpha}{2} & 0 \ i\sin\frac{\pi\alpha}{2} & 0 & 0 & \cos\frac{\pi\alpha}{2} \end{array} \right] \f$
ZZPhase
\f$ \alpha \mapsto e^{-\frac12 i \pi\alpha (Z \otimes Z)} = \left[ \begin{array}{cccc} e^{-\frac12 i \pi\alpha} & 0 & 0 & 0 \ 0 & e^{\frac12 i \pi\alpha} & 0 & 0 \ 0 & 0 & e^{\frac12 i \pi\alpha} & 0 \ 0 & 0 & 0 & e^{-\frac12 i \pi\alpha} \end{array} \right] \f$
XXPhase3
Three-qubit phase MSGate
ESWAP
\f$ \alpha \mapsto e^{-\frac12 i\pi\alpha \cdot \mathrm{SWAP}} = \left[ \begin{array}{cccc} e^{-\frac12 i \pi\alpha} & 0 & 0 & 0 \ 0 & \cos\frac{\pi\alpha}{2} & -i\sin\frac{\pi\alpha}{2} & 0 \ 0 & -i\sin\frac{\pi\alpha}{2} & \cos\frac{\pi\alpha}{2} & 0 \ 0 & 0 & 0 & e^{-\frac12 i \pi\alpha} \end{array} \right] \f$
FSim
\f$ (\alpha, \beta) \mapsto \left[ \begin{array}{cccc} 1 & 0 & 0 & 0 \ 0 & \cos \pi\alpha & -i\sin \pi\alpha & 0 \ 0 & -i\sin \pi\alpha & \cos \pi\alpha & 0 \ 0 & 0 & 0 & e^{-i\pi\beta} \end{array} \right] \f$
Sycamore
Fixed instance of a OpType::FSim
gate with parameters
\f$ (\frac12, \frac16) \f$:
\f$ \left[ \begin{array}{cccc} 1 & 0 & 0 & 0 \ 0 & 0 & -i & 0 \ 0 & -i
& 0 & 0 \ 0 & 0 & 0 & e^{-i\pi/6} \end{array} \right] \f$
ISWAPMax
Fixed instance of a OpType::ISWAP
gate with parameter \f$ 1.0 \f$:
\f$ \left[ \begin{array}{cccc} 1 & 0 & 0 & 0 \ 0 & 0 & i & 0 \ 0 & i
& 0 & 0 \ 0 & 0 & 0 & 1 \end{array} \right] \f$
PhasedISWAP
ISwap gate with extra Rz
s on each qubit
CnRx
N-controlled OpType::Rx
CnRy
N-controlled OpType::Ry
CnRz
N-controlled OpType::Rz
CnX
Multiply-controlled OpType::X
CnY
Multiply-controlled OpType::Y
CnZ
Multiply-controlled OpType::Z
GPI
GPi gate
\f$ (\phi) \mapsto \left[ \begin{array}{cc} 0 & e^{-i\pi\phi} \\ e^{i\pi\phi} & 0 \end{array} \right] \f$
GPI2
GPi2 gate
\f$ (\phi) \mapsto \frac{1}{\sqrt 2} \left[ \begin{array}{cc} 1 & -ie^{-i\pi\phi} \\ -ie^{i\pi\phi} & 1 \end{array} \right] \f$
AAMS
AAMS gate
\f$
(\theta, \phi_0, \phi_1) \mapsto \left[ “ \begin{array}{cccc} \cos\frac{\pi\theta}{2} & 0 & 0 & -ie^{-i\pi(\phi_0+\phi_1)}\sin\frac{\pi\theta}{2} \\ 0 & \cos\frac{\pi\theta}{2} & -ie^{i\pi(\phi_1-\phi_0)}\sin\frac{\pi\theta}{2} & 0 \\ 0 & -ie^{i\pi(\phi_0-\phi_1)}\sin\frac{\pi\theta}{2} & \cos\frac{\pi\theta}{2} & 0 \\ -ie^{i\pi(\phi_0+\phi_1)}\sin\frac{\pi\theta}{2} & 0 & 0 & \cos\frac{\pi\theta}{2} \end{array} \right]` \f$
CircBox
See CircBox
Unitary1qBox
See Unitary1qBox
Unitary2qBox
See Unitary2qBox
Unitary3qBox
See Unitary3qBox
ExpBox
See ExpBox
PauliExpBox
See PauliExpBox
PauliExpPairBox
See PauliExpPairBox
PauliExpCommutingSetBox
TermSequenceBox
See TermSequenceBox
CliffBox
NYI
PhasePolyBox
See PhasePolyBox
Conditional
NYI
StabiliserAssertionBox
ProjectorAssertionBox
CustomGate
See CustomGate
QControlBox
See QControlBox
UnitaryTableauBox
ClassicalExpBox
See ClassicalExpBox
Deprecated. Use OpType::ClExpr
instead.
MultiplexorBox
See MultiplexorBox
MultiplexedRotationBox
MultiplexedU2Box
See MultiplexedU2Box
MultiplexedTensoredU2Box
ToffoliBox
See ToffoliBox
ConjugationBox
See ConjugationBox
DummyBox
See DummyBox
StatePreparationBox
DiagonalBox
See DiagonalBox
ClExpr
Classical expression.
An operation of this type is accompanied by a ClExpr
object.
This is a replacement of the deprecated OpType::ClassicalExpBox
.
RNGInput
RNG input node of the circuit
RNGOutput
RNG output node of the circuit
RNGSeed
Seed an RNG using 64 bits
RNGBound
Set an (inclusive) 32-bit upper bound on RNG output
RNGIndex
Set a 32-bit index on an RNG
RNGNum
Get 32-bit output from an RNG
JobShotNum
Get 32-bit (little-endian) shot number