|q⟩ Bad Qubits

beginner · Physics · Observables, Operators & Measurement

Expectation Values ⟨A⟩

When you measure an observable AA many times on a system always prepared in the same state ∣ψ⟩|\psi\rangle, the average result converges to the expectation value

⟨A⟩  =  ⟨ψ∣A∣ψ⟩.\langle A \rangle \;=\; \langle\psi| A |\psi\rangle.

This is one of the central formulas of quantum mechanics: it turns the abstract operator AA into a single, physically measurable number.

Where the formula comes from

Suppose AA has eigenvalues ana_n and orthonormal eigenstates ∣an⟩|a_n\rangle, so A∣an⟩=an∣an⟩A|a_n\rangle = a_n|a_n\rangle. Any state can be expanded in this basis:

∣ψ⟩=∑ncn∣an⟩,cn=⟨an∣ψ⟩.|\psi\rangle = \sum_n c_n |a_n\rangle, \qquad c_n = \langle a_n|\psi\rangle.

The Born rule says that a single measurement yields ana_n with probability ∣cn∣2|c_n|^2. The statistical mean of many measurements is therefore

⟨A⟩=∑nan ∣cn∣2.\langle A\rangle = \sum_n a_n\, |c_n|^2.

We can rewrite this in a basis-free way. Using A∣an⟩=an∣an⟩A|a_n\rangle = a_n|a_n\rangle and the completeness relation ∑n∣an⟩⟨an∣=1\sum_n |a_n\rangle\langle a_n| = \mathbf{1}:

⟨ψ∣A∣ψ⟩=⟨ψ∣(∑nan∣an⟩⟨an∣)∣ψ⟩=∑nan∣⟨an∣ψ⟩∣2=∑nan∣cn∣2.\langle\psi|A|\psi\rangle = \langle\psi|\left(\sum_n a_n|a_n\rangle\langle a_n|\right)|\psi\rangle = \sum_n a_n |\langle a_n|\psi\rangle|^2 = \sum_n a_n |c_n|^2.

The two expressions match, so ⟨A⟩=⟨ψ∣A∣ψ⟩\langle A\rangle = \langle\psi|A|\psi\rangle is not merely a definition — it is a consequence of the Born rule combined with linearity.

Computing it in matrix form

In any finite-dimensional basis, ∣ψ⟩|\psi\rangle is a column vector and AA is a square matrix. The bra ⟨ψ∣\langle\psi| is the conjugate-transpose row vector. The expectation value is then the ordinary matrix product

⟨A⟩=ψ†A ψ=∑i,jψi∗Aij ψj.\langle A\rangle = \psi^\dagger A\, \psi = \sum_{i,j} \psi_i^* A_{ij}\, \psi_j.

Example — Pauli-ZZ in the ∣+⟩|+\rangle state. The Pauli-ZZ operator is

σz=(100−1),\sigma_z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix},

with eigenstates ∣0⟩|0\rangle (eigenvalue +1+1) and ∣1⟩|1\rangle (eigenvalue −1-1). The equal-superposition state is

∣+⟩=12∣0⟩+12∣1⟩  ↔  ψ=12(11).|+\rangle = \frac{1}{\sqrt{2}}|0\rangle + \frac{1}{\sqrt{2}}|1\rangle \;\leftrightarrow\; \psi = \frac{1}{\sqrt{2}}\begin{pmatrix}1\\1\end{pmatrix}.

Step 1 — apply σz\sigma_z to ∣ψ⟩|\psi\rangle:

σzψ=12(1−1).\sigma_z\psi = \frac{1}{\sqrt{2}}\begin{pmatrix}1\\-1\end{pmatrix}.

Step 2 — inner-product with ⟨ψ∣\langle\psi|:

⟨σz⟩=12(11)⋅12(1−1)=12(1)+12(−1)=0.\langle\sigma_z\rangle = \frac{1}{\sqrt{2}}\begin{pmatrix}1 & 1\end{pmatrix} \cdot \frac{1}{\sqrt{2}}\begin{pmatrix}1\\-1\end{pmatrix} = \frac{1}{2}(1) + \frac{1}{2}(-1) = 0.

The result is exactly 00, which makes sense: ∣+⟩|+\rangle is an equal mixture of the +1+1 and −1-1 eigenstates of σz\sigma_z, so the average zz-spin vanishes.

Try it

This is a numerical exercise — your code should return a number. Compute ⟨ψ∣σz∣ψ⟩\langle\psi|\sigma_z|\psi\rangle for the equal-superposition state ∣ψ⟩=∣+⟩|\psi\rangle = |+\rangle.

Run your code to see the quantum state.

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