🧵 Feynman Path Integral — Sum Over Histories
Explore Feynman's sum-over-histories: generate random A→B paths, add their phasors head-to-tail, and watch near-classical paths interfere constructively.
About the Feynman Path Integral
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.
Frequently Asked Questions
What is the Feynman path integral, in plain terms?
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.
Why does phase depend on arc length instead of the real action here?
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.
Why do the arrows form a straighter run near the start of the chain?
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.
Why do later arrows curl into loops?
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.
What does the final highlighted arrow represent?
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.
Does adding more paths (raising N) change the picture?
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.
Explore Feynman's sum-over-histories: generate random A→B paths, add their phasors head-to-tail, and watch near-classical paths interfere constructively.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install