The Quantum Engineer

11. Measurement

11.1Projective measurement and measurement probabilities

Formally, measuring observable A means applying the projective measurement {Pᵢ}, where Pᵢ projects onto the eigenspace of eigenvalue aᵢ and Σᵢ Pᵢ = I. Outcome i occurs with probability pᵢ = ⟨ψ|Pᵢ|ψ⟩. For one qubit measuring Z: P₀ = |0⟩⟨0⟩, P₁ = |1⟩⟨1⟩, and p₀, p₁ are the |α|², |β|² of chapter 9. The projector formulation is worth the notation because it generalizes cleanly: multi-qubit measurement, partial measurement (measure qubit 2 only), and error-syndrome extraction (Part X) are all the same formula with bigger projectors. In numpy, pᵢ is just np.real(np.vdot(psi, P_i @ psi)). One caution: projectors for degenerate (repeated) eigenvalues sum over the whole eigenspace — a detail that matters from chapter 13 onward.

11.2State collapse

When outcome i occurs, the state becomes |ψ′⟩ = Pᵢ|ψ⟩/√pᵢ — renormalized, because the outcome carried probability pᵢ and the vector must have norm 1 again. This is collapse: measurement is destructive and nonlinear, the one non-unitary step in the theory. Two consequences programmers must internalize. First, you cannot observe a state and continue computing on what you saw — hardware gives you one classical bit, and the quantum state is gone (or replaced by the eigenstate). Second, conditioning matters: after measuring qubit 0 and getting 1, the state of qubit 1 must be updated to the conditional state — teleportation (13.5) and error correction are built entirely on this rule. In simulators, collapse is one line: mask the amplitudes, renormalize.

import numpy as np

psi = np.array([1, 1, 1, 1], dtype=complex) / 2   # two-qubit |++>

11.3Measurement in different bases: computational, X, and Y

Measurement is always in some basis, and choosing the basis is choosing what question you ask. The computational (Z) basis {|0⟩, |1⟩} is what hardware physically reads. The X basis {|+⟩, |−⟩} asks the other pole: to measure it, apply H then read Z, since H converts X-eigenstates into Z-eigenstates. The Y basis {|+i⟩, |−i⟩} needs S† before the H: measuring Y on (|0⟩+i|1⟩)/√2 deterministically gives +1. Nothing mystical distinguishes the bases — they are three orthogonal coordinate systems on the same Bloch sphere, and any two non-parallel bases yield genuinely incompatible information (measuring X after preparing |+⟩ is deterministic; measuring Z after it is a coin flip). Algorithm design is largely the art of choosing which basis to interrogate at which moment.

Measure in basis B  =  rotate B to Z, then read Z:

  X basis:   --H-- --Z-read--        Y basis:   --S†-- --H-- --Z-read--

11.4Expectation values from data

For observable A with eigenvalues aᵢ and outcome probabilities pᵢ, the expectation value ⟨A⟩ = Σ pᵢ aᵢ is estimated from N shots by the sample mean, and that is what hardware experiments actually compute: Z-measurement gives ⟨Z⟩ = p(0) − p(1) ∈ [−1, +1]; ⟨X⟩ comes from H-then-read as p(+) − p(−). ⟨Z⟩ = +1 means deterministically |0⟩; ⟨Z⟩ = 0 means maximum uncertainty — for |+⟩ exactly. Expectation values are the observable outputs of every algorithm in this book: variational algorithms (Part VII) optimize them directly, and Bell-inequality tests (13.4) combine four of them. When a paper claims a result, the claim lives in these averages plus their confidence intervals — never in a single shot. Learn to read ⟨A⟩ ± δ⟨A⟩ as the native currency of experimental quantum computing.

11.5Repeated measurements and statistical estimation

Identical preparations, repeated measurements, counted frequencies — this is shots-based testing, and it obeys ordinary statistics. For N shots, the standard error of an estimated probability p is √(p(1−p)/N): 100 shots give ~±5%, 10,000 give ~±0.5%. The estimate is a binomial proportion, so confidence intervals come from the standard toolbox (or bootstrap). Two engineering habits. First, budget shots like budgeting test runs: estimation cost multiplies fast when a circuit has many expectation values or when hardware time is scarce and queued. Second, distinguish statistical noise from systematic noise: more shots tighten the statistical bar, but readout bias or drift moves the mean itself and no amount of repetition fixes it (Part XI). Simulators, unlike hardware, give you the exact probabilities too — use them to validate your sampling code.

11.6Weak measurement

Weak measurement relaxes the measurement interaction so little information is extracted that the state is barely disturbed — collapse becomes a small, probabilistic nudge of the Bloch vector toward the measured eigenstate. Gaining partial information p about the state costs partial disturbance, quantified by measurement-disturbance tradeoffs. Engineering uses: qubit state tracking during computation, calibration readout that does not destroy the data qubit, and — in hardware labs — the feedback signal for real-time control. Formalism: measurement operators Mₘ with Σ Mₘ†Mₘ = I, weaker than projectors; the post-measurement state is Mₘ|ψ⟩/√pₘ, where Mₘ ≈ I ± εP for small ε. Weak measurements accumulate: many of them, averaged, reconstruct the state ensemble without collapsing any single run — genuinely different from strong measurement, and experimentally routine since ~2008.

11.7Measurement as information extraction

The unifying view: measurement is a channel with classical output — quantum state in, classical bits out, with back-action on the state. This framing dissolves two confusions. First, "observation" is not special: a readout is just a physical interaction whose result is recorded irreversibly in a classical system; the irreversibility (the record) is what makes it a measurement. Second, information and disturbance are two ends of one budget: extract one bit about the state and you disturb it by at least the amount the tradeoff relations dictate. Every architecture in this book routes information this way — circuits end in measurement, error correction extracts syndromes without touching logical data (Part X), and hardware calibrates by interleaving weak and strong readout. When you design an experiment, first ask: what information leaves the quantum system, and what does extracting it cost the state?