
Physics V course sequence · Interactive lesson
Expectation values, variances and moments
Once a state is normalised, every prediction you can take to a laboratory is a number obtained by sandwiching an operator between the state and itself. This is the machinery that turns ψ into measurable statistics: a mean, a spread, and an honest account of how many runs you need before the mean means anything.
UPV-03.04 · Lesson 4 of 9 in this unit. Position is not a completion score.Build the model
One state, one operator, one number — and no single run returns it.
The key idea
The expectation value of an observable A in the state |ψ⟩ is the number ⟨A⟩ = ⟨ψ|A|ψ⟩: the mean of the outcomes A would give over a large ensemble of systems all prepared in |ψ⟩, weighted by the Born probabilities.
Example. For |ψ⟩ = (3|↑⟩ + 4i|↓⟩)/5 the Born probabilities are 9/25 and 16/25, so ⟨Sz⟩ = 0.36(ℏ/2) + 0.64(−ℏ/2) = −0.14ℏ — a number no single measurement, which returns only ±ℏ/2, can ever produce.
The complete physical model and assumptions
An expectation value is not a measurement; it is a functional. Feed a normalised |ψ⟩ and a self-adjoint operator A into ⟨A⟩ = ⟨ψ|A|ψ⟩ and one real number comes out, and because an inner product is basis-free that number does not care whether you compute it as an integral over x, an integral over p, or a vector-matrix-vector product on a grid. Expand |ψ⟩ in the eigenbasis of A and the same number reappears as Σ aₙ|cₙ|², a probability-weighted average of the outcomes an apparatus can actually record — which is why ⟨A⟩ is real, why it lies inside the range of the spectrum, and why it is usually not itself an eigenvalue. The second moment buys the spread: σA² = ⟨A²⟩ − ⟨A⟩² is the squared norm of the vector (A − ⟨A⟩)|ψ⟩, so it is non-negative and vanishes exactly when |ψ⟩ is an eigenvector of A. The cost is that all of this is ensemble language. ⟨A⟩ and σA describe many identically prepared runs, never one of them; σA belongs to the state and no better apparatus reduces it, while only σA/√N, the uncertainty of the estimated mean, shrinks with data. The second cost is convergence: normalisation fixes the zeroth moment and nothing else, so a state with heavy tails can be a perfectly respectable vector in L² whose ⟨x²⟩ is infinite.
1Operate first, then overlap
The bracket ⟨ψ|A|ψ⟩ is an instruction with an order: act with A on |ψ⟩, then take the inner product of the result with ⟨ψ|. In the position representation that is ∫ψ*(Aψ)dx, which equals ∫A|ψ|²dx only when A is multiplication by a function of x. Position qualifies, momentum does not. Take the box ground state ψ₁ = √(2/L) sin(πx/L), which is real. Then ⟨p⟩ = ∫ψ₁(−iℏψ₁′)dx = −iℏ[ψ₁²/2] evaluated at the walls, which is zero because Dirichlet conditions kill ψ₁ there. The expression ∫p|ψ|²dx is not merely wrong, it is not well formed: p is not a function of x, so there is nothing to put in the integrand. And the second moment is emphatically not the square of the first — ⟨p²⟩ = (πℏ/L)² while ⟨p⟩² = 0, and it is that gap that gives a confined electron its zero-point energy.
2In an eigenbasis it is an average over outcomes
Insert the resolution of the identity Σ|n⟩⟨n| = 1 on both sides of A and use A|n⟩ = aₙ|n⟩. Everything collapses to ⟨A⟩ = Σ aₙ|cₙ|² with cₙ = ⟨n|ψ⟩. Three facts follow at once: ⟨A⟩ is real because the aₙ are; it lies between the smallest and largest aₙ; and it is generally not an eigenvalue, so it is not a possible reading. Numbers make the point. An electron in a well of width L = 0.50 nm has E₁ = h²/(8mL²) = 1.50 eV, so the levels are 1.50 eV, 6.02 eV, 13.5 eV. Prepare |ψ⟩ = (|1⟩ + i|2⟩)/√2 and ⟨H⟩ = ½(1.50) + ½(6.02) = 3.76 eV, with σH = 1.5E₁ = 2.26 eV. No apparatus ever displays 3.76 eV; each run returns 1.50 eV or 6.02 eV, half the time each. Notice too that the factor i vanished: H is diagonal in this basis, so only |cₙ|² enters and a relative phase cannot touch any energy statistic.
3Reality is a boundary condition in disguise
Subtracting the conjugate gives ⟨A⟩ − ⟨A⟩* = ⟨ψ|(A − A†)|ψ⟩, so a real expectation value is a statement about the adjoint, and the adjoint is a statement about the domain. Test it on p = −iℏ d/dx. On the whole line, one integration by parts gives ⟨p⟩ − ⟨p⟩* = −iℏ[|ψ|²] between ±∞, which vanishes because a ψ in the domain of p, with ψ and ψ′ both square-integrable, dies at infinity. Restrict the same operator to the half-line [0, ∞) and the boundary term at the origin survives: ⟨p⟩ − ⟨p⟩* = iℏ|ψ(0)|², so Im⟨p⟩ = ℏ|ψ(0)|²/2. For a state with |ψ(0)|² = 1.0 nm⁻¹ that is 5.3 × 10⁻²⁶ kg m s⁻¹ of imaginary momentum. The symbol −iℏ d/dx did not change; the domain did. So an imaginary part well above machine precision in a numerical expectation value is a diagnostic, not noise: go and find the boundary term you discarded.
4The variance is the length of a deviation vector
Define |δ⟩ = (A − ⟨A⟩)|ψ⟩. Because A is Hermitian and ⟨A⟩ is a real number, ⟨δ|δ⟩ = ⟨ψ|(A − ⟨A⟩)²|ψ⟩ = ⟨A²⟩ − ⟨A⟩², so the variance is a squared norm. Two consequences are free: it can never be negative, and it is zero only if |δ⟩ is the zero vector, that is if A|ψ⟩ = ⟨A⟩|ψ⟩ — an eigenvector. A spread of zero is therefore not a well-run experiment but a statement about which eigenbasis the state sits in. For the ground state of a 1.00 nm box, ⟨x⟩ = 0.500 nm and ⟨x²⟩ = L²(1/3 − 1/(2π²)) = 0.2827 nm², so σₓ = √(0.2827 − 0.2500) = 0.181 nm, and with σₚ = πℏ/L the product is 0.568ℏ: above ℏ/2, not at it. One numerical warning follows from the same algebra. ⟨A²⟩ − ⟨A⟩² subtracts two nearly equal large numbers, so on a grid accumulate Σ(x − ⟨x⟩)²|ψ|²Δx instead and keep your digits.
5An ensemble mean, not a prediction for one run
The Born rule delivers frequencies, so ⟨A⟩ and σA describe N systems identically prepared in |ψ⟩ and each measured once. They are not properties of a single run, and one system cannot be re-measured to sample ψ afresh: under the projection postulate (the Lüders rule) an ideal measurement leaves the system in the normalised projection of |ψ⟩ onto the eigenspace of the outcome, so an immediate second measurement of A simply repeats the first result. Estimating ⟨A⟩ from N runs carries a standard error σA/√N, and this is the only quantity in sight that improves with data. To pin ⟨x⟩ for the 1.00 nm box ground state to ±0.010 nm you need N = (0.181/0.010)² ≈ 3.3 × 10² runs. Meanwhile σₓ itself stays at 0.181 nm however many runs you take and however good the detector is, because it is a property of ψ. Keep the two apart in your notation: σA is the width of the distribution, σA/√N the width of your ignorance about its centre.
6Moments that do not exist, and the grid that hides it
⟨ψ|ψ⟩ = 1 is one convergent integral and it certifies nothing about the others. Take ψ(x) = √(a/π)/√(x² + a²). It is normalised, since ∫dx/(x² + a²) = π/a, but its density is a Lorentzian falling only as x⁻², so x²|ψ|² tends to the constant a/π and ⟨x²⟩ diverges linearly. Even ⟨x⟩ is only conditionally zero: the integrand is odd, but ∫|x||ψ|²dx diverges logarithmically, so the cancellation is a convention rather than a value. Momentum is untroubled — ⟨p²⟩ = ℏ²∫|ψ′|²dx = ℏ²/(8a²) is finite, so ψ sits in the domain of p but not in the domain of x. The numerical trap is that a grid never reports infinity. On [−X, X] the truncated moment is ⟨x²⟩ = (2a/π)(X − a arctan(X/a)), which for a = 1.0 nm gives 11.8 nm² at X = 20 nm and 24.5 nm² at X = 40 nm. A number that doubles when the box doubles has not converged.
Key equations
Read the units, assumptions and limits before substituting.
Expectation value as an inner product
⟨A⟩ = ⟨ψ|A|ψ⟩ = ∫ ψ*(x) (Aψ)(x) dx
Basis-free: the position integral, the momentum integral and a grid matrix product all return the same number.
Written for ⟨ψ|ψ⟩ = 1; divide by ⟨ψ|ψ⟩ otherwise. ⟨A⟩ carries the units of A itself.A probability-weighted average of outcomes
⟨A⟩ = Σₙ aₙ |⟨aₙ|ψ⟩|² = Σₙ aₙ |cₙ|²
⟨A⟩ lies between the smallest and the largest eigenvalue, but is rarely equal to any of them.
aₙ the eigenvalues of A, cₙ = ⟨aₙ|ψ⟩, Σ|cₙ|² = 1; a continuous spectrum replaces the sum by ∫ da.The two representations
⟨x⟩ = ∫ x |ψ(x)|² dx⟨p⟩ = ∫ ψ* (−iℏ dψ/dx) dx = ∫ p |φ(p)|² dp
Weighting by a density works only for the operator diagonal in that basis: in the x basis p must be applied to ψ, never multiplied into |ψ|².
|ψ|² in m⁻¹ and |φ|² in (kg m s⁻¹)⁻¹; φ(p) = ⟨p|ψ⟩ is the Fourier transform of ψ.Variance as a squared norm
σA² = ⟨A²⟩ − ⟨A⟩² = ‖(A − ⟨A⟩)|ψ⟩‖² ≥ 0
The norm form proves non-negativity without an integral, and is the first line of the uncertainty derivation.
σA carries the units of A; equality holds exactly when |ψ⟩ is an eigenvector of A.Reality is Hermiticity
⟨A⟩* = ⟨ψ|A†|ψ⟩⟨A⟩ real for every |ψ⟩ ⟺ ⟨χ|Aψ⟩ = ⟨Aχ|ψ⟩
An imaginary part above rounding level is never noise: it is a dropped boundary term, or an operator that is not Hermitian.
χ and ψ range over the domain of A, boundary terms included: that is Hermiticity, and self-adjointness (A = A† on the same domain) is stronger. For p on the half-line [0, ∞), Im⟨p⟩ = ℏ|ψ(0)|²/2.When a moment fails to exist
⟨xn⟩ exists ⟺ ∫ |x|n |ψ(x)|² dx converges
Normalisation fixes the zeroth moment alone; a heavy tail can leave ⟨x²⟩ infinite while ⟨p²⟩ stays finite.
The Lorentzian density |ψ|² = (a/π)/(x² + a²) is normalised, yet its ⟨x²⟩ diverges.Interactive lab
Predict first. Explore the model. Compare the result.
Explore the model
Try this. Hold θ at 45° and sweep the relative phase φ: the density slides across the box and ⟨x⟩ follows it, while ⟨H⟩ and σH never move — φ lives only in the interference term, off-diagonal in the energy basis. Then set θ to 0° or 90° and φ stops mattering: an eigenvector has no interference term to shift.
Live results
- MEAN ⟨x⟩ / L
- 0.320
- SPREAD σₓ / L
- 0.139
- MEAN ⟨H⟩ / E₁
- 2.50
- SPREAD σH / E₁
- 1.50
Results follow this lesson’s model and assumptions. Displayed values are rounded.
Predict → change one variable → check
Plan a change before running it. Every other input stays at the saved baseline.
Saved baseline. Mixing angle θ: 45 °; Relative phase φ: 0 °
This experiment is kept only while this page is open. It does not change saved course progress.
Catch the common trap
The commonest error is to read ⟨A⟩ as a prediction and σA as an error bar. Neither is. ⟨A⟩ need not lie in the spectrum at all: an electron in a 0.50 nm box prepared as (|1⟩ + i|2⟩)/√2 has ⟨H⟩ = 3.76 eV, while every energy measurement returns 1.50 eV or 6.02 eV and nothing in between. And σA belongs to the state, not to the apparatus. It does not fall when you buy a better detector, and it does not fall as you take more data. What falls as 1/√N is the standard error σA/√N of your estimate of ⟨A⟩, which is a statement about your sample and not about ψ. A perfect instrument measuring a non-eigenstate still scatters with width σA, and the only way to drive σA to zero is to prepare an eigenvector of A.
Practice & worked examples
3 authored examples. Make an attempt, then reveal the reasoning one step at a time.
EasyExample 1
A spin-½ particle is prepared in |ψ⟩ = (3|↑⟩ + 4i|↓⟩)/5, with Sz|↑⟩ = +(ℏ/2)|↑⟩ and Sz|↓⟩ = −(ℏ/2)|↓⟩. Find ⟨Sz⟩ and the spread σ in Sz.
Sketch your answer or reasoning, then compare it with the authored solution. Your writing is not automatically graded or saved.
0 of 5 steps revealed.
- Check the norm first: |3/5|² + |4i/5|² = 9/25 + 16/25 = 1, so no division by ⟨ψ|ψ⟩ is needed. The i is a relative phase and disappears from every squared modulus.
- Born probabilities: P(+ℏ/2) = 9/25 = 0.36 and P(−ℏ/2) = 16/25 = 0.64.
- ⟨Sz⟩ = Σ aₙ|cₙ|² = 0.36(+ℏ/2) + 0.64(−ℏ/2) = (0.36 − 0.64)(ℏ/2) = −0.14ℏ.
- Second moment: both eigenvalues square to ℏ²/4, so ⟨Sz²⟩ = 0.25ℏ² in every state whatsoever.
- σ² = ⟨Sz²⟩ − ⟨Sz⟩² = 0.25ℏ² − 0.0196ℏ² = 0.2304ℏ², so σ = 0.48ℏ.
Answer. ⟨Sz⟩ = −0.14ℏ and σ = 0.48ℏ. The mean is neither of the two possible readings ±ℏ/2, and σ is large because the state is far from an Sz eigenvector.
MediumExample 2
An electron occupies the ground state of an infinite square well of width L = 0.50 nm, ψ₁(x) = √(2/L) sin(πx/L). Compute ⟨x⟩, σₓ, ⟨p⟩ and σₚ, and form the product σₓ σₚ. Use ⟨x²⟩ = L²(1/3 − 1/(2π²)).
Sketch your answer or reasoning, then compare it with the authored solution. Your writing is not automatically graded or saved.
0 of 5 steps revealed.
- ⟨x⟩ = ∫x|ψ₁|²dx = L/2 = 0.250 nm, by the symmetry of sin²(πx/L) about x = L/2.
- ⟨x²⟩ = L²(1/3 − 1/(2π²)) = (0.250 nm²)(0.33333 − 0.05066) = 0.07067 nm². Then σₓ² = 0.07067 − 0.06250 = 0.00817 nm², so σₓ = 0.0904 nm.
- ⟨p⟩ = ∫ψ₁(−iℏψ₁′)dx = −iℏ[ψ₁²/2] at the walls = 0, since ψ₁ is real and vanishes at x = 0 and x = L. Do not write ∫p|ψ|²dx: p is not a function of x.
- ⟨p²⟩ = 2m⟨H⟩ = 2mE₁ = (πℏ/L)², and since ⟨p⟩ = 0 that is already the variance: σₚ = πℏ/L = π(1.0546 × 10⁻³⁴)/(0.50 × 10⁻⁹) = 6.63 × 10⁻²⁵ kg m s⁻¹.
- σₓ σₚ = (0.0904 × 10⁻⁹)(6.63 × 10⁻²⁵) = 5.99 × 10⁻³⁵ J s = 0.568ℏ, above the bound ℏ/2 = 0.500ℏ but not at it.
Answer. ⟨x⟩ = 0.250 nm, σₓ = 0.0904 nm, ⟨p⟩ = 0, σₚ = 6.63 × 10⁻²⁵ kg m s⁻¹, and σₓ σₚ = 0.568ℏ.
HardExample 3
A one-dimensional state has ψ(x) = √(a/π)/√(x² + a²) with a = 1.0 nm. Show that it is normalised, decide which of ⟨x²⟩ and ⟨p²⟩ exists, and say what a numerical grid on [−X, X] would report for ⟨x²⟩ at X = 20 nm and at X = 40 nm.
Sketch your answer or reasoning, then compare it with the authored solution. Your writing is not automatically graded or saved.
0 of 5 steps revealed.
- Normalisation: ∫dx/(x² + a²) = π/a, so ∫|ψ|²dx = (a/π)(π/a) = 1. The density is the Lorentzian |ψ(x)|² = (a/π)/(x² + a²), whose tail falls only as x⁻².
- Position: x²|ψ|² tends to a/π as |x| grows, so ∫x²|ψ|²dx diverges linearly and ⟨x²⟩ does not exist. ⟨x⟩ is only conditionally zero, since ∫|x||ψ|²dx diverges logarithmically.
- Momentum: ψ′ = −√(a/π) x (x² + a²)⁻³⁄², and ∫x²dx/(x² + a²)³ = π/(8a³), so ⟨p²⟩ = ℏ²∫(ψ′)²dx = ℏ²(a/π)(π/(8a³)) = ℏ²/(8a²). Hence σₚ = ℏ/(2√2 a) = 3.73 × 10⁻²⁶ kg m s⁻¹.
- Truncating to [−X, X] makes the integral finite: ⟨x²⟩ = (2a/π)(X − a arctan(X/a)). With a = 1.0 nm this gives 11.8 nm² at X = 20 nm and 24.5 nm² at X = 40 nm.
- Doubling the box nearly doubles the answer instead of leaving it fixed, and that linear growth in X is exactly how a divergent moment presents itself numerically. Convergence in box size is a test to run, never an assumption.
Answer. ψ is normalised. ⟨p²⟩ = ℏ²/(8a²) is finite, giving σₚ = 3.73 × 10⁻²⁶ kg m s⁻¹, while ⟨x²⟩ diverges. A grid returns 11.8 nm² at X = 20 nm and 24.5 nm² at X = 40 nm — growth linear in X, not convergence.
Quick check
Select an answer and explain it before checking.
Review & continue
The expectation value of an observable A in the state |ψ⟩ is the number ⟨A⟩ = ⟨ψ|A|ψ⟩: the mean of the outcomes A would give over a large ensemble of systems all prepared in |ψ⟩, weighted by the Born probabilities.
- Explain the relationship without looking at the equation.
- Check a sign, a unit and a model assumption in your working.
- Return to the lab or worked example if a step is still unclear.