9.2
Single-qubit and two-qubit gates
Quantum operations = rotations of the Bloch sphere: Pauli, H, S and T each own one rotation, CNOT wires two qubits together, and a small handful of gates assembles every unitary there is.
Recommended first
After this section you should be able to
- Write the matrices of X, Y, Z, H, S, T, and name each one's Bloch-sphere axis and rotation angle
- Explain why quantum gates must be unitary, and hence reversible
- Work through the CNOT truth table and the full H + CNOT preparation of a Bell state by hand
- State what a "universal gate set" means: why H, T and CNOT suffice
The last section painted every state of a qubit onto a sphere. With the map in hand, the question becomes: how do you get from one point on the sphere to another?
Start with the humblest request: build a NOT gate for a qubit
Everything a classical computer can do comes from a few logic gates: NOT, AND, OR. Try the simplest one first — NOT, which sends 0 to 1 and 1 to 0. For a qubit we require
By linearity (chapter 3’s postulate: evolution is a linear operator), its action on superpositions is completely fixed:
As a matrix, this is the Pauli matrix — renamed the gate in this chapter. So far so good. But try to build AND next and you hit a wall: AND squeezes two inputs into one output (4 possible inputs, 2 possible outputs) — it is irreversible. From an output of 0 you cannot tell whether the input was 00, 01 or 10.
Why the classical-gate mindset falls short
Chapter 3’s time-evolution postulate says: a closed system evolves by , which is unitary. Unitary means , means reversible, means no information lost. So quantum gates obey two iron rules that classical gates do not:
- They must be reversible: information-compressing gates like AND and OR have no direct quantum counterpart;
- They must preserve inner products: it is not enough to say what happens to the basis vectors — the probability structure of every superposition has to stay consistent.
For a single qubit, unitary operations have a beautifully clean geometric meaning:
Single-qubit unitaries = rotations of the Bloch sphereadvanced~7 min
Step 1: take a 2×2 unitary apart. Any can be written with (the global phase is unobservable — discard it). The remaining expands in Pauli matrices as
(The second equality uses to split the exponential series into even and odd terms — word for word the same trick as chapter 5’s derivation of spin precession.)
Step 2: see what it does to the Bloch vector. The state map induces the expectation-value map . Working through the Pauli algebra term by term (or simply quoting chapter 5’s precession result):
This is exactly a three-dimensional rotation by angle about the axis (Rodrigues’ formula).
Conclusion: there is nothing mysterious about single-qubit gates — every one of them is a rigid rotation of the Bloch sphere. The in the exponent is the half-angle relation reminding us again: the operator turns by , the sphere turns by .
The standard single-qubit gate catalogue
| Gate | Matrix | Bloch-sphere action | Mnemonic |
|---|---|---|---|
| 180° about the axis | Quantum NOT; swaps the poles | ||
| 180° about the axis | |||
| 180° about the axis | Puts a minus sign on ; phase flip | ||
| 180° about | Swaps the axis with the axis | ||
| 90° about the axis | |||
| 45° about the axis | ; the one “non-trivial angle” |
Of these, the Hadamard gate deserves a moment of its own:
It turns “definite” into “superposed”, and since , applying it again turns it back. Nearly every algorithm to come opens with “hit every qubit with a row of ‘s” — the standard move for manufacturing superposition and switching on quantum parallelism.
Two-qubit gates: CNOT
However many single-qubit gates you stack up, each just spins its own sphere — no correlation between two qubits ever appears. For a quantum computer to be more than “a row of side-by-side coins”, we need conditional operations: what happens to one qubit depends on the state of another. The most basic is the controlled-NOT gate (CNOT): when the control is it flips the target; when the control is it does nothing.
control ──●── |00⟩ → |00⟩
│ |01⟩ → |01⟩
target ──⊕── |10⟩ → |11⟩
|11⟩ → |10⟩
In matrix form (basis order ):
Its power lies in how it responds to a superposed control. Work through the single most important circuit by hand:
H + CNOT prepares a Bell state: step by stepbasic~5 min
The circuit: both qubits start in ; apply to the first, then CNOT.
|0⟩ ──[H]──●──
│ ⟹ |Φ⁺⟩
|0⟩ ───────⊕──Step 0 (initial state):
Step 1 ( on the first qubit):
Step 2 (CNOT, acting linearly on each branch): (control is 0, nothing happens); (control is 1, target flips).
This state cannot be written in any product form : if it could, the expansion coefficients would need together with ; the latter forces some factor to vanish, contradicting the former. It is an entangled state — and by tweaking the state before the , or the control/initial state of the CNOT, you get all four Bell states:
They are mutually orthogonal and form a basis of the two-qubit space (the Bell basis) — the raw material for every protocol in sections 9.4–9.6.
The picture
Is CNOT a “quantum photocopier”? From the truth table, CNOT seems to “copy” the control onto the target (, valid for ). But on a superposition it delivers entanglement, not two copies: the computed above is emphatically not . “Copying basis states ≠ copying arbitrary states” — the seed of section 9.5’s no-cloning theorem.
The mathematics
If cloning had succeeded we would have
What we actually get is
Their inner product is — genuinely different states.
How many gates are enough? — Universal gate sets
In the classical world, NAND gates alone can build any logic circuit. The quantum counterpart:
Universality theorem (statement): all single-qubit gates plus CNOT can exactly synthesise any -qubit unitary; stronger still, the discrete set alone can approximate any unitary to arbitrary precision.
The intuition comes in three layers: (1) any large unitary matrix decomposes into a chain of elementary rotations that each touch only two basis vectors; (2) each elementary rotation can be assembled from CNOTs plus single-qubit gates; (3) arbitrary single-qubit rotations are generated by and — rotates 45° about , rotates 45° about , and alternating irrational-angle rotations about two different axes can reach every corner of the rotation group (the Solovay–Kitaev theorem further guarantees the approximation error falls exponentially with gate count, at the cost of only a polynomial-length gate sequence).
Key formulas
Single-qubit rotation
Every single-qubit gate is a Bloch-sphere rotation (up to a global phase)
Hadamard
Swaps the z axis with the x axis; the standard opening move of algorithms
The phase family
45°/90°/180° about the z axis
Bell-state preparation
H makes superposition, CNOT turns superposition into entanglement
Universal gate set
Approximates any unitary to arbitrary precision (Solovay–Kitaev)
Self-check4 questions
- 1.
Why does the classical AND gate have no direct quantum counterpart?
- 2.
Apply the Z gate to ∣+⟩ = (∣0⟩+∣1⟩)/√2, then measure along the x axis. What is the probability of getting +1 (i.e. ∣+⟩)?
- 3.
The circuit (H⊗I) followed by CNOT acts on ∣10⟩. Which Bell state comes out?
- 4.
The T gate rotates 45° about the z axis. Using only T gates, what is the minimum number of applications needed to carry the Bloch vector from the +x axis all the way around back to the +x axis (one full turn)?
0% relative tolerance
What comes next
CNOT hands us an unexpected gift: the Bell states — two qubits “welded” together, neither of which owns a state of its own any longer. Last chapter we spoke of entanglement as something you “have or don’t have”, but a natural question immediately arises: and are both entangled — are they “equally deeply” entangled? The next section fits entanglement with a measuring stick.
Section 66 of 106 · use ← → to turn the page