One qubit
A normal computer stores bits. A bit is always exactly 0 or exactly 1, like this lamp: off or on. Reading it never changes it. Everything in a laptop is built from billions of these.
A qubit (quantum bit) is drawn as an arrow inside a sphere. Pointing up is the state |0⟩, pointing down is |1⟩. Unlike a bit, the arrow can also point anywhere in between.
Gates and measuring
Quantum gates are operations that rotate the arrow. The Hadamard gate, H, takes |0⟩ (up) and turns it a quarter of the way round, to the equator: an equal superposition of |0⟩ and |1⟩.
On the equator the qubit is in superposition: a blend of 0 and 1 with two weights called amplitudes. Square each amplitude to get a chance: here 50% for 0 and 50% for 1.
Measuring the qubit gives a plain 0 or 1, at random, with those chances. The superposition is gone: the arrow jumps to the pole it showed. Prepare and measure again and the answer may differ.
Interference and entanglement
Add a second H. Each H splits the amplitudes; on the way back the two paths to 1 have opposite signs and cancel, while the paths to 0 add up. The result is 0 every time.
Now an H and a CNOT gate act on two qubits. They become entangled: each result alone is 50/50, yet the two always agree, 00 or 11, never 01 or 10. Neither arrow has a direction of its own.
Useful algorithms arrange interference so wrong answers cancel and the right one grows. Grover search with four answers starts each at 25%; one step leaves the marked answer, 11, at 100%.
Real machines
Qubits are fragile. Heat and stray signals from outside leak in and blur the state: decoherence. Then interference fails: the same H, H circuit now gives 0 or 1 at 50/50, not 0 every time.
Error correction spreads one reliable "logical" qubit over many physical ones and keeps checking them. Google's Willow chip (2024) used 101 of its 105 qubits for one logical qubit; bigger codes made fewer errors.
Today's machines are small and noisy. A quantum computer is not a faster laptop: it helps only with special problems, such as simulating molecules or factoring, and an ordinary computer still runs it.
The maths, step by step
;; step 1/11 · bit ;; about: Ordinary bit Classical bit: one of two values, 0 or 1. Read it as often as you like: you get the same value every time. 2 bits hold one of 4 values at a time; n bits hold one of 2^n values.
The figure follows the standard textbook model (Nielsen and Chuang, Quantum Computation and Quantum Information): a qubit is a|0⟩ + b|1⟩, a measurement gives 0 with probability |a|^2. Only real amplitudes are used, so every arrow stays on one circle of the sphere. The measurement results shown (1 0 0 1 1 0 and 00 11 11 00) are one example run. Real results are random; only the probabilities are fixed.