DiracDirac

Part I · The Quantum Break · Chapter 2

Stern–Gerlach and the Qubit

A beam of silver atoms flies through a lopsided magnet, and the smallest possible question — “which way is your magnet pointing?” — gets an answer no one asked for: up or down, nothing in between.

Sources: Sakurai §1.1 · Feynman III, Chs. 5–6 · Susskind, Lectures 1–2 · Cohen-Tannoudji I, Ch. IV

What this chapter covers

  • 2.1Little magnets. the 1922 experiment: classical physics predicts a smear, silver atoms give two spots — quantization, straight off the detector plate.
  • 2.2Filters in series. chains of Stern–Gerlach analyzers, live: repetition is boring, sideways is a coin flip, and questions erase earlier answers.
  • 2.3Inventing the state. two complex numbers per atom — the qubit — and the half-angle guess put on trial against every filter fact, including the cascade paradox.
  • 2.4The Bloch sphere. every qubit state is a point on a sphere; fly (θ, φ) yourself and watch phase matter in one basis and vanish in another.
  • 2.5The law, tested. cos²(θ/2) versus the classical cos²θ at 24 distinct analyzer angles — synthetic data with error bars picks the winner, and the lab prints the σ at which the loser dies.
  • 2.6The lab. the whole chapter from one four-line Rust rule — two spots, the angle sweep, and collapse as an overwritten variable.

Frankfurt, 1922. Otto Stern and Walther Gerlach boil silver in an oven, let a thin beam of atoms escape through a slit, and fly it between the poles of a magnet shaped so the field is much stronger near one pole than the other — they were hunting for a prediction of the old Bohr–Sommerfeld atom, and had no idea they were about to stumble onto spin. Why the lopsided magnet? Because a silver atom is a tiny magnet, and in a lopsided field a magnet feels a net push: the force depends on how the magnet is tilted. Tilted with the field — pushed up. Against — pushed down. Sideways — no push at all.

Figure 2.1 is the whole machine. A hot oven boils off silver atoms; a collimating slit trims them to a thin, well-aimed beam; that beam flies through the inhomogeneous magnet, whose poles are cut into a sharp knife-edge on top and a flat face below so that the field grows steeply from bottom to top — a vertical gradient . It is that gradient, not the field itself, that pushes the little atomic magnets. Whatever comes through lands on a detection screen at the far end, and where the atoms pile up is the entire experiment.

hot oven(silver, Ag)collimating slitzNSBdB/dzclassical:a smearscreenspin up|+z⟩spin down|−z⟩cross-section (looking along the beam)NSdB/dz
Figure 2.1. The Stern–Gerlach apparatus. Silver atoms leave a hot oven, are collimated into a thin beam, and pass through a magnet with a knife-edge north pole and a flat south pole. The shaped poles (see cross-section, inset) make a vertical field gradient ; classical physics predicts a continuous smear on the screen, but the beam splits into two discrete spots — spin up and spin down .

Now, the atoms tumble out of an oven. Nobody has combed them. Their little magnets should point every which way, so the deflections should take every value between the two extremes: the beam should fan out into a continuous smear. Every physicist in 1922 would have signed their name under that prediction. It is not a subtle argument. It is just “random directions give random tilts.”

And you can say more than “a smear” — you can say what shape. Point a moment in a uniformly random direction and its vertical component comes out uniform on . (That is a two-thousand-year-old fact of geometry: Archimedes' hat-box theorem, that equal slices of a sphere's height carry equal area.) So the classical plate is not a bump in the middle at all — it is a flat plateau, every deflection from to equally likely, with the beam's own blur softening the two edges. Here is what the plate shows instead:

Loading /data/ch02/stern_gerlach.json… (run cargo run --release in Rust-QP/ch02-stern-gerlach)

Two spots. Not a narrower plateau, not a plateau with dents — the atoms refuse the entire plateau and pile up at its two ends. Half the classical prediction sits within half a spot-separation of the centre; the lab certifies that under 0.3% of the real atoms land there. Ask an atom “how much of your magnetism points along z?” and there are only two possible answers, ever: all of it, or minus all of it. And do not think the magnet merely sorts atoms that were already up or down: the same beam through a magnet tilted at any angle gives two spots along that angle. Whatever direction you ask about, the answer comes back from a two-letter alphabet. Physics has never recovered from this experiment, and by the end of the chapter you will be glad it hasn't.

One measurement is a curiosity. The real physics shows up when you ask an atom two questions in a row. Block one exit of a Stern–Gerlach magnet and it becomes a filter: whatever comes out the open port has answered “+” to the question “spin along my axis?”. Here is a wonderful fact: a chain of these filters, and nothing else, is enough to teach you the entire machinery of quantum mechanics — states, amplitudes, interference, collapse, all of it. So we built you one. Play first, read after:

SG A0°
SG B90°
SG C0°
atoms fired
0
final “+” fraction (measured)
theory: Π cos²(Δθ/2)
0.250
survivors after A, B
0 · 0

Try the killer sequence: set A and C to z and remove B — every survivor of A passes C, fraction 1.000. Now insert B at x: suddenly half the atoms come out of C's minus port. Filtering along x did not “add some x-ness” — it erased the atom's z-ness. An atom has no memory beyond its state.

Three facts fall out of playing with the chain, and they are worth stating like laws:

  • Repetition is boring. Ask the same question twice (A and C along z, no B): every atom that said “+” says “+” again. Fraction 1.000. The measurement is repeatable, so “the atom is spin-up along z” is a real, stable condition of the atom — we are allowed to call it a state.
  • Sideways is a coin flip. A z-up atom asked the x-question answers + or − with probability 1/2 each, individually unpredictable. Not “unknown” — unpredictable. The z-up state simply does not contain an x-answer.
  • Questions erase answers. The killer sequence: z-filter, then x-filter, then z-analyzer. Half the atoms now fail the final z test they already passed. Measuring x did not add information — it destroyed the z-information. An atom carries no hidden notebook of past results. Its state is its entire memory, and the state holds one direction's worth of certainty. No more.

Pause on how strange the third fact is. A classical filter only ever narrows a beam — sunglasses stacked on sunglasses never brighten anything. Here, inserting an extra filter opens a channel that was completely dark. We have seen that trick before: opening a second slit made dark places on the screen. Interference is hiding in this apparatus, and in a moment we will find it in the algebra.

Now let us do what physicists actually do when nobody is watching: guess. First we guess; then we compute the consequences of the guess; then we compare with experiment. If it disagrees with experiment, it is wrong — it does not matter how beautiful the guess was or who made it. Chapter 1 handed us the raw material for guessing: every process gets a complex amplitude, and probabilities are squared magnitudes. The two-spots experiment says an atom facing a z-analyzer has exactly two possible outcomes. So the minimal guess is lovely in its stinginess: the atom's whole condition is two complex numbers — the amplitude to answer “+” and the amplitude to answer “−”:

(2.1)

This object — two complex numbers with unit total square — is a qubit, and it is the hydrogen atom of quantum mechanics: the smallest system with everything in it. The kets are the two states the z-filter certifies; “repetition is boring” is the statement that they are reliable reference states, and “a + atom never exits −” is the statement that they are orthogonal: . That bracket is the inner product of two states — the amplitude to find a system prepared in when you test it for , a single complex number measuring how much the two states overlap (zero means no overlap, one means identical); Chapter 3 makes it a proper geometry. Notice — orthogonal states need not point oppositely in space. Up and down differ by 180° in the lab, yet they are perpendicular in the state space. Space and state space are different rooms.

What is the state certified by an analyzer tilted at angle from z? Here is the guess that turns out to run the universe:

(2.2)

Why the half-angle? Do not take it on authority — put the guess on trial. It must reproduce every fact the filters showed us:

  • : gives itself. ✓
  • : gives — an analyzer pointing down certifies exactly what the z-analyzer's minus port certifies. Only the half-angle does this; a full-angle guess would give −1 times , i.e. up again.
  • : gives amplitudes — the x-filter coin flip, . ✓
  • And in general, the probability that a atom passes a -analyzer is
(2.3)

Equation (2.3) is the entire physics of one qubit and one analyzer, and section 2.5 puts it against synthetic data at 24 distinct angles. But first, collect the prize. Chain two analyzers and multiply-then-square along each leg (Chapter 1, Rule 1): the z → x → z cascade gives

(2.4)

The dark channel opened — the algebra contains the filter paradox. And notice the ghost of the double slit: without the middle filter the amplitudes through the two intermediate x-possibilities add before squaring, , and the atom sails through. With the filter in place we square each leg separately and get 1/4. Same Rule 2 and Rule 3 as the slits — path amplitudes interfere until something records which path.

One more treasure is buried in (2.2). Set : the state comes back as — a full turn flips the sign! The minus sign cancels in every probability , so no single atom betrays it… but interference experiments (neutrons, 1975) have seen exactly this sign. A spin-1/2 particle must be turned twice to come home. Hold that thought until the angular-momentum chapter — it is the strangest true thing you will learn this month.

2.4The Bloch sphere: the qubit's home

C · ConceptsF · Formalism

Two complex numbers are four real ones; normalization removes one, and an overall phase of the whole state changes no probability, removing another. What survives is exactly two real parameters — and they have a lovely geography. Write the general state as

(2.5)

and read as latitude and longitude: every qubit state is one point on a sphere. North pole = spin up, south = down, the equator holds all the 50/50 states (with the phase choosing which sideways direction), and the antipode of any state is its orthogonal partner. Fly the state around yourself:

the Bloch sphere — every qubit state is a direction+z+x+yanalyzer +|ψ⟩
|ψ⟩ = 0.866 |+z⟩ + e35° · 0.500 |−z⟩
P(+) along analyzer0.750
P(−) along analyzer0.250

Two real numbers (θ, φ) specify a qubit — that is the whole state space. Notice what the phase φ does: it swings |ψ⟩ around the z-axis, which changes nothing about a z-measurement but everything about an x-measurement (set the analyzer to 90° and sweep φ). Phase is invisible in one basis and decisive in another — remember the two slits.

The sphere also makes (2.3) obvious: for a state at angle from the analyzer axis, — the closer the state points to the axis, the surer the answer, sliding smoothly from certainty (poles) through coin flip (equator). Deterministic where the geometry is aligned, random where it is not, and the amount of randomness is itself exactly determined. That is quantum mechanics in one sentence.

2.5The law, tested atom by atom

C · ConceptsP · Practice

A guess with pretty checkmarks is not yet physics — we want it to survive contact with (synthetic) data at every angle, not just the three easy ones. And we should give the old world a fair fight: a classical physicist who saw two spots might say “fine, some gate passes the projection — surely the fraction goes as , like Malus's law for polarized light.” (Malus's law is the classical rule, from 1809, that light passing two polarizers tilted at angle comes through with intensity — the full angle, note, not the half.) The Rust lab fires a couple of thousand atoms at each of 24 distinct analyzer angles — to in steps, with repeating — and every count, error bar and curve below is read live from the JSON it writes:

Loading /data/ch02/stern_gerlach.json…

The white points ride the red curve and ignore the yellow one. That is worth doing properly rather than by eye, because “ignore” is a quantitative claim: give each hypothesis the same counts and the same binomial error bars, add up the , and see which one survives. The lab does exactly that and reports both verdicts in §2.6 — the half-angle law lands within a fraction of a σ of its own error bars, and Malus's law is excluded at well over the 5σ its referee demands. And at it does not even get a : predicts a certainty at those three — every atom passes, or none does — and the atoms simply do the other thing.

So the half-angle law is not a convention — it is a measured fact about matter, and it is the experimental signature that a qubit is not a classical arrow. A classical arrow turned 180° disagrees with itself completely; a qubit turned 180° is merely orthogonal, and a qubit must turn 360° before its amplitudes disagree in sign, 720° to agree again. The data on this chart is the first rung of that ladder.

The lab Rust-QP/ch02-stern-gerlach runs all three experiments of this chapter — two spots, the angle sweep, the cascade — from one four-line physics engine. Look how little quantum mechanics it takes:

Rust-QP/ch02-stern-gerlach/src/main.rs — the sampler's entire physics
1// ---------------------------------------------------------------------------
2// Spin-1/2 amplitudes (all analyzers in the x-z plane, so phases are real)
3// ---------------------------------------------------------------------------
4
5/// Probability that a spin prepared "+" along direction `a` (angle from z,
6/// in the x-z plane) passes the "+" port of an analyzer along direction `b`.
7///
8/// |<+b|+a>|^2 = cos^2((b - a) / 2)
9///
10/// This single formula IS the qubit. Everything else here is bookkeeping.
11fn p_plus(prep_angle: f64, analyzer_angle: f64) -> f64 {
12 let half = (analyzer_angle - prep_angle) / 2.0;
13 half.cos().powi(2)
14}
15
16/// One atom through a "+"-port analyzer: true = exits "+", false = exits "-".
17///
18// …
19/// only the long-run FREQUENCY is fixed by the amplitude, which is the whole
20/// lesson of quantum measurement.
21fn measure(prep_angle: f64, analyzer_angle: f64, rng: &mut StdRng) -> bool {
22 rng.gen_range(0.0..1.0) < p_plus(prep_angle, analyzer_angle)
23}

The cascade is then honest bookkeeping — and the comment in the middle is the deepest line in the file. After an atom passes a filter, its preparation variable is overwritten. Not updated, not appended to: overwritten. That is collapse, in code:

Rust-QP/ch02-stern-gerlach/src/main.rs — the z → x → z cascade
1for _ in 0..n_source {
2 // unpolarized source: pick a random preparation on the circle
3 let prep = rng.gen_range(0.0..2.0 * PI);
4 if !measure(prep, z, rng) {
5 continue; // absorbed at SGz "-" port
6 }
7 after_z += 1;
8 // KEY PHYSICS: having passed SGz+, the atom now IS |+z>. Its history
9 // is gone — the state carries everything there is to know.
10 if !measure(z, x, rng) {
11 continue; // absorbed at SGx "-" port
12 }
13 after_x += 1;
14 // and having passed SGx+, it now IS |+x> — z is fully undecided again
15 if measure(x, z, rng) {
16 final_plus += 1;
17 } else {
18 final_minus += 1;
19 }
20 }

Now stop and notice a trap, because it is the trap this lab was rebuilt to escape. That sampler draws each outcome by comparing a uniform random number against p_plus. If we then check the measured frequencies against p_plus, we have checked a function against itself: the test would pass just as happily with in there, or , or anything at all. A referee that cannot fail is not a referee. It is a decoration.

So the theory side of every comparison comes from somewhere else entirely. Chapter 3 will build this machinery properly; here we use just enough of it to get an independent second opinion. Take the operator that asks “spin along ?” — the matrix assembled from and , the full angles — find its eigenvector by brute numerical iteration, and read the prediction off as the overlap . No half angle appears anywhere along that path:

Rust-QP/ch02-stern-gerlach/src/main.rs — the independent path
1/// sigma·n for n = (sin t cos p, sin t sin p, cos t) — the operator that asks
2/// "spin along n?". Built from the FULL angle: no half angle in sight.
3fn sigma_n(theta: f64, phi: f64) -> Mat {
4 SX.scale(C::new(theta.sin() * phi.cos(), 0.0))
5 .add(&SY.scale(C::new(theta.sin() * phi.sin(), 0.0)))
6 .add(&SZ.scale(C::new(theta.cos(), 0.0)))
7}
8
9/// The "+1" eigenket of sigma·n, found NUMERICALLY by power iteration.
10///
11/// sigma·n has eigenvalues +1 and -1, so sigma·n + 2I has eigenvalues 3 and
12/// 1: repeatedly applying it and renormalizing suppresses the "-" component
13/// by 3 per step and converges on |+n> like 3^-k. Sixty steps is 3^-60 ~
14/// 1e-29 — far below double precision — and referee 2 checks the result by
15/// its defining equation rather than trusting the iteration count.
16///
17// …
18fn eigenket_plus(theta: f64, phi: f64) -> Ket {
19 let shifted = sigma_n(theta, phi).add(&I2.scale(C::new(2.0, 0.0)));
20 let mut v = Ket([C::new(0.8, 0.0), C::new(0.0, 0.6)]).normalized();
21 for _ in 0..60 {
22 v = shifted.apply(&v).normalized();
23 }
24 v
25}
26
27/// The analyzer probability |<+n|+z>|^2, read off the numerically computed
28/// eigenvector. This is the second opinion: operator, diagonalization,
29/// overlap — and not one half angle along the way.
30fn p_plus_from_eigenket(theta: f64, phi: f64) -> f64 {
31 let v = eigenket_plus(theta, phi);
32 // <+n|+z> = conj(v_0)*1 + conj(v_1)*0 = conj(v_0)
33 v.0[0].norm_sqr()
34}

Two routes to one number, sharing no line of code. They agree to the last couple of bits of a double — and that agreement is what makes every comparison with data below mean something. Then the real question, the one the chapter has been promising since §2.5: does the data choose? Give both laws the same counts and the same error bars and add up the :

Rust-QP/ch02-stern-gerlach/src/main.rs — putting both laws on trial
1let contested: Vec<&AngleSweepPoint> = angle_sweep_data
2 .iter()
3 .filter(|p| {
4 admits_scatter(p.quantum_eigen, n_fired) && admits_scatter(p.classical, n_fired)
5 })
6 .collect();
7 let nu = contested.len() as f64;
8 let chi2_of = |hyp: &dyn Fn(&AngleSweepPoint) -> f64| -> f64 {
9 contested
10 .iter()
11 .map(|p| {
12 let q = hyp(p);
13 let n = p.n_fired as f64;
14 (p.n_plus as f64 - n * q).powi(2) / (n * q * (1.0 - q))
15 })
16 .sum()
17 };
18 let chi2_quantum = chi2_of(&|p: &AngleSweepPoint| p.quantum_eigen);
19 let chi2_classical = chi2_of(&|p: &AngleSweepPoint| p.classical);
20 let sigma_quantum = chi2_sigma(chi2_quantum, nu);
21 let sigma_classical = chi2_sigma(chi2_classical, nu);
22
23 // (6) THE HEADLINE. The classical law must be excluded at more than 5
24 // sigma by the combined chi-square. Note the comparison runs the
25 // other way: this referee fails if cos^2(theta) SURVIVES.
26 referees.push(referee(
27 &format!("classical cos^2(theta) excluded: combined chi-square, in sigma (nu = {})", nu as usize),
28 sigma_classical,
29 K,
30 Cmp::Above,
31 ));

Note which way that last comparison runs. The referee fails if Malus's law survives. That is the difference between a lab that illustrates a result and a lab that certifies one, and here is its full report:

Loading /data/ch02/stern_gerlach.json… (run cargo run --release in Rust-QP/ch02-stern-gerlach)

One arithmetic caution while you are reading those fractions, because it is the most common error in this whole business. The error bar on a fraction is not — that is the error on a count. Divide by and you get , which at is — half the naive guess. So the final cascade split in the table above sits a couple of σ from 50/50: an ordinary excursion, comfortably inside the 5σ its referee demands, but not the sub-σ triviality that would have let us claim. The point of a scoreboard is to say which it is. The seed is 1922, so your run reproduces these digits exactly — and if it does not, one of the referees on that panel will say so before a single number reaches this page.

Chapter 2 — what you now own

  • The phenomenon: spin measurements are quantized — two spots, any axis, never a smear.
  • The state: a qubit is two complex amplitudes, ; measurement outcomes are their squared magnitudes.
  • The law: — the half-angle is the fingerprint of spin-1/2, verified against synthetic data at 24 distinct angles by a route that never uses a half angle, with the classical excluded on the same data at more than 5σ.
  • The lesson: measurement overwrites the state — filters erase earlier answers, and the algebra of amplitudes (add, then square) predicts it all.
  • The geography: every qubit state is a point on the Bloch sphere; orthogonal states are antipodes, not perpendiculars.

2.7Exercises

F · FormalismC · ConceptsP · Practice
  1. (F) Verify from (2.2) that for every θ, and that . (The analyzer loses no atoms.)
  2. (F) An atom is prepared along 30° and analyzed along 75°. Compute the + fraction. Then compute it for preparation 0° and analyzer 45°. Why must the answers be equal?
  3. (C) In the cascade simulator, set A = z, B = 45°, C = x. Predict the final + fraction with pencil and paper first, then check. Now find the B angle that maximizes the final + fraction for A = z, C = −z — and explain why any B at all beats no B.
  4. (C) On the Bloch sphere, set the analyzer to 90° and sweep the phase φ from 0° to 360° with θ = 90°. Sketch P(+) versus φ. Which double-slit quantity does φ correspond to?
  5. (P) Extend the lab's cascade to a chain of N analyzers, each tilted 90°/N from the last, ending 90° from the start. Compute the survival fraction for N = 1, 3, 10, 100. (You are discovering the quantum Zeno effect: watched spins turn willingly, in small steps.)
  6. (P, harder) Add a magnetic field region between two analyzers that rotates the preparation angle at a steady rate (precession — Chapter 5's subject). Sweep the field duration and reproduce Rabi-style oscillations in the final counts.
  7. (F, hard) Leave the x–z plane: for a general direction , take on faith only that and prove the fully general law: for any two directions with angle Θ between them, . (Spherical trigonometry will hand you the identity .) Conclude that no measurement direction is special — the qubit has perfect rotational symmetry, which is Chapter 9's opening theme.
  8. (F, hard) A skeptic proposes a hidden-variable model: each atom secretly carries a unit vector , and an analyzer along answers + iff . Show this model reproduces the two spots and the 50/50 x-result for a z-filtered beam (taking λ uniform on the up hemisphere) — but derive its prediction for the analyzer sweep and show it gives , a straight line in Θ, not . Where does your Rust data rule it out at more than 5σ? (The lab already runs this trial for Malus's law: add as a third hypothesis in the block and report its σ. This warm-up is the ancestor of Bell's theorem, waiting in Chapter 18.)

The bridgeChapter 3: The Mathematical Machinery

Where you stand. You built a state from experimental data: two complex amplitudes, the half-angle law verified at 24 distinct angles against an independently diagonalized spin operator, the classical rival excluded on the same data, and collapse as the overwriting of a preparation.

The open question. We keep performing the same moves — adding amplitude pairs, projecting, changing basis — by hand and by luck. What is the general machine, and what guarantees that measurement answers are always real and always repeatable?

What comes next. Linear algebra, owned properly: bras and kets, operators as questions, eigenvalues as answers, and the commutator as the exact measure of which questions can coexist. Everything gets compiled — and self-checked — in Rust.

Continue to Chapter 3