This simulation recreates the 1922 Stern-Gerlach experiment, the first direct demonstration that spin angular momentum is quantised. A beam of silver atoms is fired through a strongly inhomogeneous magnetic field. Classically the atoms should smear into a continuous band, but the quantum spin-1/2 nature of the silver atom's valence electron splits the beam into exactly two discrete spots.
F = μ·dB/dz deflects each spin state oppositely.
F = μ_z · dB/dz (deflecting force)
S_z = ±ħ/2 (two allowed projections)
P(up | θ) = cos²(θ/2) (sequential projection rule)
When Stern and Gerlach first ran the experiment, the silver deposit was almost invisible — it became visible only because Stern's cheap cigars were rich in sulphur, and the sulphur fumes turned the silver into black silver sulphide, revealing the now-famous two-lobed pattern.
The Stern-Gerlach experiment is one of the foundational demonstrations of quantum mechanics. By passing silver atoms through an inhomogeneous magnetic field, it revealed that an intrinsic angular momentum — spin — can only take discrete values, splitting a single beam into two sharp spots rather than the continuous smear classical physics expects.
What was the Stern-Gerlach experiment?
In 1922 Otto Stern and Walther Gerlach sent a beam of silver atoms through
a strongly inhomogeneous magnetic field. Instead of smearing into a
continuous band as classical physics predicted, the beam split into two
sharp spots, giving the first direct evidence that intrinsic angular
momentum (spin) is quantised.
Why does the beam split into exactly two spots?
A silver atom has a single unpaired electron whose spin is a spin-1/2
system. The projection of that spin along the field axis can only take two
values, +ħ/2 and −ħ/2. Each value feels an opposite deflecting force, so
the beam separates into exactly two discrete spots: spin up and spin
down.
What would classical physics predict instead?
Classically the atomic magnetic moments would be randomly oriented in all
directions, so their projection along the field would take a continuous
range of values. The force would then spread the atoms into a single
continuous smear. The simulation shows this classical expectation as a
faint Gaussian band for comparison.
A magnetic moment μ in a field gradient feels a force F = μ_z · dB/dz along the gradient direction. The field must be inhomogeneous: a uniform field only produces a torque, not a net translating force. The stronger the gradient, the larger the separation between the two spots.
Spin is an intrinsic form of angular momentum carried by particles, unrelated to any literal spinning motion. For an electron it is a spin-1/2 quantity whose measured projection along any chosen axis is always either +1/2 or −1/2 in units of ħ — never anything in between.
If you take the spin-up output of a first analyser and feed it into a second analyser tilted by an angle θ, the atoms split again. The fraction that comes out spin up of the second analyser is cos²(θ/2), and the fraction spin down is sin²(θ/2). At 90° the beam splits 50/50.
Spin components along different axes are incompatible observables: measuring spin along a tilted axis collapses the state onto an eigenstate of that axis, erasing the previous definite value. This is why a third analyser back along the original axis can again produce both outcomes.
The probability that a spin prepared along one axis is found "up" along a second axis rotated by θ is given by the Born rule as cos²(θ/2). At θ = 0 the probability is 1, at θ = 180° it is 0, and at θ = 90° it is exactly 1/2.
Silver was ideal because a silver atom has a closed inner shell plus a single 5s valence electron with zero orbital angular momentum, so its magnetic moment comes purely from one electron's spin. This gave a clean two-way split uncomplicated by orbital contributions.
Atoms are launched as a beam and each is assigned a quantum spin projection. As they cross the magnet region they accelerate by F = μ·dB/dz proportional to their projection, then drift to a screen where their landing positions accumulate into a histogram. You can adjust the gradient, beam spread and analyser angle, and toggle the classical-versus-quantum comparison.