Expectation & Uncertainty
Expectation & Uncertainty
A single measurement gives one random eigenvalue; many measurements give a distribution. Its first two moments — the expectation value and the variance — summarize what an observable does to a state. The deepest structural fact in this lesson is that you cannot make two observables both sharp at once unless they commute: the Robertson uncertainty relation. We derive it from a single line of Cauchy–Schwarz, and see exactly where Heisenberg's comes from.
Learning Objectives
After this lesson you will be able to:
- Compute the expectation value and prove the two forms agree.
- Compute the variance and interpret as "definite value".
- Derive the Robertson uncertainty relation via the Cauchy–Schwarz inequality.
- Apply it to Pauli observables, e.g. bound using .
- Distinguish compatible (commuting) from incompatible observables and state when joint measurement / a common eigenbasis exists.
Intuition
Run the same measurement on many identically prepared copies of and histogram the eigenvalues you read off. The expectation value is the mean of that histogram; the variance is its spread. If happens to be an eigenstate of , the histogram is a single spike — zero spread, a definite value.
Now the surprise. For one observable you can always find states with zero spread (the eigenstates). But you generally cannot find a state that is simultaneously spike-sharp for two different observables, like and . The obstruction is algebraic: and do not commute. The Robertson relation turns "how badly they fail to commute" — the size of — into a hard lower bound on the product of spreads. Incompatibility is not a measurement clumsiness; it is geometry forced by non-commuting operators.
Theory
Expectation value
Definition. For an observable and normalized state , the expectation value is
This is the probability-weighted mean of the eigenvalues. Insert the spectral decomposition from Lesson 1:
which is exactly the classical mean . So "" and "average the eigenvalues against the Born probabilities" are the same number — one computed from the operator, one from the experiment. Because is Hermitian and the are real, .
Properties (all immediate from linearity of the inner product):
- Linearity: for real .
- Reality: since $\langle\psi|A|\psi\rangle = \overline{\langle\psi|A^\dagger|\psi\rangle} = \overline{\langle A\rangle}$.
- Trace form: with (0.1.3 E5) — the form that generalizes to mixed states in Term 1.5.
Variance and the standard deviation
Definition. The variance of in state is
and the uncertainty (standard deviation) is .
The two expressions agree by expanding and using linearity (write , a real scalar):
Define the centered operator (Hermitian, with ). Then a clean restatement we will use in the derivation:
So the variance is a squared norm — automatically , and zero iff , i.e. iff : the state is an eigenstate and the value is definite. This recovers the Lesson 1 observation that eigenstates give deterministic outcomes, now phrased as .
The Robertson uncertainty relation
Theorem (Robertson, 1929). For any two observables , and any normalized state ,
Derivation. Let and (both Hermitian), and define the vectors
By the variance-as-norm identity, and . The Cauchy–Schwarz inequality (0.1.2) gives
Now compute the cross term (using ). Split any product into its Hermitian (anticommutator) and anti-Hermitian (commutator) parts:
Take expectations. The anticommutator is Hermitian, so is real; the commutator is anti-Hermitian (), so is purely imaginary. Hence
and because the real and imaginary parts add in quadrature,
Finally, the constant shifts cancel in the commutator: (the identity commutes with everything). Chaining (1) and (2),
Taking nonnegative square roots gives . ∎
Reading the bound. The right-hand side is state-dependent — it is , not a universal constant (except in special cases like , where it becomes the Heisenberg constant ). Dropping the anticommutator term in (2) is the only inequality besides Cauchy–Schwarz; keeping it gives the tighter Schrödinger uncertainty relation (Exercise E5).
Heisenberg as a special case. For position and momentum, (here per Appendix C), so for every state and Robertson collapses to the familiar . The qubit Pauli version below is the finite-dimensional analog.
Example structure: Pauli observables
For the Paulis, . Using the Pauli algebra (Appendix E), and , so
(Equivalently from : .) Robertson then reads
So the product of - and -spreads is bounded below by the magnitude of the -expectation. On : , , (since ). Thus , , product , and the bound holds with equality — is sharp, so the relation permits to be maximally spread. On (the eigenstate of ): , , so and the bound is again saturated: .
Compatible vs. incompatible observables
Definition. Observables are compatible if , else incompatible.
Theorem (simultaneous diagonalization). Two Hermitian operators commute iff they share a common orthonormal eigenbasis.
Sketch. () If both are diagonal in they trivially commute. () If and , then , so preserves each -eigenspace of ; restrict (still Hermitian) to that eigenspace and diagonalize it there, repeating per eigenspace. The combined eigenvectors diagonalize both. ∎
Consequences for measurement:
- Compatible (): there is a common eigenbasis with and . A single projective measurement in that basis returns both values at once — they are jointly measurable, the order does not matter, and Robertson's bound is vacuous (, allowing simultaneously, e.g. on a common eigenstate).
- Incompatible (): no common eigenbasis, measuring one disturbs the other, and Robertson forces on any state where . and are the canonical example.
This is the precise statement of "you can't measure both at once": not a limit of apparatus, but the non-existence of a basis in which both are diagonal. Generalized (non-projective) measurements can trade off information about incompatible observables — the subject of Lesson 3.
Worked Examples
Example 1 — Mean and variance of on a general qubit
Let (Bloch angles; Term 1.2). Then with ,
Since , , so
The spread vanishes at the poles (, the eigenstates ) and is maximal on the equator (, e.g. ), where — matching Example 1 of Lesson 1.
Example 2 — Saturating
Take , the -eigenstate of .
Expectations. and (the Bloch vector points along , so - and -components vanish), while .
Variances. , so and likewise ; hence .
Bound. and the Robertson right-hand side is . The inequality is an equality — is a minimum-uncertainty state for the pair . (Geometrically, maximizing while keeping pushes both spreads to their largest equal value, and Cauchy–Schwarz is tight because and are proportional — see the NumPy check below.)
Hands-on (Python)
We compute expectations and variances exactly, then numerically verify the Robertson bound over many random states — and find the states that saturate it.
import numpy as np
I = np.eye(2, dtype=complex)
X = np.array([[0, 1], [1, 0]], dtype=complex)
Y = np.array([[0, -1j], [1j, 0]], dtype=complex)
Z = np.array([[1, 0], [0, -1]], dtype=complex)
def expectation(A, psi):
"""<A> = <psi|A|psi>, returned as a real float (A is Hermitian)."""
return np.real(psi.conj() @ (A @ psi))
def variance(A, psi):
"""(ΔA)^2 = <A^2> - <A>^2."""
return expectation(A @ A, psi) - expectation(A, psi) ** 2
def uncertainty(A, psi):
return np.sqrt(max(variance(A, psi), 0.0)) # clip tiny negatives from roundoff
def random_qubit(rng):
"""Haar-ish random pure qubit: normalize a complex Gaussian vector."""
v = rng.normal(size=2) + 1j * rng.normal(size=2)
return v / np.linalg.norm(v)
# Commutator [X, Z] = -2 i Y (sanity check)
comm_XZ = X @ Z - Z @ X
print("[X,Z] == -2iY :", np.allclose(comm_XZ, -2j * Y)) # True# Verify Robertson: ΔA ΔB >= (1/2)|<[A,B]>| for many random states and Pauli pairs
rng = np.random.default_rng(1)
pairs = {"(X,Z)": (X, Z), "(X,Y)": (X, Y), "(Y,Z)": (Y, Z)}
worst_slack = {}
for name, (A, B) in pairs.items():
comm = A @ B - B @ A
min_slack = np.inf
for _ in range(100_000):
psi = random_qubit(rng)
lhs = uncertainty(A, psi) * uncertainty(B, psi)
rhs = 0.5 * np.abs(psi.conj() @ (comm @ psi)) # (1/2)|<[A,B]>|
slack = lhs - rhs
assert slack >= -1e-9, f"Robertson violated for {name}: {slack}"
min_slack = min(min_slack, slack)
worst_slack[name] = min_slack
print("Min (LHS - RHS) over 100k random states (>=0 confirms the bound):")
for name, s in worst_slack.items():
print(f" {name}: {s:.2e}") # ~0 -> the bound is tight (saturated somewhere)# Saturation: |+i> is a minimum-uncertainty state for (X, Z).
plus_i = np.array([1, 1j], dtype=complex) / np.sqrt(2)
dX, dZ = uncertainty(X, plus_i), uncertainty(Z, plus_i)
rhs = abs(expectation(Y, plus_i)) # (1/2)|<[X,Z]>| = |<Y>|
print(f"ΔX·ΔZ = {dX*dZ:.4f}, |<Y>| = {rhs:.4f} -> equality:",
np.isclose(dX * dZ, rhs)) # True
# Why it saturates: f = (X-<X>)|ψ> and g = (Z-<Z>)|ψ> are proportional (Cauchy–Schwarz tight).
f = (X - expectation(X, plus_i) * I) @ plus_i
g = (Z - expectation(Z, plus_i) * I) @ plus_i
ratio = f / g # constant (up to roundoff) where g != 0
print("f ∝ g :", np.allclose(ratio[0], ratio[1])) # TrueThe empirical loop is a property test: we never construct an adversarial state, we sample broadly and assert the inequality holds (with
min_slack ≈ 0proving it is tight, not loose). This is the standard way to gain confidence in an analytic bound before trusting a derivation in code.
Exercises
E1 (easy). For , compute , , and the variances , .
Solution
is the -eigenstate of , so and (since ) . For : , , so . The value is sharp, the value maximally spread — consistent with being an -eigenstate.
E2 (easy). Show that if and only if is an eigenstate of .
Solution
. A squared norm is iff the vector is , i.e. — exactly the eigenvalue equation with eigenvalue . ∎
E3 (medium). Verify the Robertson bound for , on the state , and explain why it holds with equality despite and not commuting.
Solution
On : , so ; , so . Product . RHS: . Equality holds because the bound itself vanishes here: on . Non-commutativity forbids both being sharp only where ; on the commutator's expectation is zero, so one observable () is allowed to be perfectly sharp.
E4 (medium). Prove that if (with Hermitian) then there exists a state with simultaneously, and conversely give a pair where no such state exists.
Solution
If they share an orthonormal eigenbasis (simultaneous-diagonalization theorem). Take : it is an eigenstate of both, so by E2. Conversely, for , (): a common-zero-spread state would be a simultaneous eigenstate, hence a common eigenvector, which would force to commute — contradiction. So no qubit state has together. ∎
E5 (hard). Derive the Schrödinger uncertainty relation by keeping the anticommutator term:
Solution
From the derivation, with the first term real and the second imaginary. Cauchy–Schwarz gives (real + imag, writing the imaginary part as ). Now , and the anticommutator expands as $\langle{\bar A,\bar B}\rangle = \langle{A,B}\rangle - 2\langle A\rangle\langle B\rangle$ (the cross terms; check by expanding ). Substituting yields the stated relation. Dropping the (nonnegative) anticommutator/covariance term recovers Robertson. ∎
E6 (hard). Show is the value of minimizing , and that the minimum equals . (The mean is the least-squares predictor — the quantum echo of the classical fact that minimizes mean-squared error.)
Solution
(real, quadratic in ). , a minimum since . The minimum value . ∎ This is why the variance is the natural measure of spread: it is the irreducible mean-squared deviation after optimally centering.
Checkpoint
- Prove for an observable with spectral decomposition .
- Why is always , and when is it ?
- State the Robertson relation and name the single inequality at the heart of its proof.
- Why does only the commutator (not the anticommutator) appear in the Robertson bound?
- Compute and the resulting bound on .
- What does imply about jointly measuring and ?
Answers
- since (Born rule).
- It equals , a squared norm, hence ; it is iff is an eigenstate of .
- ; the heart is the Cauchy–Schwarz inequality applied to , .
- splits into a real part (anticommutator) plus imaginary part (commutator) in quadrature; dropping the nonnegative anticommutator term keeps the commutator, giving the bound. (Keeping it yields the tighter Schrödinger relation.)
- , so .
- Commuting observables share an eigenbasis, so a single measurement in that basis returns both values at once (joint measurability), order-independent, with no forced uncertainty trade-off.
Further Reading
- [NC] Nielsen & Chuang, §2.2.5 — expectation/variance of observables; the uncertainty principle as presented for measurement.
- [Sak] Sakurai & Napolitano, §1.4 — dispersion, the uncertainty relation, and compatible/incompatible observables with the simultaneous-diagonalization theorem.
- [Pre] Preskill, Ph219, Ch. 2–3 — operators, expectation values, and commutation.
← Prev: Projective Measurement · Up: Term 1 · Next: POVMs & Generalized Measurement →