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.
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.
Matrix (symbolic and numeric)
Calculation: U · |ψ_in⟩ = |ψ_out⟩
Probabilities
- |0⟩50.0%
- |1⟩50.0%
Bloch sphere(s) of the output
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.
| Gate | Qubits | Family | Matrix | Note |
|---|---|---|---|---|
| Identity (I) | 1 | pauli | Does nothing; a wait of one cycle. | |
| Pauli-X | 1 | pauli | Bit flip, π about X. | |
| Pauli-Y | 1 | pauli | Bit and phase flip, π about Y. | |
| Pauli-Z | 1 | pauli | Phase flip, π about Z. | |
| Hadamard (H) | 1 | clifford | Superposition; swaps X and Z axes. | |
| S (√Z) | 1 | phase | Phase π/2 on |1⟩. | |
| S† | 1 | phase | Phase −π/2 on |1⟩. | |
| T (⁴√Z) | 1 | phase | Phase π/4; non-Clifford, needed for universality. | |
| T† | 1 | phase | Phase −π/4. | |
| √X | 1 | clifford | Half an X; native on IBM. | |
| √X† | 1 | clifford | Inverse of √X. | |
| RX(θ) | 1 | rotation | Rotation about X. RX(π) = −iX. | |
| RY(θ) | 1 | rotation | Rotation about Y; real amplitudes. | |
| RZ(φ) | 1 | rotation | Rotation about Z; free on IBM hardware. | |
| P(λ) | 1 | rotation | Phase gate; P(π)=Z, P(π/2)=S, P(π/4)=T. | |
| U(θ, φ, λ) | 1 | general | The most general single-qubit gate; every 1-qubit gate is a U. | |
| CNOT (CX) | 2 | two-qubit | Flips q1 when q0 is 1 (Qiskit order: q0 is the rightmost bit). | |
| Controlled-Y | 2 | two-qubit | Y on the target when the control is 1. | |
| Controlled-Z | 2 | two-qubit | −1 phase on |11⟩; symmetric; native on Heron. | |
| Controlled-H | 2 | two-qubit | Hadamard on the target when the control is 1. | |
| Controlled-phase CP(λ) | 2 | two-qubit | Phase e^{iλ} on |11⟩ only; the QFT building block. | |
| Controlled-RX(θ) | 2 | two-qubit | RX on the target when the control is 1. | |
| Controlled-RY(θ) | 2 | two-qubit | RY on the target when the control is 1; W-state preparation. | |
| Controlled-RZ(φ) | 2 | two-qubit | RZ on the target when the control is 1. | |
| SWAP | 2 | two-qubit | Exchanges the qubits; three CNOTs. | |
| iSWAP | 2 | two-qubit | SWAP with an i phase on the swapped states; native on some superconducting chips. | |
| ECR | 2 | two-qubit | Echoed cross-resonance: IBM Eagle's native entangler, CNOT up to 1-qubit gates. | |
| DCX | 2 | two-qubit | Two CNOTs back to back with controls swapped. | |
| RXX(θ) | 2 | ising | XX interaction, trapped-ion native (Mølmer–Sørensen). | |
| RYY(θ) | 2 | ising | YY interaction. | |
| RZZ(θ) | 2 | ising | 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.