DiracDirac

Part I · The Quantum Break · Chapter 3

The Mathematical Machinery

For two chapters we have been doing linear algebra without admitting it — the way you can speak prose all your life without knowing it. Time to open the hood, name the parts, and get a toolkit we will use for the rest of the book. And since a tool you cannot build is a tool you do not understand, we build the whole kit again in Rust, where the compiler keeps us honest.

Sources: Cohen-Tannoudji I, Ch. II · Ballentine, Ch. 1 · Susskind, Lectures 1–3 · Sakurai §§1.2–1.5

What this chapter covers

  • 3.1States are vectors. the arrow-and-shadows picture: one state, many representations — a rotatable basis makes it tactile.
  • 3.2Dirac's notation. bras, kets, brackets, and completeness — with Chapter 1's path-summing rules falling out of one identity.
  • 3.3Questions as machines. observables as Hermitian operators; eigenvalues are answers, eigenvectors are certainties, and the Pauli matrices enter. Build your own observable and diagonalize it live.
  • 3.4When questions collide. the commutator as the diagnostic of compatibility — Chapter 2's erasures become linear algebra, and Robertson's bound is previewed.
  • 3.5Bigger worlds. tensor products: dimensions multiply, and a first sighting of states that refuse to factor — entanglement.
  • 3.6The lab. qkit — the formalism built bare-handed in Rust, refereeing itself: the Pauli algebra exactly, the eigenvector formula in 200 directions, and the expectation postulate shot by shot against the matrix element.

Look back at what Chapter 2 forced on us. An atom's condition was two complex numbers . We added such pairs when amplitudes combined, scaled them, and took a strange kind of product — multiply matching components, conjugate one side, sum — to get the amplitude connecting two states. Adding, scaling, projecting: we have been doing vector geometry. The set of all possible states of a system is a vector space over the complex numbers, with an inner product. That's a Hilbert space; for a qubit it is just , nothing fancier than arrows you can add.

The one picture to burn in before any formulas: a state is an arrow, and the numbers we write down are its shadows on a chosen set of axes. Choose different axes — ask a different question — and the shadows change while the arrow stays put:

ℂ² · Hilbert space|0⟩|1⟩‖ψ‖ = 1⟨0|ψ⟩⟨1|ψ⟩|ψ⟩|⟨0|ψ⟩|² + |⟨1|ψ⟩|² = 1shadows² always sum to one
Figure 3.1. The arrow-and-shadows picture for a qubit. A state is a unit arrow in the Hilbert space ; the orthonormal basis are perpendicular axes. Dropping perpendiculars gives the components (the shadows) and . Because the arrow has length one, the squared shadows obey Pythagoras, — which is just “the probabilities total one.” Rotate the axes below and watch the shadows change while the arrow stays put.
same arrow, different shadows|e₁⟩|e₂⟩|ψ⟩
⟨e₁|ψ⟩ = 0.866|⟨e₁|ψ⟩|² = 0.750
⟨e₂|ψ⟩ = 0.500|⟨e₂|ψ⟩|² = 0.250
|⟨e₁|ψ⟩|² + |⟨e₂|ψ⟩|² = 1.000— always

The white arrow never moves. Rotate the basis and the components slosh from one bar to the other, but their squares always total 1. A quantum state is the arrow, not the list of numbers; choosing a basis is choosing which experimental question to ask — and the Stern–Gerlach analyzer angle of Chapter 2 was exactly this α dial (with the sneaky half-angle factor between lab space and state space).

Every “representation” in quantum mechanics — spin along z versus spin along x now, position versus momentum in Part II — is this widget with more dimensions. The physics lives in the arrow; the basis is our choice of interrogation.

Dirac invented a notation so good it does half the algebra by itself. A state (column) vector is a ket . Its conjugate-transpose (row) partner is a bra . Put a bra against a ket and you get a bra(c)ket — the inner product, a complex number:

(3.1)

Three properties, each of which is a physical statement, not bookkeeping:

  • — probabilities total one (normalization);
  • — reversing a question conjugates its amplitude, so the two directions agree on the probability;
  • — perfect distinguishability: one filter certifies, the other annihilates. Orthogonality is “reliably different.”

A basis is a set of orthonormal states — mutually exclusive answers to one complete question. Every state expands as with , and the expansion machine itself can be written as an equation:

(3.2)

Slide that identity into any bracket and it splits an amplitude into a sum over intermediate possibilities: . Read it physically and you will recognize it — it is Chapter 1's Rule 2, amplitudes add over indistinguishable intermediate paths, now a one-line consequence of the notation. When the paths are distinguished (a filter blocks one), you drop terms from the sum before squaring — Rule 3. The whole double-slit is hiding inside equation (3.2).

We have states. Now we need the mathematical object that represents a measurable quantity — something like “spin along z, in units of ħ/2.” Here is the construction, built bare-handed. A quantity is specified by (a) the special states in which it has a definite value, and (b) those values. For z-spin: definite states , values . Package both into a linear machine that eats a state and multiplies each definite-state component by its value:

(3.3)

The definite states are the machine's eigenvectors; the possible answers are its eigenvalues. For the qubit, the three directions of space give three famous machines — the Pauli matrices:

(3.4)

and the analyzer tilted along the unit vector is simply — check that has eigenvectors with eigenvalues ±1 by inspection. Two bonuses fall out of the packaging. First, the average of many measurements collapses to one clean expression. Put (3.3) between two copies of and orthonormality kills every cross term with , leaving one probability-weighted term per eigenvalue:

(3.5)

Second, a constraint: measurement results are real numbers, and distinct results belong to distinguishable (orthogonal) states. A machine of form (3.3) with real and orthogonal is exactly a Hermitian matrix — one equal to its own conjugate-transpose, . And the converse — the spectral theorem, named because a machine's set of eigenvalues is called its spectrum — says every Hermitian matrix unpacks into a real spectrum and an orthonormal eigenbasis. Observables are Hermitian machines; Hermitian machines are observables. Don't believe a theorem you haven't poked — build matrices and watch it work:

H = ⎡ 1.0 0.80.4i
    ⎣ 0.8+0.4i -0.6
eigenvalues in the complex plane-2-1012Re λ1.40-1.00
eigen-axis on the Bloch sphere+z|λ₊⟩|λ₋⟩
gap λ₊ − λ₋
2.400
eigen-axis polar angle
48.2°

Whatever you do with the four sliders, the eigenvalues stay glued to the real axis and the two eigen-directions stay antipodal (orthogonal states!). Break Hermiticity and the “possible measurement results” float into the complex plane — no meter reads 1.3 + 0.5i volts. Hermiticity is not a math convention; it is the statement that questions have real answers.

Build any Hermitian matrix and the explorer always hands back real eigenvalues on perpendicular axes — the spectral theorem, live and never failing. That is the license to invent measurements: name any question whose answers are real numbers and whose states of certainty are reliably distinguishable, and there is a legal observable waiting to represent it. Energy, momentum, spin along any axis, the parity of a molecule — every measurable in the rest of this book is just the right Hermitian machine chosen for the job.

Chapter 2's deepest fact was that the x-question erases the z-answer. Where is that in the machinery? Try to build a state that answers both questions with certainty: it would have to be an eigenvector of and of . But 's eigenvectors are and , and neither is an eigenvector of (it swaps them). No shared eigenvectors, no doubly-certain state — as a matter of linear algebra. The clean diagnostic is whether the two machines care about order:

(3.6)

If the machines share an eigenbasis and both questions can be answered at once; if not, certainty in one forces spread in the other — and the commutator's size sets the exchange rate. That is the content of the Robertson uncertainty relation,

(3.7)

which we will prove in Chapter 4 and which the lab below already tests numerically on random states (spoiler: it never loses). Chapter 1's is the special case — the microscope hand-wave will become two lines of algebra. Incidentally, non-commuting operations are not exotic: turn a book 90° about x then 90° about z, then do it in the other order — you get different orientations. Rotations don't commute, spins are about rotation, and equation (3.6) is that fact wearing matrix clothes.

One last tool and the kit is complete. Two qubits: the joint question “what will each analyzer say?” has four exclusive answers, . Four answers means four basis states means four amplitudes — the state space of a pair is the tensor product, with dimension :

(3.8)

Dimensions multiply: ten qubits inhabit a 1,024-dimensional space, three hundred qubits outrun the atom count of the visible universe. And a warning shot for Part IV: only special states of form (3.8) factor into “qubit 1 in some state” times “qubit 2 in some state.” Try it on — you can't. States that refuse to factor are entangled: the pair has a definite state while neither partner does. Susskind calls this the essential fact of quantum mechanics; it will take Chapter 18 to do it justice.

The lab Rust-QP/ch03-qkit builds this whole chapter from scratch — kets, bras, inner products, Hermitian conjugates, commutators, expectation values — with no linear-algebra crate, in about two hundred lines. The inner product is four lines, and the conjugate on the bra side is not decoration; delete the .conj() and watch norms go complex:

Rust-QP/ch03-qkit/src/main.rs — the formalism, bare-handed
1#[derive(Clone, Copy, Debug)]
2struct Ket([C; 2]);
3
4#[derive(Clone, Copy, Debug)]
5struct Mat([[C; 2]; 2]);
6
7impl Ket {
8 /// <self|other> — inner product; conjugate the bra side.
9 fn dot(&self, other: &Ket) -> C {
10 self.0[0].conj() * other.0[0] + self.0[1].conj() * other.0[1]
11 }
12 fn norm(&self) -> f64 {
13 self.dot(self).re.sqrt()
14 }
15 // …
16}
17
18// … (impl Mat: apply, mul, add, scale, sub, dagger, dist, commutator, expect)
19
20// the cast: identity and the three Pauli matrices
21const I2: Mat = Mat([[C::new(1.0, 0.0), C::new(0.0, 0.0)], [C::new(0.0, 0.0), C::new(1.0, 0.0)]]);
22const SX: Mat = Mat([[C::new(0.0, 0.0), C::new(1.0, 0.0)], [C::new(1.0, 0.0), C::new(0.0, 0.0)]]);
23const SY: Mat = Mat([[C::new(0.0, 0.0), C::new(0.0, -1.0)], [C::new(0.0, 1.0), C::new(0.0, 0.0)]]);
24const SZ: Mat = Mat([[C::new(1.0, 0.0), C::new(0.0, 0.0)], [C::new(0.0, 0.0), C::new(-1.0, 0.0)]]);

Then the program referees itself, and it is worth being exact about what “referees” buys, because the three checks are not the same kind of claim. The Pauli identities are exact: every entry in play is 0, ±1 or ±i, all of them exactly representable in binary, so the tolerance is literally 0.0 and the assertion is equality. The eigenvector formula, checked in 200 directions, does accumulate rounding — two different constructions of the same operator have to agree — so it gets a real tolerance, tightened down to 10⁻¹⁵. And the Monte Carlo sweep is a statistical claim, so it is gated statistically: the run aborts unless every sample mean sits within of the matrix element, where σ is that angle's own standard error. The panel below prints the achieved worst case in the same units.

That last one is the referee that actually earns its keep, and the reason is worth stating. Everywhere else in this lab a formula is being compared with a formula. In the sweep, two code paths that share nothing must land on the same number: the sampled side draws its coin bias from eigenkets_n and Ket::dot — the half-angle formula and the inner product — while the reference side builds out of the Pauli constants and sandwiches it between bras. Get the half-angle convention wrong, as everyone does once, and the two disagree by hundreds of σ rather than by one:

Rust-QP/ch03-qkit/src/main.rs — the program as referee
1// Tolerance 0.0: every entry is 0, +-1 or +-i, so these identities hold
2 // *exactly* in binary floating point. There is nothing to round.
3 const EXACT: f64 = 0.0;
4 let mut checks = vec![
5 check("sigma_x^2 = 1", SX.mul(&SX).dist(&I2), EXACT),
6 // … sigma_y^2, sigma_z^2 …
7 check("sigma_x sigma_y = i sigma_z", SX.mul(&SY).dist(&SZ.scale(i)), EXACT),
8 // … the two cyclic products …
9 check("[sigma_x, sigma_y] = 2i sigma_z", SX.commutator(&SY).dist(&SZ.scale(i * 2.0)), EXACT),
10 check("{sigma_x, sigma_y} = 0", SX.mul(&SY).add(&SY.mul(&SX)).dist(&Mat::ZERO), EXACT),
11 // … sigma_x is Hermitian …
12 check("sigma_y is Hermitian", SY.dagger().dist(&SY), EXACT),
13 ];
14
15 // …
16
17 // This is the one place where two genuinely independent code paths meet.
18 // The sampled side gets P(+) from eigenkets_n + Ket::dot (the half-angle
19 // formula and the inner product); the reference side gets it from
20 // sigma_n(theta, 0.0).expect(&up) (the matrix built out of the Pauli
21 // constants, sandwiched between bras). Nothing is shared. Get the
22 // half-angle convention wrong and the two disagree by hundreds of sigma.
23 let up = Ket([c(1.0, 0.0), c(0.0, 0.0)]);
24 let n_shots = 20_000u32;
25 let sweep: Vec<SweepPoint> = (0..=24)
26 .map(|k| {
27 let theta_deg = k as f64 * 15.0;
28 let theta = theta_deg * PI / 180.0;
29 let (plus_n, _) = eigenkets_n(theta, 0.0);
30 let p_plus = plus_n.dot(&up).norm_sqr();
31 let mut sum = 0i64;
32 for _ in 0..n_shots {
33 sum += if rng.gen_range(0.0..1.0) < p_plus { 1 } else { -1 };
34 }
35 let mean = sum as f64 / n_shots as f64;
36 // sample std of a ±1 variable with mean m is sqrt(1 - m^2)
37 let sigma = ((1.0 - mean * mean) / n_shots as f64).sqrt();
38 SweepPoint {
39 theta_deg,
40 sample_mean: mean,
41 sigma,
42 theory: sigma_n(theta, 0.0).expect(&up),
43 n: n_shots,
44 }
45 })
46 .collect();
47
48 // …
49
50 let sigma_floor = 2.0 / n_shots as f64;
51 let sweep_worst_sigma = sweep
52 .iter()
53 .map(|p| (p.sample_mean - p.theory).abs() / p.sigma.max(sigma_floor))
54 .fold(0.0f64, f64::max);
55 // 25 angles, so the largest of 25 standard normals is ~2.3 sigma typically;
56 // 4 sigma is the honest gate. A wrong half-angle convention lands at ~100.
57 let sweep_tol_sigma = 4.0;
58
59 // …
60
61 // Every referee is gated — the Monte Carlo sweep included. It is the only
62 // check here that two independent code paths have to agree on, so leaving
63 // it out of the gate would throw away the strongest referee in the file.
64 let algebra_pass = data.checks.iter().all(|c| c.pass);
65 let all_pass = algebra_pass && data.gate.sweep_pass && data.gate.unc_pass;
Loading /data/ch03/qkit.json… (run cargo run --release in Rust-QP/ch03-qkit)

Chapter 3 — what you now own

  • The arena: states are vectors in a complex inner-product space; bases are complete questions; amplitudes are shadows, .
  • The grammar: bras, kets, and completeness — which contains “amplitudes add over paths” as a one-liner.
  • The machines: observables are Hermitian operators; eigenvalues are the possible answers, eigenvectors the states of certainty, .
  • The collision rule: commuting observables share certainty; non-commuting ones trade it, at the rate set by .
  • The scaling law: composite systems multiply dimensions — and hide entanglement in the states that won't factor.

3.7Exercises

F · FormalismC · ConceptsP · Practice
  1. (F) Show that eigenvalues of a Hermitian matrix are real and that eigenvectors for distinct eigenvalues are orthogonal. (Two lines each, starting from .)
  2. (F) Compute for at polar angle θ in the x–z plane, find its eigenvectors, and recover equation (2.2) — the half-angle law, now as a theorem.
  3. (C) In the Hermitian explorer, find slider settings whose eigen-axis points along +x. What matrix did you build? Verify it is (up to scale and a shift by the identity).
  4. (F) Insert completeness (3.2) in the x-basis between two z-brackets and compute the amplitude for an atom prepared in to leave by the port. Summing both x-paths, the two terms must cancel — completeness hands you back , so nothing comes out. Now block one path: there is nothing left to interfere with, and the surviving term alone gives — Chapter 2's cascade. Same apparatus, two different numbers; the filter is the entire difference.
  5. (P) Extend qkit with a tensor(&Ket, &Ket) -> Ket4 and verify dimensions multiply. Then compute for the singlet state — you have just predicted your first entanglement correlation (Chapter 18 will make it famous).
  6. (P, harder) Implement expm_i(&Mat, f64) // e^(iθA) for Hermitian A via the identity and check it is unitary. You have built rotation of a spin — the front door to Chapter 5's dynamics.
  7. (F, hard) Prove the compatibility theorem used throughout this chapter: two Hermitian operators with non-degenerate spectra commute if and only if they share a complete orthonormal eigenbasis. (The ⇐ direction is two lines. For ⇒: show that if and , then is also an eigenvector of with eigenvalue a — and non-degeneracy forces it to be proportional to .) Then explain, in one sentence each, what fails when the spectrum is degenerate, and how the notion of a “complete set of commuting observables” repairs it.
  8. (F, hard) The overall-phase claim of Postulate 1 needs teeth. Show that if two states differ only by a global phase, no observable can distinguish them — but that a relative phase inside a superposition is always detectable: exhibit, for , an explicit Hermitian operator whose expectation value depends on φ, and identify which Stern–Gerlach experiment measures it. Then reconcile: why did the neutron interferometers of 1975 nonetheless detect the 360°-rotation sign flip — which looks like a global minus sign?

The bridgeChapter 4: The Postulates

Where you stand. The machinery is complete and compiled: Hilbert space, Dirac notation, Hermitian observables, commutators, tensor products — the Pauli algebra verified by qkit exactly, and the expectation postulate refereed shot by shot against the matrix element it is supposed to equal.

The open question. We now have experiments (Chapters 1–2) and mathematics (Chapter 3), but the rules connecting them are still scattered through the prose. What is the complete, minimal rulebook — and what do measurement and 'collapse' say precisely?

What comes next. The five postulates, each pinned to the experiment that forced it; the uncertainty principle proved in six lines; and the density operator — the honest difference between a superposition and a coin flip, with a Zeno experiment that turns collapse into a steering wheel.

Continue to Chapter 4