So far, every gate you’ve met has done something visible — flipping a bit, creating a superposition, rotating by . This lesson introduces two gates that look, in the computational basis, like they do almost nothing.
That’s the point.
The S gate
The gate, also called the phase gate, is:
All it does is multiply the component by . It leaves alone. On a pure or pure state, you’d never know anything happened — and are the same state up to global phase.
On a superposition, though, it rotates the relative phase by . Geometrically, it’s a rotation around the -axis of the Bloch sphere. If you start at on the equator and apply , you end up at — still on the equator, but a quarter-turn around.
Here’s the crucial fact: is the square root of :
Apply twice — you get . Which makes sense geometrically: is a rotation around the -axis, and is half of that.
The T gate
The gate is the square root of — an eighth of a full revolution around the -axis:
So rotates relative phase by (that’s ). And:
is even more subtle than . But it’s arguably the most important gate in fault-tolerant quantum computing — we’ll come back to why in a moment.
See them in action
The widget now has and buttons. Try these:
- Start from . Apply . Nothing visible happens. Apply . Still nothing.
- Reset. Apply first (making ). Now apply — the state moves from to . Apply again — now you’re at . Two gates = one gate, which is exactly what says.
- Reset. , then , then , then , then — four s should equal a .
- Reset. , then , then . Where does the state land? (This is a genuinely interesting place. It’s called a magic state.)
Why we care about T
There’s a deep theorem in quantum computing called the Solovay–Kitaev theorem that says: given a small universal set of gates, you can approximate any single-qubit gate to arbitrary precision using only gates from that set. The most commonly used universal set for fault-tolerant quantum computers is:
The , , and gates are all “Clifford” gates — they have nice algebraic properties that make them easy to make fault-tolerant. But Clifford gates alone are not universal; you can only reach a finite subset of quantum states with them (this is the Gottesman–Knill theorem).
The one gate that breaks Clifford and gives you full universality is . It’s the magic ingredient.
The catch: is much harder to make fault-tolerant than Cliffords. On real fault-tolerant quantum hardware, the bottleneck is almost always the T count — the number of gates in your circuit. Quantum algorithms are often described in terms of how many s they need, because that’s what determines how long they take to run on a real machine.
So looks like the gentlest possible gate — a tiny phase twist — but it’s carrying more weight than any gate except maybe the Hadamard.
What’s next
The Pauli, Hadamard, S, and T gates are all discrete — fixed rotations by specific angles. The next lesson introduces rotation gates, which give you continuous control over the angle. You’ll be able to rotate by any amount you want, and you’ll see that all the discrete gates we’ve met so far are just special cases of continuous rotations.