Single-Qubit Gates
X, Y, Z, H, S, T — the moves you can make on one qubit
By the end of this topic you'll be able to
A single-qubit gate is a 2×2 unitary matrix. There are infinitely many, but a handful recur so often in the literature that they earn their own single-letter names — learn these cold, since they are the vocabulary every circuit diagram is written in.
X, the bit flip, swaps |0⟩ and |1⟩. On the Bloch sphere it is a 180° rotation about the x-axis, exchanging the poles.
Z, the phase flip, leaves |0⟩ alone and sends |1⟩ to −|1⟩ — no change whatsoever to measurement probabilities in the computational basis, only a flip of relative phase. That flip stays invisible until the qubit passes through a Hadamard afterward, at which point it becomes a real, measurable difference.
Binney and Skinner build the Hadamard operator directly from its matrix, UH = (1/√2)[[1,1],[1,−1]] in the computational basis, and note the identity U²_H = I: applying it twice is its own inverse, turning a superposition of representable numbers back into an actual number.
Geometrically, H is a 180° rotation about the diagonal axis halfway between x and z on the Bloch sphere — which is exactly why H·Z·H = X: conjugating a phase flip by two Hadamards turns it into a bit flip, since the Hadamard swaps the roles the x- and z-axes play.
Binney and Skinner introduce a second single-qubit building block, the phase operator U¹_φ, which leaves |0⟩ untouched and multiplies |1⟩ by e^{iφ}. S and T are the special cases φ=π/2 and φ=π/4, satisfying S²=Z and T²=S — smaller rotations of the Bloch vector partway around the equator rather than a full half-turn.
They go on to show that alternating just two Hadamards with two suitably chosen phase-shift operators is enough to carry |0⟩ to literally any single-qubit state whatsoever, for any desired θ and φ — a small, concrete illustration of a much larger fact.
That larger fact is universality: {H, S, T}, together with CNOT for multi-qubit interaction, form a universal gate set, meaning circuits built only from these can approximate any unitary to arbitrary precision. This is the entire justification for why real quantum hardware only ever needs to implement a small, fixed set of gates natively.
Try It Yourself
Apply H, then Z, then H, to the state |0⟩ (i.e. compute H·Z·H|0⟩), step by step, and check it matches X|0⟩.
- 1Start with |0⟩ = (1, 0). Apply H: H|0⟩ = (1/√2)(|0⟩+|1⟩) = (1/√2)(1, 1) — the familiar |+⟩ state.
- 2Apply Z: Z leaves |0⟩ alone and flips the sign of |1⟩, so Z(1/√2)(|0⟩+|1⟩) = (1/√2)(|0⟩−|1⟩) = (1/√2)(1, −1) — the state |−⟩.
- 3Apply H again: H(1/√2)(|0⟩−|1⟩) = (1/√2)[H|0⟩ − H|1⟩] = (1/√2)[(1/√2)(|0⟩+|1⟩) − (1/√2)(|0⟩−|1⟩)] = (1/√2)(1/√2)(2|1⟩) = |1⟩.
- 4So H·Z·H|0⟩ = |1⟩ — exactly what X|0⟩ gives directly, confirming H·Z·H = X on this input.
H·Z·H|0⟩ = |1⟩, matching X|0⟩ = |1⟩ — a direct numerical confirmation of the identity H·Z·H = X stated in the lesson.
Reference
| X (Pauli-X) | Bit flip: |0⟩↔|1⟩; 180° about x-axis | |
| Z (Pauli-Z) | Phase flip: |1⟩→−|1⟩; 180° about z-axis | |
| H (Hadamard) | Creates equal superposition; H²=I | |
| S (phase gate) | Quarter phase rotation; S²=Z | |
| T (π/8 gate) | Eighth phase rotation; T²=S |
Quick Check
What does the Z gate do to the state |0⟩?
Why does H·Z·H equal X?