Quantum Walks
Picture a tipsy person leaving a lamppost, flipping a coin at every step: heads they lurch right,
tails they lurch left. This is the random walk — the workhorse behind diffusion,
gambling ruin, and half the algorithms in classical computer science. After many steps they are
almost certainly still near the lamppost; the crowd of possible walkers piles up in a
bell curve that widens only as \sqrt{t}. Now make the
walker a qubit and let the "coin" be a quantum coin that never commits to heads or tails.
The paths interfere — some cancel, some reinforce — and the walker stops dawdling in
the middle and races to the edges, spreading as fast as t
itself. That quadratic change of pace is the seed of a whole family of quantum algorithms.
The classical walk: diffusive, ~√t
On a line, a classical walker takes a step of +1 or
-1 at each tick, each with probability \tfrac12.
After t independent steps the position is a sum of
t tiny \pm 1 pushes, so by the
independence
of the steps its variance adds up to t:
\operatorname{Var}(x_t) = t, \qquad \sigma_t = \sqrt{t}.
The distribution is a spreading Gaussian centred on the start, and its width grows
only like the square root of the number of steps. Double the walk to
4t steps and the spread merely doubles. This slow, square-root creep is
what "diffusive" means — the same law that governs a drop of ink blurring through still water.
The quantum walk: a coin, a shift, and interference
A discrete-time quantum walk lives in two registers at once:
- a position register, holding a superposition over sites
|x\rangle on the line;
- a coin qubit, with basis states |{\uparrow}\rangle
("go right") and |{\downarrow}\rangle ("go left").
One step of the walk is two unitaries applied in turn:
- Flip the coin with a
Hadamard
C = H on the coin qubit — a superposition of "left" and
"right," not a random choice.
- Shift conditionally with S, which moves the walker in
the direction the coin points:
S\,|{\uparrow}\rangle|x\rangle = |{\uparrow}\rangle|x+1\rangle, \qquad S\,|{\downarrow}\rangle|x\rangle = |{\downarrow}\rangle|x-1\rangle.
The whole step is the single unitary U = S\,(C\otimes I), and
t steps are just U^t — this is an ordinary
quantum circuit,
run coherently, and only measured at the very end. Because H sprinkles
minus signs across the amplitudes, the branches that meet again at the same site can
cancel — and that interference is the whole difference from the classical coin.
Worked example 1: √t versus t, side by side
The cleanest way to feel the gap is a table. The classical spread is
\sigma_t=\sqrt{t}; the quantum walk spreads ballistically,
with the bulk of its probability sitting near \pm\tfrac{t}{\sqrt2} (the two
peaks are the fastest the coherent walker can travel). Watch how the two columns diverge:
\begin{array}{c|c|c} \text{steps } t & \text{classical spread } \sqrt{t} & \text{quantum reach } \tfrac{t}{\sqrt2} \\ \hline 1 & 1 & 0.7 \\ 4 & 2 & 2.8 \\ 25 & 5 & 17.7 \\ 100 & 10 & 70.7 \\ 400 & 20 & 282.8 \end{array}
At t=100 the classical walker has wandered a typical distance of about
10, while the quantum walker's peaks are out near
71 — a seven-fold head start, and the ratio
\tfrac{t/\sqrt2}{\sqrt t}=\tfrac{\sqrt t}{\sqrt2} keeps growing without
bound. That gap is a quadratic speedup in how fast the walker explores the line: to
reach distance d the classical walk needs \sim d^2
steps, the quantum walk only \sim d.
The tell-tale two peaks
The shapes are unmistakable. The classical distribution is a single Gaussian hump centred on the
origin. The quantum distribution is non-Gaussian: a broad, flat tub with two sharp
spikes near \pm\tfrac{t}{\sqrt2} and surprisingly little probability in the
middle. Here they are drawn on the same axes for a walk of 60 steps.
Where a classical walker is most likely found right where it started, the quantum walker is most
likely found far from the start, at one of the two peaks. Nothing about the quantum curve is
bell-shaped — those edge spikes are the fingerprint of interference.
Worked example 2: one step, then interference
Let us run the Hadamard walk by hand, starting the coin "up" at the origin,
|{\uparrow}\rangle|0\rangle. Step 1. The coin Hadamard
makes an even superposition, and the shift splits the walker to
\pm 1:
|{\uparrow}\rangle|0\rangle \;\xrightarrow{\;C\;}\; \tfrac{1}{\sqrt2}\big(|{\uparrow}\rangle+|{\downarrow}\rangle\big)|0\rangle \;\xrightarrow{\;S\;}\; \tfrac{1}{\sqrt2}\big(|{\uparrow}\rangle|{+1}\rangle + |{\downarrow}\rangle|{-1}\rangle\big).
So far nothing exotic — the two halves are at different sites and cannot yet interfere. The magic
needs branches to meet. Carry the walk two more steps and track the amplitude that
lands back at the origin. Just before the final shift, the origin receives two
contributions carrying a coin in the |{\downarrow}\rangle state — one with
amplitude +\tfrac12, the other -\tfrac12 (the
minus sign is courtesy of H|{\downarrow}\rangle=\tfrac1{\sqrt2}(|{\uparrow}\rangle-|{\downarrow}\rangle)):
\underbrace{+\tfrac12\,|{\downarrow}\rangle|0\rangle}_{\text{one path}} \;+\; \underbrace{\big(-\tfrac12\big)|{\downarrow}\rangle|0\rangle}_{\text{other path}} \;=\; 0.
Destructive interference: the down-coin amplitude at the origin cancels completely.
Meanwhile the up-coin amplitude at +1 reinforces. Finishing the
three steps gives
|\psi_3\rangle = \tfrac{1}{2\sqrt2}\Big(|{\uparrow}\rangle|{3}\rangle + 2\,|{\uparrow}\rangle|{1}\rangle + |{\downarrow}\rangle|{1}\rangle - |{\uparrow}\rangle|{-1}\rangle + |{\downarrow}\rangle|{-3}\rangle\Big),
whose position probabilities are strikingly lopsided — compare them with the classical walk:
\begin{array}{c|c|c|c|c} \text{position} & -3 & -1 & +1 & +3 \\ \hline \text{classical} & \tfrac18 & \tfrac38 & \tfrac38 & \tfrac18 \\ \text{quantum} & \tfrac18 & \tfrac18 & \tfrac58 & \tfrac18 \end{array}
The classical walk is perfectly symmetric; the quantum walk has already thrown
\tfrac58 of its weight to the +1 side. (That
rightward bias comes from starting the coin "up"; a symmetric start
\tfrac1{\sqrt2}(|{\uparrow}\rangle+i|{\downarrow}\rangle) gives the
symmetric two-peak picture above.) Same coin flips, same shift — the only new ingredient is
interference, and it is already reshaping the distribution after three steps.
- a quantum walk is the coherent, unitary analogue of a classical random walk;
it spreads ballistically (\sim t) rather than
diffusively (\sim\sqrt t) — a
quadratic speedup in exploration;
- the discrete-time flavour uses a coin qubit plus a
conditional shift, one step being U = S\,(C\otimes I);
the continuous-time flavour evolves a graph directly by
e^{-iHt} with H its adjacency (or Laplacian)
matrix — both exist and need no coin in the continuous case;
- its distribution is non-Gaussian, with two peaks near
\pm\tfrac{t}{\sqrt2} — the walker races to the edges by
interference;
- walks are a general algorithmic framework: element distinctness
(O(N^{2/3})), spatial search on graphs, and a
walk-based view of Grover's search;
- it is unitary, so it has no stationary distribution, and
measuring collapses the coherence — the speedup lives in the interference
before measurement.
Walks as an algorithm-design framework
Quantum walks are not one algorithm but a toolkit. Two flavours are used in practice:
- Discrete-time (coin + shift), the version we just built, generalised from the
line to any graph.
- Continuous-time, which skips the coin entirely and evolves the walker by
e^{-iHt}, where H is the graph's
adjacency or Laplacian matrix —
amplitude simply flows along the edges over time.
On top of these sit real speedups. Ambainis's element distinctness algorithm decides
whether a list of N items contains a repeat in
O(N^{2/3}) queries — a quantum walk on a graph of subsets, beating the
classical N. Spatial search finds a marked vertex on a
graph faster than brute force, and the walk framework even reproduces
Grover's search
as a walk on the complete graph. The pattern is that a walk gives a flexible, often
polynomial, speedup wherever a problem can be phrased as exploring a structured
space.
A classical walker forgets. Every coin flip is a fresh, independent random choice, so the direction it
just took tells you nothing about the next one — the walk keeps re-randomising, and a sum of
independent nudges huddles around its mean by the central-limit theorem, spreading only as
\sqrt{t}. A quantum walker remembers. Nothing is measured
mid-walk, so the amplitudes never collapse into a definite position; they stay in superposition and
keep interfering with their own history. The Hadamard coin loads the paths with
+ and - signs, and when two branches reconverge
on the same site those signs can cancel. Cancellation hits hardest right in the
middle — the many short back-and-forth loops that would return a classical walker to the origin
interfere destructively — while the long, straight, one-directional paths out to
\pm\tfrac{t}{\sqrt2} have nothing to cancel against and survive. So
probability drains from the centre and gathers at the two edges. The walker is not "faster" in any
clock sense; it simply lets the losing paths erase themselves, and what remains is a coherent sprint
outward.
It is tempting to reason about a quantum walk with classical intuition, and that will burn you in two
specific ways. First, a classical random walk (on a finite, connected, aperiodic graph)
converges to a stationary distribution — wait long enough and the probabilities stop
changing. A quantum walk does no such thing. Its evolution
U^t is unitary: it is reversible, it conserves the whole
state vector's length, and it just keeps rotating forever — the distribution oscillates and recurs but
never freezes into a steady state. Asking "what is its stationary distribution?" is a category error.
Second, all of that beautiful interference is coherent, which means it is fragile.
The moment you
measure
the walker's position, you collapse the superposition and destroy the phase
relationships doing the work — from then on it behaves like a classical sample. So the quantum
advantage lives entirely in the unitary evolution before the single final measurement; measure
too early, or let the environment decohere the walk, and the two peaks smear back into a boring bell
curve.