In QuantumFlow a gate is a unitary operator acting on a specific collection of qubits. A standard gate (subclasses of StdGate) are gates with a name, with zero or more parameters, acting on a fixed number of qubits.
A standard gate. Standard gates have a name, a fixed number of real parameters, and act upon a fixed number of qubits.
e.g. Rx(theta, q0), CNot(q0, q1), Can(tx, ty, tz, q0, q1, q2)
In the argument list, parameters are first, then qubits. Parameters have type Variable (either a concrete floating point number, or a symbolic expression), and qubits have type Qubit (Any hashable python type).
The 1-qubit identity gate.
A 1-qubit Pauli-X gate.
A 1-qubit Pauli-Y gate.
mnemonic: “Minus eye high”.
A 1-qubit Pauli-Z gate.
A 1-qubit Hadamard gate.
A 1-qubit phase S gate, equivalent to Z ** (1/2)
. The square root
of the Z gate. Also sometimes denoted as the P gate.
A 1-qubit T (pi/8) gate, equivalent to X ** (1/4)
. The forth root
of the Z gate (up to global phase).
A 1-qubit parametric phase shift gate. Equivalent to Rz up to a global phase.
A 1-qubit Pauli-X parametric rotation gate.
theta – Angle of rotation in Bloch sphere
A 1-qubit Pauli-Y parametric rotation gate
theta – Angle of rotation in Bloch sphere
A 1-qubit Pauli-X parametric rotation gate
theta – Angle of rotation in Bloch sphere
Apply a global phase shift of exp(i phi).
Since this gate applies a global phase it technically doesn’t need to specify qubits at all. But we instead anchor the gate to 1 specific qubit so that we can keep track of the phase as we manipulate gates, circuits, and DAGCircuits.
We generally don’t actually care about the global phase, since it has no physical meaning, although it does matter when constructing controlled gates.
A controlled-Z gate
Equivalent to controlled_gate(Z())
and locally equivalent to
Can(1/2, 0, 0)
A controlled-not gate
Equivalent to controlled_gate(X())
, and
locally equivalent to Can(1/2, 0, 0)
\[\begin{split}\text{CNot}() \equiv \begin{pmatrix} 1&0&0&0 \\ 0&1&0&0 \\ 0&0&0&1 \\ 0&0&1&0 \end{pmatrix}\end{split}\]
A 2-qubit swap gate
Equivalent to Can(1/2, 1/2, 1/2)
.
A 2-qubit iSwap gate
Equivalent to Can(-1/2,-1/2,0)
.
A 2-qubit 00 phase-shift gate
A 2-qubit 01 phase-shift gate
A 2-qubit 10 phase-shift gate
A 2-qubit 11 phase-shift gate
A 2-qubit parametric-swap gate, as defined by Quil. Interpolates between SWAP (theta=0) and iSWAP (theta=pi/2).
Locally equivalent to CAN(1/2, 1/2, 1/2 - theta/pi)
A 3-qubit Toffoli gate. A controlled, controlled-not.
Equivalent to controlled_gate(cnot())
A 3-qubit Fredkin gate. A controlled swap.
Equivalent to controlled_gate(swap())
The inverse of the 1-qubit phase S gate, equivalent to
Z ** -1/2
.
The inverse (complex conjugate) of the 1-qubit T (pi/8) gate, equivalent
to Z ** -1/4
.
Powers of the 1-qubit Pauli-X gate.
t – Number of half turns (quarter cycles) on Block sphere
Powers of the 1-qubit Pauli-Y gate.
The pseudo-Hadamard gate is YPow(3/2), and its inverse is YPow(1/2).
t – Number of half turns (quarter cycles) on Block sphere
Powers of the 1-qubit Pauli-Z gate.
t – Number of half turns (quarter cycles) on Block sphere
Powers of the 1-qubit Hadamard gate.
Principal square root of the X gate, X-PLUS-90 gate.
Complex conjugate of the V gate, X-MINUS-90 gate.
A phased X gate, equivalent to the circuit ───Z^-p───X───Z^p───
A phased X gate raised to a power.
Equivalent to the circuit ───Z^-p───X^t───Z^p───
The canonical 2-qubit gate
The canonical decomposition of 2-qubits gates removes local 1-qubit rotations, and leaves only the non-local interactions.
A parametric 2-qubit gate generated from an XX interaction,
Equivalent to Can(t, 0, 0)
.
XX(1/2) is the Mølmer-Sørensen gate.
Ref: Sørensen, A. & Mølmer, K. Quantum computation with ions in thermal motion. Phys. Rev. Lett. 82, 1971–1974 (1999)
t –
A parametric 2-qubit gate generated from a YY interaction.
Equivalent to Can(0, t, 0)
, and locally equivalent to
Can(t, 0, 0)
t –
A parametric 2-qubit gate generated from a ZZ interaction.
Equivalent to Can(0,0,t)
, and locally equivalent to
Can(t,0,0)
t –
XY interaction gate.
Powers of the iSWAP gate. Equivalent to Can(t, t, 0)
.
A 2-qubit parametric gate generated from an isotropic exchange interaction.
Equivalent to Can(t,t,t)
A universal two-qubit gate:
A Universal Two–Bit Gate for Quantum Computation, A. Barenco (1996) https://arxiv.org/pdf/quant-ph/9505016.pdf
A controlled-Y gate
Equivalent to controlled_gate(Y())
and locally equivalent to
Can(1/2,0,0)
A controlled-Hadamard gate
Equivalent to controlled_gate(H())
and locally equivalent to
Can(1/2, 0, 0)
Powers of the CNot gate.
Equivalent to controlled_gate(TX(t))
, and locally equivalent to
Can(t/2, 0 ,0)
.
t – turns (powers of the CNot gate, or controlled-powers of X)
q0 – control qubit
q1 – target qubit
A square root of the iswap gate
Equivalent to Can(-1/4,-1/4,0)
.
The Hermitian conjugate of the square root iswap gate
Equivalent to Can(1/4, 1/4, 0)
.
Square root of the 2-qubit swap gate
Equivalent to Can(1/4, 1/4, 1/4)
.
The conjugate of the Square root swap gate
Equivalent to Can(-1/4, -1/4, -1/4)
, and locally equivalent to
Can(3/4, 1/4, 1/4)
A controlled, controlled-Z.
Equivalent to controlled_gate(CZ())
The Deutsch gate, a 3-qubit universal quantum gate.
A controlled-controlled-i*R_x(2*theta) gate. Note that Deutsch(pi/2) is the CCNot gate.
Proc. R. Soc. Lond. A 425, 73 (1989).
A doubly controlled iX gate.
The U3 single qubit gate from QASM. The U2 gate is the U3 gate with theta=pi/2. The U1 gate has theta=phi=0, which is the same as a PhaseShift gate.
text{U3}(theta, phi, lambda) = R_z(phi) R_y(theta) R_z(lambda)
https://arxiv.org/pdf/1707.03429.pdf (Eq. 2) https://github.com/Qiskit/qiskit-terra/blob/master/qiskit/extensions/standard/u3.py
A ‘single pulse’ 1-qubit gate defined in QASM
The controlled U3 gate, as defined by QASM.
alias of CRz
alias of Rzz
Each of the main quantum computing python APIs (QuantumFlow, Cirq, qsikit (QASM), and pyQuil) have different gates available and different naming conventions. The following table maps gate names between these APIs.
Description |
QF |
Cirq |
QASM/qsikit |
PyQuil |
Pennylane |
One qubit gates
Global phase Ph ? ? ? ? Identity (single qubit) I I id or iden I ? Pauli-X X X x X PauliX Pauli-Y Y Y y Y PauliY Pauli-Z Z Z z Z PauliZ Hadamard H H h H Hadamard X-rotations Rx rx rx RX RX Y-rotations Ry ry ry RY RY Z-rotations Rz rz rz RZ RZ Sqrt of Z S S s S S Sqrt of S T T t T T Phase shift PhaseShift . u1 PHASE PhaseShift Bloch rotations Rn . . . . Powers of X XPow XPowGate . . . Powers of Y YPow YPowGate . . . Powers of Z ZPow ZPowGate . . . Powers of Hadamard HPow HPowGate . . . Inv. of S S_H . sdg . . Inv. of T T_H . tdg . . Sqrt of X V . . . . Inv. sqrt of X V_H . . . . Sqrt of Y SqrtY . . . . Inv. sqrt of Y SqrtY_H . . . .
Two qubit gates
Powers of X⊗X XX XXPowGate . . . Powers of Y⊗Y YY YYPowGate . . . Powers of Z⊗Z ZZ ZZPowGate . . . Canonical Can . . . . Controlled-Not CNOT CNOT cx CNOT CNOT Controlled-Z CZ CZ cz CZ CZ Controlled-Y CY . cy . . Controlled-Hadamard CH . ch . . Controlled-V CV . . . . Controlled-inv-V CV_H . . . . Powers of CNOT CXPow CNotPowGate . . . Powers of CY CYPow . . . . Powers of CZ CZPow CZPowGate . . . Swap Swap SWAP swap . SWAP Exchange Exch SwapPowGate (*) . . iSwap ISwap ISWAP . ISWAP . XY (powers of iSwap) XY ISwapPowGate(*) . XY(*) . Givens rotation Givens givens . . . Barenco Barenco . . . . B (Berkeley) B . . . . Sqrt-iSWAP SqrtISwap . . . . Inv. of sqrt-iSWAP SqrtISwap_H . . . . Sqrt-SWAP SqrtSwap . . . . Inv. of sqrt-SWAP SqrtSwap_H . . . . ECP ECP . . . . W (Dual-rail Hadamard) W . . . . Controlled-S CS . . . . Controlled-T CT . . . .
Three qubit gates
Toffoli CCNot CCX ccx CCNOT Toffoli Fredkin CSwap CSWAP cswap CSWAP CSWAP Controlled-Controlled-Z CCZ CCZ . . . Deutsch Deutsch . . . . Powers of CCNOT CCXPow CCXPowGate . . . Powers of CCZ . CCZPowGate . . .
Forest specific gates
Controlled-phase CPhase CZPowGate(*) cu1 CPHASE . Controlled-phase on 00 CPhase00 . . CPHASE00 . Controlled-phase on 01 CPhase01 . . CPHASE01 . Controlled-phase on 10 CPhase10 . . CPHASE10 . Parametric Swap PSwap . . PSWAP .
Cirq specific gates
Fermionic-Simulation FSim FSimGate . . . Phased-X gate PhasedX . . . . Powers of Phased-X gate PhasedXPow PhasedXPowGate . . . Sycamore Sycamore Sycamore . . . Fermionic swap FSwap FSwap . . . Powers of fermionic swap FSwapPow FSwapPow . . .
QASM/qiskit gates
QASM’s U3 gate U3 . u3 . Rot QASM’s U2 gate U2 . u2 . QASM’s controlled-U3 CU3 . cu3 . . QASM’s ZZ-rotations RZZ . rzz . CRot Controlled-RX . . . . CRX Controlled-RY . . . . CRY Controlled-RZ CRZ . crz CRZ ========================== =========== =============== =========== =========== ===========
(*) Modulo differences in parametrization
(**) Cirq defines XX, YY, and ZZ gates, as XX^1, YY^1, ZZ^1 which are direct products of single qubit gates. (e.g. XX(t,0,1) is the same as X(0) X(1) when t=1)