Hamiltonian simulation does not end at the last gate. To extract physical information — an
energy, a magnetisation, or a correlation function — you must measure an observable on the
evolved state. This lesson explains how observables connect to circuit measurements and how to
estimate expectation values.
Observables and expectation values
An observable is a Hermitian operator O with real eigenvalues. When the system is in state
∣ψ⟩, the expectation value (average measurement outcome) is
⟨O⟩=⟨ψ∣O∣ψ⟩.
After time evolution under Hamiltonian H, the state is ∣ψ(t)⟩=e−iHt∣ψ0⟩,
so the expectation value of O at time t is
⟨O(t)⟩=⟨ψ0∣eiHtOe−iHt∣ψ0⟩.
Measuring Pauli observables in the circuit model
Quantum circuits measure in the computational (Z) basis. To estimate the expectation value of
a Pauli observable, you rotate the state so the observable's eigenstates align with the
measurement basis:
| Observable | Basis rotation before Z-measurement |
|---|---|
| Z | none (already in Z basis) |
| X | apply H |
| Y | apply S†H |
For the Z observable on a single qubit with probabilities P(0) and P(1):
⟨Z⟩=P(0)−P(1).
This follows directly from the Born rule: the eigenvalues of Z are +1 (for ∣0⟩)
and −1 (for ∣1⟩), so the average outcome is (+1)⋅P(0)+(−1)⋅P(1).
A worked example
Consider a single qubit initialised in ∣0⟩ and evolved under the Hamiltonian H=X
for time t. The evolution operator is
e−itX=cost⋅I−isint⋅X=Rx(2t).
The resulting state is Rx(2t)∣0⟩=cost∣0⟩−isint∣1⟩, so
P(0)=cos2t,P(1)=sin2t,
and the expectation value of Z is
⟨Z(t)⟩=cos2t−sin2t=cos(2t).
This is the Larmor precession of the Bloch vector about the x-axis: the Z-component
oscillates sinusoidally, starting at +1 (all probability on ∣0⟩) and crossing zero
at t=π/4.
At t=π/6 specifically:
⟨Z(π/6)⟩=cos(π/3)=21.
We can verify this numerically: P(0)=cos2(π/6)=3/4 and
P(1)=sin2(π/6)=1/4, giving ⟨Z⟩=3/4−1/4=1/2. ✓
Multi-qubit observables
For a two-qubit observable such as Z⊗Z (written ZZ), the eigenvalues are
(−1)x⊕y for basis state ∣xy⟩. The expectation value is
⟨ZZ⟩=P(∣00⟩)+P(∣11⟩)−P(∣01⟩)−P(∣10⟩).
No additional gates are required: a simultaneous Z-measurement on both qubits suffices.
For a Y0Z1 observable you would apply S†H to qubit 0 and nothing to qubit 1
before measuring both.
Try it
Starting from ∣0⟩, evolve under H=X for time t=π/6 by applying Rx(π/3),
then measure and return ⟨Z⟩=P(0)−P(1). The grader checks that your answer
equals 0.5.
Run your code to see the quantum state.
Sign in on the full site to ask questions and join the discussion.