A quantum walker lives on a 1-D lattice and carries an internal two-state "coin" (spin up / spin down). At each step the Hadamard gate is applied to the coin, then the walker moves right if spin-up or left if spin-down. Quantum interference between superposed paths causes the probability distribution to spread ballistically — σ ∝ t — rather than diffusively as in the classical case where σ ∝ √t.
H = (1/√2) [[1, 1], — Hadamard coin
[1,−1]]
After coin: α'_n = (α_n + β_n)/√2
β'_n = (α_n − β_n)/√2
Shift: α_n(t+1) = α'_{n-1}(t) |↑⟩ goes right
β_n(t+1) = β'_{n+1}(t) |↓⟩ goes left
σ_quantum ~ t/√2 (ballistic)
σ_classical ~ √t (diffusive)
Quantum walks are thought to explain the remarkable efficiency of energy transfer in photosynthetic complexes (FMO complex). They also form the basis of Grover's search algorithm, providing a quadratic speedup over classical search. Physical implementations exist on photonic chips, trapped ions, and superconducting circuits.
A quantum walk is the quantum mechanical analogue of a classical random walk. Instead of taking definite left or right steps, the walker exists in a superposition of positions. At each step, a 'coin' operator (here the Hadamard gate) is applied to the internal spin state, then a conditional shift moves the walker left or right, creating interference between all paths simultaneously.
The Hadamard operator H = [[1,1],[1,−1]]/√2 acts as the quantum coin. Applied to |↑⟩ it produces (|↑⟩+|↓⟩)/√2, and to |↓⟩ it produces (|↑⟩−|↓⟩)/√2. This balanced superposition with a crucial sign difference drives the asymmetric interference pattern characteristic of the Hadamard walk.
In a classical random walk σ ∝ √t (diffusive). In the quantum walk, constructive and destructive interference between superposed paths causes the distribution to peak near the edges rather than the centre, giving ballistic transport σ ∝ t. After t steps, the quantum walker has explored O(t) positions — quadratically faster than the classical O(√t).
Unlike the Gaussian bell-curve of classical diffusion, the Hadamard walk produces a bimodal distribution with two prominent peaks moving ballistically apart and a central region of destructive interference. Starting in |↑⟩ creates an asymmetric distribution, while (|↑⟩+i|↓⟩)/√2 produces a symmetric bimodal pattern.
The full state is |ψ⟩ = Σn (αn|↑⟩ + βn|↓⟩)|n⟩, where αn and βn are complex probability amplitudes at lattice site n. The probability of finding the walker at position n is |αn|² + |βn|². This simulation tracks these complex amplitudes exactly.
The shift operator S moves the walker conditionally on its coin state: |↑,n⟩ → |↑,n+1⟩ and |↓,n⟩ → |↓,n−1⟩. One full step of the quantum walk is: (1) apply Hadamard H to the coin, then (2) apply S to shift position. Repeating these two operations drives the quantum walk.
Quantum walks underpin Grover search speedup, element distinctness algorithms, and universal quantum computation models. They also model quantum transport in photosynthesis, topological insulators, and are implemented on photonic chips and ion traps.
The initial coin state dramatically changes the distribution. Starting in |↑⟩ causes leftward drift. Starting in |↓⟩ causes rightward drift. The symmetric state (|↑⟩+i|↓⟩)/√2 produces a perfectly symmetric bimodal distribution. This sensitivity to initial conditions has no classical analogue.
Discrete-time quantum walks (implemented here) apply a coin operator and shift at discrete integer time steps, requiring an internal degree of freedom (the coin). Continuous-time quantum walks evolve under a Hamiltonian directly on position space without a coin. Both models are universal for quantum computation.
Yes. If the coin state is measured (collapsed) at every step, quantum interference is destroyed and the walk reverts to classical diffusive behaviour with σ ∝ √t. Partial decoherence smoothly interpolates between quantum ballistic and classical diffusive transport — visible in this simulation via the Decoherence slider.
Yes. Quantum walks have been demonstrated with single photons in waveguide arrays, trapped ions manipulated by laser pulses, neutral atoms in optical lattices, and superconducting qubits. These experiments confirm the quadratic speedup and the characteristic bimodal distribution predicted by theory.
This simulation runs a discrete-time quantum walk on a 401-site 1-D lattice, tracking the exact complex amplitudes αn and βn for a coin state at every site. Each step applies the Hadamard coin H = [[1,1],[1,−1]]/√2 to the internal spin-up/spin-down state, then a conditional shift moves the spin-up amplitude one site right and the spin-down amplitude one site left. The top panel plots the resulting probability |ψ|² = |αn|² + |βn|², while the bottom panel plots the classical Gaussian G(n,t) = exp(−n²/2t)/√(2πt) for direct comparison — letting you watch quantum ballistic spreading (σ ∝ t) outrun classical diffusion (σ ∝ √t) in real time.
Two synchronised histograms: the quantum walker's |ψ|² on top and a classical random walker's Gaussian distribution below. As steps accumulate, the quantum distribution splits into two ballistic peaks racing toward the lattice edges, while the classical curve stays a single bell shape widening only as √t. Dashed σ markers on each panel let you compare spread directly, and the on-canvas ratio σ_Q/σ_C approaches √2 for large t.
Steps per frame controls simulation speed. Initial coin state switches between |↑⟩ (drifts left), |↓⟩ (drifts right), and the symmetric superposition (|↑⟩+i|↓⟩)/√2 (perfectly symmetric bimodal peaks) — changing it resets the walk. The Decoherence γ slider randomly collapses the coin at each site with probability γ per step; push it toward 1 and interference disappears, and the quantum histogram gradually relaxes into the same √t-spreading shape as the classical one. Pause/Reset control the animation, and the Info button opens the full equations and FAQ.
The quantum walk's O(t) ballistic spread versus the classical walk's O(√t) diffusive spread is the same quadratic speedup that underlies Grover's search algorithm. Quantum walks are also the leading model used to explain the surprisingly efficient energy transport observed in photosynthetic light-harvesting complexes such as FMO, and they have been physically realised with single photons in waveguide arrays, trapped ions, and superconducting qubits.
At every site the two-component coin amplitude (α, β) is multiplied by the matrix H = [[1,1],[1,−1]]/√2, giving new amplitudes α' = (α+β)/√2 and β' = (α−β)/√2. This is the exact operation the simulation performs on the Float64Array amplitude buffers every single step, before the shift operator moves α' one site right and β' one site left.
Because the walker's amplitudes at each site interfere constructively and destructively as they combine from neighbouring paths, the probability mass gets pushed toward the two ballistic fronts near n ≈ ±t/√2 instead of piling up near the centre. This gives a standard deviation σ that grows linearly in t, whereas the classical Gaussian comparison in the lower panel has σ = √t, a quadratically slower spread.
Setting the coin to |↑⟩ places all amplitude in α at the centre site, producing a walk that drifts left over time; |↓⟩ does the mirror opposite and drifts right; the symmetric option (|↑⟩+i|↓⟩)/√2 splits amplitude evenly between α and β with a 90° phase difference, which produces the textbook symmetric bimodal Hadamard-walk distribution. The lattice, coin operator and shift rule are identical in all three cases — only the starting amplitudes differ.
At each step, with probability γ (the Decoherence value) the simulation measures the coin state at a given site: it computes the probability of spin-up versus spin-down from the current amplitudes, randomly collapses to one outcome weighted by that probability, and zeroes out the other component. At γ = 0 the walk is fully coherent and ballistic; at γ = 1 every step is measured and the walk behaves exactly like a classical random walk, with σ converging toward √t.
The simulation allocates fixed-size arrays for 401 sites (indices −200 to +200 relative to the centre) so the amplitude buffers can be simple typed arrays rather than a dynamically growing structure. The step counter is capped so the walk stops advancing just before the ballistic front would reach the array boundary, avoiding artificial reflection or wraparound at the edges.