A quantum gate is a transformation applied to a qubit. Give it a state and it gives you a new state. Classical computers have gates too — NOT, AND, OR — and they flip bits according to some rule. Quantum gates flip, rotate, twist, and mix qubits in ways that classical gates can’t.
We’re going to start with the single most important quantum gate: the Hadamard, written . It has one job: take a definite state ( or ) and put it into a superposition.
What H does
Here’s the rule, in Dirac notation:
Notice that applied to gives you — the equal-superposition state you met in Lesson 2. And applied to gives you , which has the same probabilities on measurement but a different relative phase.
The gate’s matrix form is:
The out front is what keeps the state normalized. The minus sign in the bottom right is where the relative phase of comes from.
Try it
The widget below starts with a qubit in — the north pole of the Bloch sphere. Click H and watch three things happen at once:
- The state vector on the Bloch sphere swings to the equator.
- The state-vector display updates from to .
- The probability bars go from to .
There it is. You just made a superposition.
Try it again: reset, apply , then apply a second time. The qubit comes back to . That’s because:
is its own inverse — applying it twice undoes it. That’s a special property; most gates don’t have it. It means a single Hadamard is like a toggle between “definite” and “superposition” for a qubit that starts in or .
The other buttons
The widget has buttons for , , and too — the Pauli gates. You’ll meet them properly in Module 3.1, but you can already play:
- X is the quantum version of NOT. It swaps and — a rotation of around the Bloch sphere’s -axis.
- Y is a rotation of around the -axis. It flips and adds an phase.
- Z is a rotation of around the -axis. It leaves alone and multiplies by .
Notice that doesn’t do anything visible to — the state stays at the north pole — but if you first apply to make a superposition, then apply , the state lands somewhere different than if you’d applied alone. That’s the relative phase sneaking in. It’s invisible on a definite state, but it matters once the qubit is in a superposition.
Why it matters
Every quantum algorithm you’ll ever see — Deutsch-Jozsa, Grover, Shor, VQE, everything — starts with a layer of Hadamards. The very first move is almost always: “put the qubits into a uniform superposition over all possible inputs.”
That’s because superposition is the raw material quantum computers work with. A single qubit in is “both answers at once” in a very loose sense. An array of qubits all in is a superposition over possible bitstrings — a vast number even for modest .
You’ve now seen how to create that starting state: one Hadamard per qubit. The interesting part — what you do with that superposition to get a useful answer — is the subject of Module 7.
What you’ve learned
In these five lessons you’ve gone from “I’ve heard about qubits” to:
- Knowing what a qubit is (Lesson 2.1)
- Being able to visualize any single-qubit state (Lesson 2.2)
- Understanding what happens when you measure one (Lesson 2.3)
- Applying a gate to create a superposition on purpose. (This lesson.)
That’s the foundation. Every quantum computing concept builds on top of what you now know. Module 2 wraps up with global vs. relative phase, and Module 3 fills out the rest of the single-qubit gates. Module 4 introduces a second qubit, and that’s where things get really strange.
Until then — play with the widgets. Go back to Lesson 2.2 and try to reason about what each button on the Bloch sphere explorer is doing in terms of amplitudes. The picture and the math belong together, and the more you see the same idea in both forms, the more natural it becomes.