|q⟩ Bad Qubits

intermediate · Physics · The Postulates of Quantum Mechanics

Expectation Values, Formally

An expectation value is the average result you would get by measuring an observable on many identically prepared copies of a state. It is not (in general) one of the possible outcomes — it is their probability-weighted mean. This lesson derives the formula from the Born rule and computes one by hand.

From outcomes to averages

Measuring A^=∑kakP^k\hat{A} = \sum_k a_k\hat{P}_k on ∣ψ⟩|\psi\rangle gives outcome aka_k with probability p(ak)=⟨ψ∣P^k∣ψ⟩p(a_k) = \langle\psi|\hat{P}_k|\psi\rangle. The average outcome is therefore the ordinary statistical mean,

⟨A^⟩  =  ∑kak p(ak)  =  ∑kak ⟨ψ∣P^k∣ψ⟩.\langle \hat{A}\rangle \;=\; \sum_k a_k\, p(a_k) \;=\; \sum_k a_k\,\langle\psi|\hat{P}_k|\psi\rangle.

Now use the spectral decomposition A^=∑kakP^k\hat{A} = \sum_k a_k\hat{P}_k to pull the sum inside the expectation:

⟨A^⟩=⟨ψ∣(∑kakP^k)∣ψ⟩=⟨ψ∣A^∣ψ⟩.\langle\hat{A}\rangle = \langle\psi|\Big(\sum_k a_k\hat{P}_k\Big)|\psi\rangle = \langle\psi|\hat{A}|\psi\rangle.

This is the compact and famous form of the expectation value:

  ⟨A^⟩=⟨ψ∣A^∣ψ⟩  \boxed{\;\langle\hat{A}\rangle = \langle\psi|\hat{A}|\psi\rangle\;}

The two expressions are identical — the projector form makes the statistical meaning explicit, while ⟨ψ∣A^∣ψ⟩\langle\psi|\hat{A}|\psi\rangle is the convenient form for calculation.

A worked qubit example

Take ∣ψ⟩=cos⁡θ ∣0⟩+sin⁡θ ∣1⟩|\psi\rangle = \cos\theta\,|0\rangle + \sin\theta\,|1\rangle and the observable Z^\hat{Z}, which has eigenvalue +1+1 on ∣0⟩|0\rangle and −1-1 on ∣1⟩|1\rangle. The Born-rule probabilities are

p(0)=∣⟨0∣ψ⟩∣2=cos⁡2θ,p(1)=∣⟨1∣ψ⟩∣2=sin⁡2θ.p(0) = |\langle 0|\psi\rangle|^2 = \cos^2\theta, \qquad p(1) = |\langle 1|\psi\rangle|^2 = \sin^2\theta.

So the expectation value is

⟨Z^⟩=(+1)cos⁡2θ+(−1)sin⁡2θ=cos⁡2θ−sin⁡2θ=cos⁡2θ.\langle\hat{Z}\rangle = (+1)\cos^2\theta + (-1)\sin^2\theta = \cos^2\theta - \sin^2\theta = \cos 2\theta.

For θ=π/6\theta = \pi/6 this gives cos⁡(π/3)=12\cos(\pi/3) = \tfrac12. You can confirm with the matrix form:

⟨ψ∣Z^∣ψ⟩=(cos⁡θsin⁡θ)(100−1)(cos⁡θsin⁡θ)=cos⁡2θ−sin⁡2θ,\langle\psi|\hat{Z}|\psi\rangle = \begin{pmatrix} \cos\theta & \sin\theta \end{pmatrix} \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} \begin{pmatrix} \cos\theta \\ \sin\theta \end{pmatrix} = \cos^2\theta - \sin^2\theta,

the same answer. The expectation value 12\tfrac12 is not a possible single measurement result — those are only ±1\pm 1 — but it is the long-run average.

Properties worth remembering

Try it

For ∣ψ⟩=cos⁡θ ∣0⟩+sin⁡θ ∣1⟩|\psi\rangle = \cos\theta\,|0\rangle + \sin\theta\,|1\rangle with θ=π/6\theta = \pi/6, compute the expectation value ⟨Z^⟩=(+1)p(0)+(−1)p(1)\langle\hat Z\rangle = (+1)p(0) + (-1)p(1) using the Born-rule probabilities, and return the number.

Run your code to see the quantum state.

Sign in on the full site to ask questions and join the discussion.