Double-Slit LabBeta
Real-time double-slit interference from the wave equation
This tool is a beta version still being stabilized. Please let us know if a result looks off.
- Predicted fringe spacing λL/d (small angle)
- –
- First bright fringe y₁ = L·tan(asin(λ/d))
- –
- Measuring
- –
A plane wave enters from the left. Past the wall, every slit acts as a new source (Huygens' principle). Where the path difference between the two waves is a whole number of wavelengths they reinforce into bright fringes; half a wavelength off, they cancel into dark ones. The graph on the right accumulates the intensity reaching the screen (time-averaged amplitude squared), and the dashed line is the theory I ∝ cos²(πd·sinθ/λ)·sinc²(πa·sinθ/λ). A longer wavelength, narrower slit spacing or a more distant screen (L) spreads the fringes apart. Switch on the which-path detector and you learn which slit each photon took, so the two waves add as intensities (|ψ₁|² + |ψ₂|²) instead of amplitudes and the fringes disappear. Press on the canvas to drop a ripple. All lengths are in grid cells.
Real experiment setup
In a real experiment light arrives one photon at a time, each landing at a single point on the screen. Each hit is random, but its probability follows the intensity computed by the simulation above, so the interference fringes emerge as hits pile up. The laser colour maps λ onto visible light (400–700 nm).
Working…
0.0
It hasn't frozen — the result will appear when the calculation finishes.
About Double-Slit Lab
This simulation solves the two-dimensional scalar wave equation directly on a grid (a finite-difference time-domain scheme). A plane wave enters from the left, passes the wall with its slits, and when it reaches the screen column on the right the simulation time-averages the squared amplitude there and adds it to the graph. The dashed line is the Fraunhofer (far-field) theory curve. All lengths are in grid cells. The grid is 420 cells wide; the slit-to-screen distance L defaults to 249 cells and the Slit–screen distance L slider moves it anywhere from 40 to 249.
By default it is a wave model. Switch on the which-path detector and the tool computes two separate waves, each with only one slit open, and adds their intensities at the screen (|ψ₁|² + |ψ₂|²). Adding intensities instead of amplitudes drops the interference term, so the fringes vanish and only the single-slit envelope remains. This builds in the result that which-path information destroys coherence between the two paths; it does not model the measurement itself. The dots in the Real experiment setup panel are drawn at random with a probability proportional to the computed intensity, to show what one-photon-at-a-time detection looks like. They are not trajectories of individual particles.
The fringe spacing formula, checked against this screen
With slit separation d, the path difference between the two waves at angle θ is d·sinθ. Bright fringes sit where that equals a whole number of wavelengths: d·sinθ = nλ. For small angles sinθ ≈ tanθ = y/L, so neighbouring bright fringes are Δy ≈ λL/d apart. That is the number shown as Predicted fringe spacing in the side panel.
At the defaults (λ = 14, d = 50, L = 249) the panel shows 14 × 249 / 50 = 69.7 cells. Read the first bright peak off the graph and it sits a little further out. The exact condition sinθ = 14/50 = 0.28 gives θ ≈ 16.3°, and y = L·tanθ = 249 × 0.28 / 0.960 ≈ 72.6 cells. The panel's First bright fringe y₁ = L·tan(asin(λ/d)) row shows this exact value. The 4% gap is the small-angle approximation failing, not a bug. Double d to 100 and sinθ drops to 0.14; the formula gives 34.9 and the exact position is 35.2, practically the same.
Experiment 1: change the wavelength and the spacing
Doubling λ from 14 to 28 should double the spacing. But sinθ = 28/50 = 0.56 pushes the first bright fringe out to about y = 168 cells, which on a short browser window is off the edge of the screen. The graph then shows a single broad central peak. If λ is larger than d (try λ = 40, d = 30), sinθ would have to exceed 1, so a first-order fringe cannot exist at all.
The laser colour follows along. The grid wavelengths 6–40 are mapped onto visible light from 400 to 700 nm, so a longer λ slides from green toward red. The same is true on a real bench: red light spreads its fringes wider than blue light through the same slits.
Experiment 2: a fringe that goes missing
The pattern on the screen is the two-slit interference term (cos²) multiplied by the diffraction envelope of one slit (sinc²). A wider slit a makes the envelope narrower, and wherever a zero of the envelope lands on an interference maximum, that fringe disappears.
Set λ = 6, d = 60, a = 30, so d/a = 2. Bright fringes should appear near y = 25, 51, 78 and 109 cells, but the ones at 51 (second order) and 109 (fourth order) coincide with envelope zeros and nearly vanish. With the theory curve on, the dashed line drops to zero right there. One caveat: at λ = 6 a wavelength spans only six cells, so numerical dispersion on the grid is noticeable and peak heights can drift from the theory.
Experiment 3: close one slit
Switch to a single slit with a = 30 and λ = 8. The first dark point is at a·sinθ = λ, so sinθ = 0.267 and y ≈ 249 × 0.267 / 0.964 ≈ 69 cells. Halve a to 15 and that dark point moves roughly twice as far out. Narrower openings spread the wave more; that is diffraction in one sentence.
Now switch back to two slits. Fine fringes appear inside the broad peak you just saw. This is the point that makes the experiment famous: the two-slit pattern is not the sum of two one-slit patterns. Adding the results of each slit open on its own gives a smooth hump with no stripes.
Experiment 4: one detection at a time
Under Real experiment setup, turn the photon detection rate down to 1 or 2 and press Clear screen. The first dots look scattered at random. After a few hundred, stripes start to show; after a few thousand, the density of dots matches the intensity graph. This is what the 1989 Hitachi electron film showed with real electrons. Changing any slit setting resets the count.
Scaling up to a real lab bench
A helium-neon laser (λ = 633 nm) through slits 0.25 mm apart onto a wall 1 m away gives Δy = 633×10⁻⁹ × 1 / 0.25×10⁻³ ≈ 2.5 mm. That is hard to count by eye, which is why classroom setups often put the screen 2–3 m away. The formula needs L to be much larger than d; here L/d = 4,000. In the simulation L/d is only about 5, which is why the approximation error is visible on screen.
Worked examples
Defaults: formula versus exact position
- Input
λ = 14, d = 50, a = 6, L = 249 cells- Output
Predicted spacing 69.7 cells; actual first bright fringe ≈ 72.6 cells
sinθ = 0.28 is a fairly large angle, so the difference between tanθ and sinθ (about 4%) shows up directly.
Double the slit spacing
- Input
λ = 14, d = 100- Output
Predicted 34.9 cells; exact 35.2 cells
At smaller angles the small-angle approximation is almost exact.
Green laser in a classroom
- Input
λ = 532 nm, d = 0.1 mm, L = 2 m- Output
Δy ≈ 10.6 mm
532×10⁻⁹ × 2 / 1×10⁻⁴ = 1.064×10⁻² m. Measure across several fringes with a tape and divide by the count to reduce error.
How to use it
- Leave the default double slit running until the wavefront reaches the screen, then switch the view to Intensity.
- Turn on the theory curve and move λ, d and a one at a time; each change clears the screen and it builds up again.
- Compare the predicted fringe spacing in the side panel with the peak positions on the graph.
Frequently asked questions
Why doesn't the predicted spacing match the graph exactly?
Δy = λL/d is a small-angle approximation. Here L is only 249 cells by default, so outer fringes land further out than the formula says. Increase d or decrease λ and the gap shrinks. The panel's First bright fringe row uses the exact y = L·tan(asin(λ/d)) and matches the graph.
Does changing the slit width a change the fringe spacing?
No. The width sets the envelope around the whole pattern. A wider slit narrows the envelope, dims the outer fringes and reduces how many you can see, but the spacing between them stays λL/d.
If I observe which slit is used, does the pattern disappear here?
Yes, with the which-path detector switched on. The two slit waves are then added as intensities (|ψ₁|² + |ψ₂|²) rather than amplitudes, the interference term disappears, and the photon dots, sampled from that intensity, pile up in a single band with no stripes. The tool builds in this outcome rather than modelling the measurement itself. The related guide article covers why which-path information destroys the fringes.
Why do two slits give many stripes instead of two?
The difference in distance from each point on the screen to the two slits changes continuously with position, and every place where it equals a whole number of wavelengths is bright. Opening each slit separately and adding the results gives no stripes at all.
Related guides
Sources
- Thomas Young, Experiments and calculations relative to physical optics, Phil. Trans. R. Soc. 94 (1804)
- HyperPhysics — Double slit interference
- Tonomura et al., Demonstration of single-electron buildup of an interference pattern, Am. J. Phys. 57, 117 (1989)
Last reviewed: