• Mathematics

Expectation Value

The average value of a quantum observable over many measurements, computed as the inner product of the quantum state with the observable applied to that state.

The expectation value of a quantum observable OO with respect to a quantum state ψ|\psi\rangle is the statistical average of measurement outcomes when the observable is measured many times on identically prepared copies of the state. It is the central quantity computed by most variational quantum algorithms, including VQE and QAOA.

Mathematical definition

For a pure state ψ|\psi\rangle and a Hermitian operator OO:

O=ψOψ\langle O \rangle = \langle\psi|O|\psi\rangle

For a mixed state described by a density matrix ρ\rho:

O=Tr(ρO)\langle O \rangle = \text{Tr}(\rho O)

If OO has eigenvalues λi\lambda_i with corresponding eigenstates oi|o_i\rangle, and the state is ψ=icioi|\psi\rangle = \sum_i c_i |o_i\rangle, then:

O=ici2λi\langle O \rangle = \sum_i |c_i|^2 \lambda_i

This is a weighted average of eigenvalues, weighted by the probability of measuring each one. The expectation value is not necessarily an eigenvalue itself; it can take any value in the range [λmin,λmax][\lambda_{\min}, \lambda_{\max}].

Measuring expectation values on quantum hardware

On a quantum computer, you cannot directly read out O\langle O \rangle from a single measurement. Instead, you:

  1. Prepare the state ψ|\psi\rangle
  2. Measure in the eigenbasis of OO
  3. Record the eigenvalue corresponding to the measurement outcome
  4. Repeat steps 1 through 3 many times (each repetition is a shot)
  5. Compute the sample mean of the recorded eigenvalues

The sample mean converges to O\langle O \rangle as the number of shots increases, with statistical uncertainty scaling as 1/Nshots1/\sqrt{N_{\text{shots}}}.

For multi-qubit observables that are sums of Pauli terms (common in quantum chemistry and optimization), each Pauli term may require a different measurement basis. The total expectation value is:

H=iciPi\langle H \rangle = \sum_i c_i \langle P_i \rangle

where each Pi\langle P_i \rangle is estimated separately. Grouping commuting Pauli terms to measure them simultaneously reduces the total number of circuits needed.

Role in variational algorithms

In VQE, the goal is to find parameters θ\theta that minimize ψ(θ)Hψ(θ)\langle\psi(\theta)|H|\psi(\theta)\rangle, where HH is the Hamiltonian of a physical system. The variational principle guarantees that this expectation value is always greater than or equal to the true ground state energy:

ψ(θ)Hψ(θ)E0\langle\psi(\theta)|H|\psi(\theta)\rangle \geq E_0

The classical optimizer adjusts θ\theta to minimize the measured expectation value, using gradients computed via the parameter shift rule or finite differences.

Why it matters for learners

Expectation values bridge the gap between quantum mechanics and practical computation. Nearly every quantum algorithm produces its useful output as an expectation value rather than a single definitive measurement outcome. Understanding how expectation values are estimated, how many shots are needed for a given precision, and how to decompose complex observables into measurable terms is essential for working with real quantum hardware.

See also