QEC ExplorerQuantum Basics
Part of QEC Explorer · Start here
0 · Basics 1 · Detect 2 · Decode 3 · Noise 4 · qLDPC Notebooks
No physics background needed · Six quick steps

Quantum computing, on a sphere

Before you watch a quantum code catch errors, it helps to know what a qubit actually is and why protecting one is so hard. Every qubit state is a point on the ball below, the Bloch sphere, and every gate just rotates that arrow. Drag any sphere to spin it. No equations here, just buttons to press.

Step 1 of 6

What's a qubit?

An ordinary bit is either 0 or 1. A qubit can be 0, or 1, or a blend of both at once. On the sphere, the top is "definitely 0," the bottom is "definitely 1," and anywhere around the middle is a blend. Click the three states and watch the arrow move. Drag the ball to see it in the round.

A qubit at |0⟩: if you measured it now, you'd get 0 every time.
Tip: drag the sphere to rotate it
Takeaway: a qubit isn't limited to 0 or 1. It can point anywhere on this sphere, and that whole range of "in-between" is where quantum computing's extra power comes from.
Step 2 of 6

The catch: measuring forces a choice

Here's the strange part. While a qubit is in a blend (arrow on the equator), it really is "both." But the instant you measure it, the arrow snaps to a pole, 0 or 1, chosen at random, weighted by the blend. You can't peek without disturbing it. Hit Measure over and over and watch the arrow jump to a pole and the tally fill in.

00
10
An even blend should land on 0 and 1 about half the time each.
Takeaway: you can't just read a qubit to check it. Measuring collapses the blend and destroys the information. This is the whole reason error correction is hard, and the clever trick of the surface code is checking for errors without measuring the data.
Step 3 of 6

What's an "error," then?

Noise nudges a qubit in one of two basic ways. An X flip is a half-turn that swaps top and bottom (a "bit-flip"). A Z flip is a half-turn about the vertical axis (a "phase-flip"): it does nothing to a pure 0 or 1, but it swings a blend from one side to the other. Start from a blend (press H first), then try Z, and watch the arrow swing where a flat 0/1 reading would see nothing.

Start at |0⟩. Try an X flip. Then press H for a blend and try Z.
Takeaway: these two flips, X and Z, are the exact errors you'll inject in the playground. Every error a real qubit suffers is some combination of them, and the sphere is why a phase error is real even when a plain reading can't see it.
Step 4 of 6

Play: gates just rotate the arrow

Everything a quantum computer does to one qubit is a rotation of this arrow. Nothing more exotic than that. Press the gates and watch. X, Y, Z are half-turns about the three axes; H swaps "up/down" with "left/right" (it's how you make a blend); S and T are smaller phase turns; the R gates rotate by a set angle. Chain a few together, then drag the sphere to look from another side.

Pauli half-turns
Phase turns
Rotations (45°)
Takeaway: a quantum "program" is just a sequence of these rotations. Errors are unwanted rotations, exactly the X and Z from the last step, and error correction is the job of spotting and undoing them.
Step 5 of 6

Why not just keep a backup copy?

With ordinary bits, you'd guard against errors by copying: store three copies, and if one flips, the other two outvote it. The obvious fix. But quantum physics flatly forbids it: there is no operation that copies an unknown qubit. It's called the no-cloning theorem. Try it.

Press the button to attempt a copy.
Takeaway: no backups allowed. So instead of copying one qubit, error correction spreads a single piece of information across many qubits in a pattern, so a few failures can be detected and undone. That pattern is exactly what the surface code is.

Now you know what an error is.

You've met the qubit, seen why you can't just read or copy it, and learned the two kinds of error: X and Z. That's everything you need to watch a real quantum code catch one in the act.

Go to the playground →