In 1948 Richard Feynman reformulated quantum mechanics as a sum over histories: the amplitude for a particle to travel from point A to point B is the sum, over every conceivable path, of e^(iS[path]/ħ), where S is the classical action of that path. This demo uses an honest simplification for teaching purposes — instead of computing the true action integral, each path's phase is taken proportional to its arc length, phase ≈ k·L. That keeps the core interference idea intact without requiring a Lagrangian. The real path-integral formalism underlies modern quantum field theory, including the Feynman-diagram calculations used in QED and in lattice QCD simulations of particle physics.
Amplitude = Σ_paths e^(iS[path]/ħ) — the true
Feynman path integral, summed over every possible path weighted
by its classical action S. This simulation uses the simplified
stand-in phase ≈ k·L, where L is a path's arc length
— a pedagogical proxy for S/ħ that preserves the stationary-phase
behaviour without a full Lagrangian calculation.
Feynman developed the path-integral formulation as a graduate student after a chance remark from Paul Dirac about the role of the classical Lagrangian in quantum theory. Path integrals are now a standard computational tool in particle physics — lattice QCD, which predicts the masses of protons and neutrons from first principles, is a direct numerical descendant of Feynman's idea.
Richard Feynman's 1948 path-integral formulation recasts quantum mechanics as a sum over every conceivable trajectory a particle could take from one point to another. Each path contributes an equal-magnitude "arrow" whose direction is set by that path's classical action; adding all the arrows tip-to-tail gives the total quantum amplitude, and the square of the resulting length gives the probability. This simulation makes that idea tangible: dozens or hundreds of randomly wiggled paths are drawn from a fixed source A to a fixed target B, and their contributions are chained together as unit-length phasors.
For simplicity, and because computing a true classical action requires committing to a specific Lagrangian, each path's phase here is taken proportional to its arc length rather than its exact action. This is stated plainly because it is a simplification, not the textbook result — but it preserves exactly the behaviour Feynman's method predicts: paths close to the shortest, most "classical" route have similar phases and reinforce each other, while long, erratic detours scatter in phase and cancel out. The full, rigorous version of this idea is a working tool of modern physics, underpinning Feynman-diagram calculations in quantum electrodynamics and the lattice QCD simulations used to compute the masses of protons and neutrons from first principles.
It is a way of computing quantum probabilities by imagining a particle takes every possible path between two points simultaneously, not just the one path predicted by classical mechanics. Each path contributes a complex number of the same size but a different direction (phase); summing all of them gives the total quantum amplitude for the particle to go from A to B.
The true phase of each path is S[path]/ħ, where S is the classical action — an integral of the Lagrangian along that path, which depends on the specific physical system (free particle, oscillator, and so on). Computing it exactly is beyond a general-purpose demo, so this simulation uses phase ≈ k·L, with L the path's arc length, as an honest pedagogical stand-in that reproduces the same qualitative interference pattern.
The chain is ordered by increasing path length, so the shortest, most nearly-straight (most "classical") paths come first. Because their lengths — and therefore their phases — change slowly from one path to the next, their arrows point in almost the same direction and add up in a nearly straight line. This visualises the stationary-phase principle behind the principle of least action.
Longer, more wiggly paths have arc lengths that vary rapidly from one random path to the next, so their phases are essentially scattered. Chained tip-to-tail, scattered-phase arrows point in many different directions and curl back on themselves, adding almost nothing to the net displacement — this is destructive interference in action.
It is the resultant vector: the sum of every phasor in the chain, drawn from the origin straight to the tip of the last arrow. Its length, |R|, is proportional to the total quantum amplitude for reaching B via this ensemble of paths; squaring it would give a relative probability.
Yes. With more paths sampled, the near-classical region is filled in more finely and the destructive cancellation among non-classical paths becomes more thorough, so the resultant vector tends to settle down to a more consistent value across repeated regenerations at a fixed wiggliness and wavenumber.