Chapter 08

Why It Matters

Quantum computers aren't faster at everything. They win on a narrow set of problems where superposition, interference, and entanglement line up — and there the gap can be astronomical. Here's where, and the complexity math behind it.

↩ before you start · keep these handy
·From Ch. 2: n qubits hold all 2ⁿ possibilities in superposition at once.
·From Ch. 3: measuring a superposition returns just one random outcome.
·From 0.2: amplitudes can add or cancel — that's interference, the engine of every speedup.
🔑 symbol decoder · every new mark, in plain words
N = 2ⁿthe size of the search space for n qubits. √NGrover's step count — the quadratic quantum speedup. O(···)"big-O" — shorthand for how an algorithm's cost grows with input size. poly vs exppolynomial growth is tame; exponential (2ⁿ) explodes. interferenceamplitudes adding or cancelling to push the right answer to the front. speedupclassical cost ÷ quantum cost — how many fewer steps the quantum way takes.
§1

Watch the gap open

Searching an unstructured list of N = 2ⁿ items takes about N tries classically. Grover's quantum algorithm needs only about √N. Drag the size and compare.

📄 everyday picture

Fold a sheet of paper in half over and over. After 10 folds it's about as thick as your hand; after 42 folds — if you could — it would reach the Moon. That's exponential growth: each extra step doubles everything. Problems whose cost grows like 2ⁿ explode the same way, which is why shaving the exponent (Shor) — or even just the base (Grover) — is worth a fortune.

▸ scalesearch(2ⁿ)
search space · {{ advItems }} items  (n = {{ advN }} qubits)
classical · N{{ advClassical }}
quantum · √N{{ advQuantum }}
≈ {{ advSpeedup }}× fewer steps
✎ worked example · the speedup at n = 20
1.n = 20 → N = 2²⁰ ≈ 1,048,576 items
2.classical search ≈ N ≈ 1.05 million tries
3.Grover ≈ √N = √1,048,576 = 1,024 tries
4.speedup ≈ N ÷ √N = √N ≈ 1,024× fewer steps. ✓
recapClassical search scales like N; Grover like √N — and that gap widens fast with size.
§2

How the speedup actually works

A qubit register really can hold all N possibilities at once — but if you just measured, you'd get a random one, no better than guessing. The trick is interference: a quantum algorithm nudges amplitude away from wrong answers and onto the right one before you look.

Below are 16 items, all equally likely. Each Grover step rotates a little more amplitude onto the marked answer. Watch how few it takes.

▸ rungrover.amplify()
{{ b.tick }}
P(correct answer) = {{ grPct }}%  ·  step {{ grIters }} / peak ≈ {{ grOpt }}
{{ grStatus }}

Sixteen items, yet about three steps brings the answer near certainty — and the count grows like √N, not N. Keep clicking past the peak and the amplitude swings back: timing the measurement is part of the algorithm. This is the whole reason a quantum computer is more than a fast guesser.

recapSuperposition alone is just random guessing; interference is what makes the right answer likely.
§3

Where the wins are

SearchGrover · √N

Quadratic speedup for finding a needle in an unsorted haystack.

FactoringShor · exp→poly

Breaks the math behind today's public-key cryptography.

SimulationChemistry

Model molecules and materials nature can't fake — the natural home advantage.

OptimizationSampling

Promising heuristics for huge combinatorial landscapes.

recapThe real wins are narrow: search, factoring, simulation, and some optimization.
§4 · the mathematics

The language of scaling

Computer scientists rank algorithms by how their cost grows with input size n, written with big-O. The difference between these classes is the whole game:

O(n)
polynomial · easy
O(√N)
Grover · quadratic win
O(2ⁿ)
exponential · intractable

The catch is noise: real qubits decohere in microseconds, so useful machines need error correction — many physical qubits stabilizing one logical qubit. That engineering frontier is where the field's effort sits today.

recapBig-O ranks growth; the jump from exponential 2ⁿ to polynomial is the whole game — if noise allows it.
⚠ the biggest misconception

“A quantum computer tries all answers at once, in parallel universes.” The first half is half-true — the register does hold every possibility in superposition — but you only ever get to read one, at random. There is no free parallelism. The entire art, as §2 shows, is using interference to make the right answer the likely one before you measure. Algorithms that can't arrange that interference get no speedup at all — which is why quantum computers help on so few problems.

✓ you can now
read off the classical-vs-quantum cost for a search of size N
explain why a superposition does not give free parallelism
name the problem classes where quantum actually wins, and the noise barrier in the way
the whole ladder

bit → qubit → measurement → sphere → gates → entanglement → teleportation → advantage.
That's quantum information.

← 7d Repeaters & Swapping next · 8a The Circuit Model