- The circuit's statevector is simulated exactly (2ⁿ complex amplitudes) — this is what a real quantum computer's measurement statistics estimate via repeated shots.
- ⟨H⟩ = ⟨ψ(θ)|H|ψ(θ)⟩ is the cost the optimizer minimizes; on real hardware it's built from Pauli-string expectation values measured in different bases.
- The parameter-shift rule ∂E/∂θ = [E(θ+π/2) − E(θ−π/2)]/2 gives an exact analytic gradient for Pauli-rotation gates — no finite-difference approximation needed, exactly as on real hardware.
for each θ_i:
g_i = (E(θ_i+π/2) − E(θ_i−π/2)) / 2
θ ← θ − lr · g