About this simulation

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.

🔬 What it shows

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.

🎮 How to use

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.

💡 Did you know?

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.

Frequently asked questions

What exactly does the Hadamard coin do at each lattice site?

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.

Why does the quantum distribution spread faster than the classical one?

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.

What do the three initial coin state options actually change?

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.

How does the Decoherence slider bridge quantum and classical behaviour?

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.

Why is the lattice fixed at 401 sites and what happens at the edges?

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.