Quantum Computing · Part B — 09

Hamiltonian Simulation

This is the application Feynman dreamed of: using a quantum computer to simulate nature — molecules, magnets, materials. The catch is that you can’t directly run a big system’s evolution as one gate. Trotterization is the fix: chop time into thin slices and apply each simple piece in turn.

↩ before you start · keep these handy
·From QI Ch. 5: a rotation gate is e−iθP for a Pauli P — spinning the state about an axis.
·From QC 02: gates that don’t commute give different results in different orders.
·From QC 01: any unitary decomposes into the simple gates hardware actually has.
🔑 symbol decoder · every new mark, in plain words
H (Hamiltonian)the matrix of energies that drives how a system changes in time. (Not the Hadamard — same letter, different beast.) e−iHtthe time-evolution operator: apply it and the system advances by time t. terms A + BH is a sum of simple local pieces. Each one alone is easy to exponentiate; the sum isn’t. [A, B]the commutator AB − BA. If it’s zero the pieces are independent; if not, order matters and Trotter has error. Trotter stepone thin slice: e−iA t/n then e−iB t/n. Repeat n times. fidelityhow close the approximation is to the true evolution: 100% = perfect.
feel

Take turns, in tiny slices

Two forces act on the system at once, but your hardware can only apply one at a time. So you alternate: a sliver of A, a sliver of B, a sliver of A… If the slivers are thin enough, the rapid alternation is indistinguishable from doing both together. Make them too thick and the two forces step on each other’s toes — that mismatch is the Trotter error, and it shrinks as you slice finer.

🍽️ everyday picture

You want to walk diagonally but can only step due-north or due-east. Take one giant step north then one giant step east and you end up far off the diagonal. Take a hundred tiny north/east steps, alternating, and your path hugs the diagonal almost perfectly. The destination is the true evolution; thinner steps trace it more faithfully — at the cost of taking more of them.

recapAlternate the simple pieces in thin slices; finer slices track the true evolution more faithfully.
play

Slice finer, watch the error fall

Here H = X + Z on one qubit — two non-commuting pieces — evolved for a fixed time. Compare the Trotter approximation to the exact answer as you add slices. The fidelity climbs toward 100% and the error falls off like 1/n.

▸ Trotter bench(e−iX t/n e−iZ t/n)ⁿ vs e−iHt
err {{ b.n }} Trotter steps n
Trotter steps n = {{ n }}
each slice = e−iX·(t/n) then e−iZ·(t/n),
repeated {{ n }}×  (t = {{ tStr }})
fidelity to exact
{{ fidPct }}%
{{ verdict }}
recapMore Trotter slices → higher fidelity; first-order error shrinks roughly like 1/n.
math

The Trotter formula

If A and B commuted, you could split the exponential cleanly: e−i(A+B)t = e−iAte−iBt. They usually don’t — but slicing rescues it:

e−i(A+B)t ≈ ( e−iA t/n e−iB t/n )n
error per first-order step ∼ (t²/2n)·∥[A, B]∥ → 0 as n → ∞

The error is controlled entirely by the commutator [A, B] — how badly the pieces fail to commute — and by how thin you slice. Want accuracy ε? First-order Trotter needs about n ∼ t²/ε slices; smarter “higher-order” formulas need far fewer.

✎ worked example · why order matters for X and Z
1.X·Z = −i Y, but Z·X = +i Y, so [X, Z] = XZ − ZX = −2i Y ≠ 0
2.non-zero commutator → doing X-then-Z ≠ doing them together: that gap is the error
3.halve the slice (double n) and the first-order error roughly halves too
4.so any target accuracy is reachable — just pay in more gates.
recapTrotter splits e−i(A+B)t into thin alternating slices; error ∼ t²∥[A,B]∥/n.
⚠ common misconceptions

“e−i(A+B)t = e−iAte−iBt always.” Only when A and B commute. For matrices that’s the exception, not the rule — the commutator [A, B] measures exactly how wrong the naive split is.

“Just take n → ∞ for a perfect answer.” Each slice is real gates on real hardware. More slices means a deeper circuit and more accumulated noise — there’s a sweet spot, and higher-order formulas exist precisely to need fewer slices.

“Simulating quantum systems is easy on a normal computer.” The state space grows like 2ⁿ, so classical simulation chokes around a few dozen particles. Beating that wall is the original reason quantum computers were proposed.

✓ you can now
state the goal: realize e−iHt for H built from simple local terms
write the first-order Trotter formula and its 1/n error scaling
explain why the commutator [A, B] is the source of the error
see why this is the killer app classical machines can’t match
← 08 Shor, Assembled Part B complete · back to QC home