Walk on a Line
A quantum walk is the quantum analogue of a classical random walk. Where a classical walker flips a coin to decide left or right, a quantum walker applies a unitary to its coin register and then performs a coherent conditional shift — keeping the superposition intact so that both directions evolve in parallel and their amplitudes interfere.
The classical picture
Start a classical random walker at position . At each step flip a fair coin: heads, move to ; tails, move to . After steps the position probability distribution is a binomial centred at 0 with standard deviation . The walk diffuses slowly.
The quantum walk on a line
The Hilbert space is the tensor product of a coin register and a position register:
A single step consists of two operations applied in sequence.
Coin operator : a unitary on the coin register alone. The standard choice is the Hadamard:
Shift operator : moves the walker left when the coin reads and right when it reads :
One full step is .
Interference leads to ballistic spreading
Because the walker stays in superposition, the amplitudes for different positions can add constructively or destructively. Starting with coin at position , the probability distribution after steps has a characteristic two-peaked shape with tails near . The standard deviation grows as
which is linear in rather than . This quadratic speed-up over classical diffusion is the reason quantum walks appear as subroutines in several quantum algorithms (element distinctness, graph search, NAND-formula evaluation).
Encoding for a small circuit
To build an exact circuit we encode a finite segment of the line. Use a 2-qubit position register (, with as the most significant bit) for positions , and a single coin qubit . Three qubits in total.
Starting at the centre position with coin , one step proceeds:
-
Coin toss: on .
-
Conditional decrement (move left when coin ): invert , apply the controlled-decrement circuit , then invert again. The binary borrow-ripple decrement on triggers only when after the flip, i.e., originally . Note the order: CX before CCX (the LSB is flipped first so that the carry check sees the updated LSB, implementing rather than ).
-
Conditional increment (move right when coin ): apply directly (no flips needed).
After the coin toss the state is . The decrement takes the branch from position to , and the increment takes the branch from to . The final state before measurement is
Measuring all three qubits yields bitstrings 000 and 110 with equal probability
— the walker has spread from the centre to positions 0 and 2.
Try it
Complete the one-step walk circuit. The grader checks the output distribution — you should see equal weight on the two displaced positions.
Sign in on the full site to ask questions and join the discussion.