What is a Qubit?
Forget the magical coin. A qubit is a unit vector in a two-dimensional complex space — and on this page, you can poke it.
You've probably been told a qubit is “a bit that can be 0 and 1 at the same time.” That is, technically, true. It is also useless as a mental model. It doesn't tell you what's actually on the wire, it doesn't predict what gates do, and it absolutely won't survive contact with a circuit diagram.
Here is the model that actually works: a qubit's state is a
two-component complex vector (α, β) with
|α|² + |β|² = 1. The squared magnitudes are the
probabilities of measuring |0⟩ or |1⟩.
Everything else — superposition, phase, the Bloch sphere, why
quantum gates are “rotations” — falls out of those two
facts.
We're not going to dwell on the math up front. You're going to play with the state for a few minutes first, and we'll fill in the symbols underneath. Every widget on this page is driven by a real (and very tiny) quantum simulator running in your browser. You can open DevTools and poke it.
Press a gate, watch the state
Start with |0⟩. The probability bars show two outcomes;
only the left one is on. Now press H (the Hadamard
gate). The probabilities split evenly: a 50/50 superposition.
P(|0⟩) = …, P(|1⟩) = …
…
Try this: press H twice in a row. You
end up back at |0⟩. The Hadamard gate is its own
inverse — applying it again “undoes” the superposition.
That's not magic, that's H · H = I.
Try this: press H then Z.
The bars don't move — Z doesn't change the
probabilities of |0⟩ vs. |1⟩. But look at
the state-vector readout. The amplitude in front of
|1⟩ flipped sign. That sign is called a
phase, and it'll come back to haunt us in a moment.
The state, geometrically
Two complex numbers with a normalization constraint and a free
overall phase have exactly two real degrees of freedom — which means
every single-qubit state can be drawn as a point on the surface of
a sphere. North pole is |0⟩, south pole is
|1⟩, equator is the equal-superposition states. This is
the Bloch sphere.
Try dragging the arrow tip. Apply a gate above and watch the arrow rotate.
Try this: drag the arrow to the equator (anywhere
on the equator). The probability bars go to 50/50. Now press
Z. The bars don't move — but the arrow rotates around
the vertical axis. That's what a Z phase rotation looks
like geometrically. Phase isn't “invisible”; it lives
around the equator.
Try this: reset, then press H, then
drag the arrow to the south pole. Press H again. Where
does the arrow land? Why? (Hint: the math nerds box at the bottom
of the page has the full matrix.)
Continuous rotation
Discrete gates jump between named states. Rotation gates
sweep continuously: drag a slider and watch the state smear smoothly
from |0⟩ toward |1⟩ and back. Each slider
snapshots the state when you grab it, so sweeping back to 0
always returns you to where you started — they don't compound.
Try this: press H, then sweep
Rz(θ) from 0 to 2π. The probabilities
never budge. But the Bloch arrow spins around the vertical axis
a full turn. Phase, again — alive and visible.
Try this: reset, then sweep Ry(θ) to
exactly π. You land on |1⟩. That's the
continuous, half-way-rotation version of the discrete X
gate: X ≈ Ry(π) up to a global phase. Every discrete
gate has a smooth, parameterized cousin.
Make this page yours
Found a moment that clicked? Double-click any widget to drop a sticky note. Your notes live in your browser's local storage — they'll be here when you come back. (The “Reset annotations on this page” link at the bottom wipes them.)
Self-test
-
You apply
HZHto|0⟩. What state do you end up in, and why is that equivalent to applyingX? (Try it with the buttons.) -
Rz(θ)never changes measurement probabilities in the computational basis. So why is it useful at all? (Hint: think about what happens if you applyHafter theRz.)
What the gates are, formally
A single qubit's state is a unit vector in :
The Hadamard gate as a 2×2 matrix:
The Pauli-Z gate (only affects phase of ):
Rotation about the X axis by θ — note the angle is θ/2, a quirk of mapping double-cover SU(2) to the Bloch sphere:
For the math nerds
The Bloch sphere is the visualization of pure single-qubit states modulo global phase. Two states that differ only by a unit complex scalar are physically indistinguishable, so we represent a qubit as a point on the unit 2-sphere parameterized by (θ, φ):
All single-qubit gates are 2×2 unitaries — i.e. elements of . Modulo a global phase they're rotations of the Bloch sphere, which is why “rotation gates” is the right mental model, not “logic gates.”
A keyboard-only note: the sliders are fully operable with the arrow keys (Page Up/Down jumps in bigger increments). Drag on the Bloch sphere is also reachable as “drag the arrow tip with the pointer” — pointer events cover mouse, touch, and pen.