|q⟩ Bad Qubits

intermediate · Programming · Hamiltonian Simulation & Trotterization

Simulating Quantum Systems

One of the oldest arguments for building a quantum computer came not from cryptography or optimisation but from physics: nature is quantum, so simulate it with something quantum. Richard Feynman made this case in 1982, pointing out that classical computers appear to need exponentially many variables to keep track of the state of even a modest quantum system. A quantum computer, by contrast, can store and manipulate quantum states directly.

The core problem

Consider a physical system whose energy is captured by a Hamiltonian operator HH. In quantum mechanics the state ψ(t)|\psi(t)\rangle obeys the Schrödinger equation

iddtψ(t)=Hψ(t).i\hbar\,\frac{d}{dt}|\psi(t)\rangle = H|\psi(t)\rangle.

For a time-independent HH the formal solution is the time-evolution operator

U(t)=eiHt/.U(t) = e^{-iHt/\hbar}.

The task of Hamiltonian simulation is: given a description of HH and a time tt, implement U(t)U(t) as a quantum circuit (or approximate it to within a desired error ε\varepsilon).

Why classical computers struggle

Suppose the physical system contains nn spin-1/2 particles (qubits). The Hilbert space has dimension 2n2^n. To classically store a general state vector you need 2n2^n complex amplitudes; to apply a general unitary you need a 2n×2n2^n \times 2^n matrix-vector product. For n=50n = 50 that is already 25010152^{50} \approx 10^{15} entries — far beyond practical memory.

Quantum simulation sidesteps this because the quantum computer's nn physical qubits are the nn particles; the hardware encodes the exponentially large state implicitly.

What we actually want to compute

In practice we care about several related questions:

Hamiltonian simulation algorithms address all three, because an efficient U(t)U(t) circuit is a building block for quantum phase estimation, which extracts eigenvalues.

A taste of the approach: Trotterisation

Most physically interesting Hamiltonians are sums of simpler terms:

H=H1+H2++Hk,H = H_1 + H_2 + \cdots + H_k,

where each HjH_j acts on only a few qubits and is easy to exponentiate. The Trotter–Suzuki formula (first order) approximates the joint evolution by interleaving the individual evolutions:

ei(H1+H2)teiH1teiH2t,e^{-i(H_1 + H_2)t} \approx e^{-iH_1 t}\,e^{-iH_2 t},

with an operator error of O ⁣(t2[H1,H2])O\!\left(t^2 \|[H_1, H_2]\|\right).

The error is proportional to the commutator [H1,H2]=H1H2H2H1[H_1, H_2] = H_1 H_2 - H_2 H_1: if the terms commute the approximation is exact. Breaking tt into rr smaller steps of size t/rt/r reduces the error to O(t2/r)O(t^2/r), so we can make it arbitrarily small.

Each factor eiHjt/re^{-iH_j\,t/r} maps to a short quantum circuit, and we chain rr repetitions. This is first-order Trotterisation (also called the Lie–Trotter product formula), and it is the foundation for the more sophisticated algorithms we will build in this module.

Why this module matters

Hamiltonian simulation is among the most compelling near-term and long-term applications of quantum computing. In the near term, variational algorithms (VQE) use approximate ansatz circuits inspired by Trotterisation to estimate ground-state energies on noisy hardware. In the fault-tolerant era, Trotterisation and more advanced methods (LCU, qubitisation, QSVT) promise exponential speed-ups over the best classical algorithms for quantum chemistry and condensed-matter physics.

In the lessons that follow you will implement the time-evolution operator for concrete Hamiltonians, compare different Trotter step counts, and see how circuit depth grows with precision requirements.

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