QubitLab
IDELearnPlaygroundDocsCommunity
Log in
QubitLab
IDELearnPlaygroundDocsCommunity
Log in
HomeLearnCatalogRanksPlaygroundDocs
  1. Docs
  2. Every gate, interactive
Learn
  • Quantum basics
  • OpenQASM 3 cheat sheet
  • All gates, with the math
  • Every gate, interactive
  • Entanglement: how CNOT connects qubits
Circuits
  • Dynamic circuits: if/else, loops and conditions
Lessons
  • Learning path: from one qubit to algorithms
  • Quantum machine learning by hand
Run
  • Compile (transpile): levels, basis gates, topology
  • Simulators, noise, T1/T2 and fake backends
  • Python in the Playground
  • GitHub and git in the Playground
  • Articles and sharing
Analyze
  • Metrics: comparing distributions
  • Q-sphere and Bloch spheres
Hardware
  • Real IBM Quantum hardware
  • Device topology and calibration heat maps
  • Benchmark circuits: MQT Bench and QASMBench
Advanced
  • Circuit cutting, in depth
Story
  • The story of quantum computing
  • The Hamiltonian: where gates come from
  • What to expect next
Documentation/Learn/Every gate, interactive

Every gate, interactive

The palette covers the gates you draw most. Quantum computing has many more: general rotations, controlled versions, Ising interactions, and the native gates of real chips. Try any of them here on any input state and watch the matrix multiply the vector.

Catalog

All 30 gates in the lab, grouped by family. Two-qubit matrices use Qiskit ordering: qubit 0 is the rightmost bit and is the control.

GateQubitsFamilyMatrixNote
Identity (I)1pauli(10​01​)Does nothing; a wait of one cycle.
Pauli-X1pauli(01​10​)Bit flip, π about X.
Pauli-Y1pauli(0i​−i0​)Bit and phase flip, π about Y.
Pauli-Z1pauli(10​0−1​)Phase flip, π about Z.
Hadamard (H)1clifford2​1​(11​1−1​)Superposition; swaps X and Z axes.
S (√Z)1phase(10​0i​)Phase π/2 on |1⟩.
S†1phase(10​0−i​)Phase −π/2 on |1⟩.
T (⁴√Z)1phase(10​0eiπ/4​)Phase π/4; non-Clifford, needed for universality.
T†1phase(10​0e−iπ/4​)Phase −π/4.
√X1clifford21​(1+i1−i​1−i1+i​)Half an X; native on IBM.
√X†1clifford21​(1−i1+i​1+i1−i​)Inverse of √X.
RX(θ)1rotation(cos2θ​−isin2θ​​−isin2θ​cos2θ​​)Rotation about X. RX(π) = −iX.
RY(θ)1rotation(cos2θ​sin2θ​​−sin2θ​cos2θ​​)Rotation about Y; real amplitudes.
RZ(φ)1rotation(e−iφ/20​0eiφ/2​)Rotation about Z; free on IBM hardware.
P(λ)1rotation(10​0eiλ​)Phase gate; P(π)=Z, P(π/2)=S, P(π/4)=T.
U(θ, φ, λ)1general(cos2θ​eiφsin2θ​​−eiλsin2θ​ei(φ+λ)cos2θ​​)The most general single-qubit gate; every 1-qubit gate is a U.
CNOT (CX)2two-qubit​1000​0001​0010​0100​​Flips q1 when q0 is 1 (Qiskit order: q0 is the rightmost bit).
Controlled-Y2two-qubitC(Y)Y on the target when the control is 1.
Controlled-Z2two-qubitdiag(1,1,1,−1)−1 phase on |11⟩; symmetric; native on Heron.
Controlled-H2two-qubitC(H)Hadamard on the target when the control is 1.
Controlled-phase CP(λ)2two-qubitdiag(1,1,1,eiλ)Phase e^{iλ} on |11⟩ only; the QFT building block.
Controlled-RX(θ)2two-qubitC(RX​(θ))RX on the target when the control is 1.
Controlled-RY(θ)2two-qubitC(RY​(θ))RY on the target when the control is 1; W-state preparation.
Controlled-RZ(φ)2two-qubitC(RZ​(φ))RZ on the target when the control is 1.
SWAP2two-qubit​1000​0010​0100​0001​​Exchanges the qubits; three CNOTs.
iSWAP2two-qubit​1000​00i0​0i00​0001​​SWAP with an i phase on the swapped states; native on some superconducting chips.
ECR2two-qubit2​1​​001−i​00−i1​1i00​i100​​Echoed cross-resonance: IBM Eagle's native entangler, CNOT up to 1-qubit gates.
DCX2two-qubit​1000​0010​0001​0100​​Two CNOTs back to back with controls swapped.
RXX(θ)2isinge−iθX⊗X/2XX interaction, trapped-ion native (Mølmer–Sørensen).
RYY(θ)2isinge−iθY⊗Y/2YY interaction.
RZZ(θ)2isingdiag(e−iθ/2,eiθ/2,eiθ/2,e−iθ/2)ZZ interaction: the QAOA cost term; native on Heron (fractional gates).

Why these gates are enough

Any unitary on n qubits can be built from single-qubit rotations plus one entangling gate such as CNOT (Solovay–Kitaev, Barenco et al. 1995). The Clifford gates {H, S, CNOT} alone are not universal and can be simulated classically (Gottesman–Knill); adding T makes the set universal. That is why T-count matters in fault tolerance and why √X + RZ + CX/ECR/CZ is all a real IBM chip needs.

U=eiαRZ​(β)RY​(γ)RZ​(δ)
Z–Y decomposition: every single-qubit unitary is three rotations and a global phase. The transpiler uses this to merge any run of 1-qubit gates into one U, then into RZ·√X·RZ·√X·RZ.
← Previous
All gates, with the math
Next →
Dynamic circuits: if/else, loops and conditions
On this page
  • Catalog
  • Why these gates are enough
Try it in the IDE →
QubitLab
IDELearnPlaygroundDocsCommunity
Log in
QubitLab
IDELearnPlaygroundDocsCommunity
Log in

Gate Lab: try any gate on any state

Choose a gate, set its angle, pick the input qubit state(s). Everything below is computed live in your browser: the numeric matrix, matrix × vector, the output ket, the probabilities and the Bloch spheres.

Superposition; swaps X and Z axes.

Input state

Matrix (symbolic and numeric)

Calculation: U · |ψ_in⟩ = |ψ_out⟩

Probabilities

  • |0⟩50.0%
  • |1⟩50.0%

Bloch sphere(s) of the output