Quantum Outpost

Reference

Quantum gate cheatsheet

Every gate you'll meet in a quantum-computing tutorial — with the matrix, what it does on the Bloch sphere, the Qiskit call, and the CNOT cost on real hardware. Bookmarkable.

Single-qubit gates

Gate Matrix Bloch action Qiskit

I

Identity

10
01

Does nothing. Useful as a placeholder for delay-equivalent operations.

no rotation qc.id(0)

X

Pauli-X / NOT

01
10

Bit flip. |0⟩ ↔ |1⟩. 180° rotation around the x-axis of the Bloch sphere.

180° around x qc.x(0)

Y

Pauli-Y

0−i
i0

Bit flip + phase flip combined. 180° rotation around the y-axis.

180° around y qc.y(0)

Z

Pauli-Z

10
0−1

Phase flip. Leaves |0⟩ alone, sends |1⟩ → −|1⟩. 180° rotation around the z-axis.

180° around z qc.z(0)

H

Hadamard

1/√21/√2
1/√2−1/√2

Maps |0⟩ → |+⟩ and |1⟩ → |−⟩. The superposition-maker. Self-inverse: H² = I.

180° around (x̂ + ẑ)/√2 qc.h(0)

S

Phase (S = √Z)

10
0i

Quarter-turn phase: |1⟩ picks up factor of i. S² = Z. Clifford.

90° around z qc.s(0)

T

T (= ⁴√Z)

10
0e^{iπ/4}

Eighth-turn phase. T⁴ = Z, T⁸ = I. Non-Clifford — drives quantum advantage.

45° around z qc.t(0)

Rx(θ)

Rotation around x

cos(θ/2)−i·sin(θ/2)
−i·sin(θ/2)cos(θ/2)

Continuous rotation around x. Note the half-angle (spinor).

θ around x qc.rx(theta, 0)

Ry(θ)

Rotation around y

cos(θ/2)−sin(θ/2)
sin(θ/2)cos(θ/2)

Continuous rotation around y. The only Pauli-axis rotation with all real entries.

θ around y qc.ry(theta, 0)

Rz(θ)

Rotation around z

e^{−iθ/2}0
0e^{iθ/2}

Continuous phase rotation. Diagonal — never changes Z-basis probabilities.

θ around z qc.rz(theta, 0)

Multi-qubit gates

Gate What it does CNOT cost Qiskit

CNOT (CX)

Controlled-NOT

Flips target iff control is |1⟩. The canonical entangler. Self-inverse. 1 (native) qc.cx(control, target)

CZ

Controlled-Z

Flips phase of |11⟩, leaves others alone. Symmetric in control/target. 1 (= H · CNOT · H on target) qc.cz(0, 1)

SWAP

SWAP

Exchanges two qubits' states. Lots of qubit-routing cost on real hardware. 3 CNOTs qc.swap(0, 1)

iSWAP

iSWAP

SWAP with extra i on the off-diagonal. Native on some superconducting hardware. ~4 CNOTs qc.append(iSwapGate(), [0, 1])

CCNOT (Toffoli)

Controlled-controlled-NOT

Reversible AND. Flips target iff both controls are |1⟩. Foundation of quantum arithmetic. 6 CNOTs + 7 T gates qc.ccx(0, 1, 2)

CSWAP (Fredkin)

Controlled-SWAP

Swaps qubits 1 and 2 iff qubit 0 is |1⟩. 1 Toffoli + 2 CNOTs qc.cswap(0, 1, 2)

Controlled-U

Generic controlled unitary

Apply any single-qubit U to target iff control is |1⟩. 2 CNOTs + 3 single-qubit rotations U.control(1)

Useful identities

X² = Y² = Z² = I Each Pauli is its own inverse.
XY = iZ, YZ = iX, ZX = iY Cyclic Pauli products.
S² = Z, T² = S, T⁴ = Z, T⁸ = I The phase-gate tower.
H X H = Z, H Z H = X, H Y H = −Y Hadamard swaps the x and z axes.
CNOT(a→b) = (I ⊗ H) · CZ · (I ⊗ H) CNOT and CZ differ by Hadamards on the target.
SWAP = CNOT(0→1) · CNOT(1→0) · CNOT(0→1) Three-CNOT decomposition of SWAP.
U = e^{iα} Rz(γ) Ry(β) Rz(δ) Any single-qubit gate as 3 Euler-angle rotations.
Rz(2π) = −I (not I) Half-angle = spinor weirdness; Rz(4π) = I.

Hardware gate-error budget

Two-qubit gates dominate real-hardware error. Rough 2026 numbers:

Hardware 2-qubit gate error Coherence T₁
IBM Heron r23 × 10⁻³~300 µs
Quantinuum H21 × 10⁻³~50 s
IonQ Forte4 × 10⁻⁴~60 s
Google Willow4 × 10⁻³~100 µs
QuEra (neutral atom)5 × 10⁻³~20 s

Rule of thumb: for a circuit with n two-qubit gates and per-gate error p, expected fidelity ≈ (1 − p)n. A 50-CNOT circuit on Heron r2 lands at ~85% fidelity; 200 CNOTs at ~55%; 500 CNOTs is mostly noise.

Want the full derivation behind any of these? The Gates & Circuits track covers each gate from first principles. Or try them in the playground.