DeepPractise
DeepPractise

Hamiltonian Measurement in VQE

Track: Variational & NISQ Algorithms · Difficulty: Intermediate · Est: 15 min

Hamiltonian Measurement in VQE

Overview

VQE’s core output is an energy estimate:

E(θ)=ψ(θ)Hψ(θ).E(\theta)=\langle \psi(\theta)|H|\psi(\theta)\rangle.

On a quantum computer, you don’t get E(θ)E(\theta) in one shot. You estimate it by repeated measurements.

Hamiltonian measurement is often the practical bottleneck of VQE because:

  • the Hamiltonian typically breaks into many measurable pieces
  • each piece requires shots to estimate
  • shot noise and device noise add uncertainty

This page explains what is being measured and why measurement cost can grow quickly.

Intuition

Why we break the Hamiltonian into pieces

A Hamiltonian in VQE is often expressed as a sum of simpler terms. The simplest terms to measure are Pauli-string-like observables (products of I,X,Y,ZI, X, Y, Z on different qubits).

So we write:

  • HH as “weighted sum of Pauli terms”

Then we measure each term’s expectation and add them up with weights.

Expectation values are averages

An expectation value is an average outcome over many runs. If you measure an observable many times:

  • you get a bunch of random outcomes
  • their average approaches the true expectation value

So measurement cost is fundamentally statistical.

Shot cost explosion (why it happens)

If your Hamiltonian has many terms, you need:

  • enough shots per term to reduce uncertainty

Even if each term is “easy,” many terms times many shots becomes expensive.

Formal Description

We keep formalism minimal.

Hamiltonian as a sum of Pauli terms

A common representation is:

H=jcjPj,H = \sum_j c_j P_j,

where:

  • cjc_j are real coefficients
  • each PjP_j is a Pauli string (e.g., ZIXZ\otimes I\otimes X)

Then the energy is:

E(θ)=jcjPjψ(θ).E(\theta) = \sum_j c_j\langle P_j\rangle_{\psi(\theta)}.

So VQE reduces energy estimation to estimating many expectations Pj\langle P_j\rangle.

Estimating one term

To estimate Pj\langle P_j\rangle:

  1. prepare ψ(θ)|\psi(\theta)\rangle
  2. measure in an appropriate basis (sometimes requiring a simple basis change)
  3. repeat many shots
  4. compute the sample average

The estimate has uncertainty due to finite shots (shot noise).

Grouping measurements (conceptual)

Not every term requires a completely separate measurement setting. Some terms can be measured together if they are compatible (they “don’t fight” over measurement bases).

Conceptually:

  • you partition terms into groups
  • each group shares a measurement basis
  • you measure each group with one circuit setting

This can reduce total circuit executions. We keep it high-level; the key takeaway is:

  • measurement strategy matters for cost

Worked Example

Consider a 1-qubit Hamiltonian:

H=0.7Z+0.2X.H = 0.7Z + 0.2X.

To estimate E(θ)E(\theta) you need:

  • an estimate of Z\langle Z\rangle
  • an estimate of X\langle X\rangle

These require different measurement bases:

  • measure ZZ in the computational basis
  • measure XX by rotating basis first (conceptually: apply H, then measure Z)

So even this tiny Hamiltonian needs at least two measurement settings.

Now scale up to many qubits and many terms:

  • the number of terms can be large
  • each term needs shots

This is why VQE can be measurement-heavy.

Turtle Tip

Turtle Tip

VQE often trades circuit depth for measurement volume. Shallow circuits are NISQ-friendly, but estimating energy can require many shots across many Hamiltonian terms.

Common Pitfalls

Common Pitfalls
  • Assuming VQE is “cheap” because circuits are shallow. Shot cost can dominate runtime.
  • Ignoring uncertainty. If you don’t track error bars, you can mistake noise for progress in optimization.
  • Measuring every term separately by default. Grouping compatible terms can reduce overhead.

Quick Check

Quick Check
  1. Why do we write HH as a sum of Pauli terms in VQE?
  2. What is shot noise in this context?
  3. What does measurement grouping try to reduce?

What’s Next

Now we can evaluate energies. Next we put everything together into a practical VQE workflow: the step-by-step hybrid loop, optimizer choices, stopping criteria, and realistic interpretation of results.