What Is a Gate? Operations on Qubits
In L18 you learned that boxes on circuit wires are called gates. Now you find out what a gate actually is. Not just "an operation" — something far more precise and beautiful: a rotation. Every single quantum gate, no matter how complex, is a rotation on the Bloch sphere. Press X and watch it happen.
The Box in the Circuit
A classical NOT gate takes a 0 and outputs a 1, or takes a 1 and outputs a 0. A quantum X gate acts on a qubit. What is the key difference between them?
In L18 you met the circuit diagram — the universal language of quantum computing. You learned that horizontal wires carry qubits and that labelled boxes drawn on those wires are operations called gates.
But we left the most important question unanswered: what is a gate, actually? What is physically happening inside that box when a qubit passes through it?
The answer is elegant and surprising. A quantum gate is not computation in the classical sense — a lookup table that maps inputs to outputs. It is something the classical world has no equivalent for: a rotation in a geometric space. The qubit's state is a point on a sphere. The gate is a rotation of that sphere. The output is where the arrow ends up.
A Gate Is a Rotation
You met the Bloch sphere in L08. Let's use it precisely now, because it is the key to understanding every gate.
A quantum gate is a rotation of this globe. The X gate rotates the globe 180° around the equatorial X-axis — the north pole ends up at the south pole and vice versa. That is the X gate: it takes $|0\rangle$ to $|1\rangle$ and $|1\rangle$ to $|0\rangle$, exactly like a classical NOT — but it does it geometrically, which means it also works on any point on the sphere, including superpositions.
Apply X to the equator? The equator rotates onto itself — superpositions pick up a phase shift but stay equatorial. Apply X twice? Two 180° rotations = 360° = back where you started. That is why X is its own inverse: $X^2 = I$.
This geometric picture is not just an analogy — it is the exact mathematical truth. Quantum states are unit vectors in a two-dimensional complex Hilbert space, and quantum gates are unitary matrices — the mathematical objects that correspond to rotations in that space. The Bloch sphere is a faithful geometric picture of this algebra.
This also explains something subtle: quantum gates do not "read" the qubit's state. They do not need to know whether the qubit is $|0\rangle$, $|1\rangle$, or a superposition. They just apply a rotation to whatever state is there. The qubit's internal superposition is preserved — it just gets rotated to a new position on the Bloch sphere.
The X Gate — A Complete Deep Dive
The X gate is the simplest and most intuitive quantum gate. Start here and every other gate becomes easier to understand. It is the quantum NOT — but "quantum NOT" does not capture the full picture.
The last row is the crucial one. A classical NOT gate takes 0 to 1 and 1 to 0 — that is all it can do, because classical bits have only two states. The quantum X gate takes any superposition $\alpha|0\rangle + \beta|1\rangle$ and swaps the amplitudes to $\beta|0\rangle + \alpha|1\rangle$. The superposition is preserved — only the amplitudes exchange. This is the amplitude-swapping property that makes it a genuine quantum operation.
The matrix representation — where the numbers live
In the Track 1 spirit we will not derive this from scratch (that is Track 2 content), but you should know that the X gate has a precise mathematical representation as a $2 \times 2$ matrix:
$$X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}$$
This matrix acts on the qubit's state vector $\begin{pmatrix}\alpha \\ \beta\end{pmatrix}$ by matrix multiplication, producing $\begin{pmatrix}\beta \\ \alpha\end{pmatrix}$ — exactly the amplitude swap we described above. The matrix is its own inverse ($X^2 = I$, the identity matrix), which proves that applying X twice returns the original state.
The Four Essential Single-Qubit Gates
These four gates are the vocabulary of quantum computing. Every quantum algorithm uses them — often in combination. Each is a rotation on the Bloch sphere around a specific axis by a specific angle.
Notice the pattern: all four gates are 180° rotations (around different axes), and all four are their own inverse ($G^2 = I$). This is not a coincidence — it is the mathematical signature of a half-turn rotation. More general gates rotate by other angles (90°, 45°, arbitrary angles for universal quantum computing), but these four are the clearest introduction to the rotational nature of quantum gates.
Live Bloch Sphere — Watch Gates Rotate
Press any gate button and watch the state arrow animate along a traced rotation path on the 3D Bloch sphere. The coloured arc shows the exact geodesic (shortest great-circle path) the gate takes. Start from $|0\rangle$ (north pole) and press X — the arrow sweeps south to $|1\rangle$ along a glowing rose arc. Press X again to return. Try H, Z, Y. Drag the sphere to orbit the camera and see the rotation paths from any angle. Chain gates to explore the geometry.
What You Now Know About Quantum Gates
- A quantum gate is a rotation on the Bloch sphereThe qubit's state is a point on a unit sphere. A gate rotates that point to a new position. The X gate rotates 180° around the X-axis (north ↔ south). Every quantum gate, without exception, is a rotation in this sense — a unitary transformation that moves the state vector while preserving the total probability.
- Every gate is reversible — because every rotation has an inverseRotations are always invertible. Rotate 180° clockwise, then 180° anticlockwise — you're back to the start. This is why quantum gates satisfy $U U^\dagger = I$. The four Pauli gates and Hadamard are all self-inverse ($G^2 = I$). Measurement is irreversible because it is not a rotation — it is a collapse, a thermodynamic event.
- The X gate swaps amplitudes — not just 0 and 1On classical bits: $0 \to 1$, $1 \to 0$. On quantum states: $\alpha|0\rangle + \beta|1\rangle \to \beta|0\rangle + \alpha|1\rangle$. The amplitudes swap, the superposition is preserved. On the Bloch sphere, every point moves to its antipodal point (the mirror-opposite position). $X^2 = I$: two X gates cancel exactly.
- The Z gate changes phase invisibly — but decisivelyZ leaves $|0\rangle$ alone and negates $|1\rangle$. Probabilities are unchanged ($|-\beta|^2 = |\beta|^2$). But the phase change affects how the qubit interferes with others. Phase is the currency of quantum algorithms — invisible to any single measurement, but the engine that drives constructive and destructive interference in every quantum speedup.
- The Hadamard gate creates superposition — and undoes itH rotates the north pole to the equator: $|0\rangle \to \frac{1}{\sqrt{2}}(|0\rangle+|1\rangle) = |{+}\rangle$. Applied again: $|{+}\rangle \to |0\rangle$. $H^2 = I$. H is the gate that opens every quantum algorithm's search space — the most used gate in quantum computing. Full treatment in L20.
You understand what a gate is.
Now meet the gate that starts every quantum algorithm —
the one that puts a qubit into superposition
and opens the door to all $2^n$ possibilities at once.
- Nielsen, M. A. & Chuang, I. L. — Quantum Computation and Quantum Information, Cambridge, 2000. §4.2 "Single qubit operations" — canonical derivation of the Pauli gates, Hadamard, and the Bloch sphere representation of unitary operations.
- Preskill, J. — Ph219 Lecture Notes, Chapter 2. theory.caltech.edu/~preskill/ph219/ — Geometric picture of single-qubit gates as SO(3) rotations.
- IBM Qiskit Textbook — "Single qubit gates." learning.quantum.ibm.com — Interactive gate visualisation with circuit execution on real hardware.