The Trotter Product Formula
The time-evolution operator for a sum of Hamiltonians cannot generally be split into , because matrices that do not commute satisfy in general. The Lie–Trotter product formula makes this splitting an approximation that becomes exact in a controlled limit.
The first-order Trotter formula
For any two operators and ,
Truncating to a single step () gives the first-order Trotter approximation:
The error in the unitary can be bounded using the Baker–Campbell–Hausdorff expansion. To leading order,
so the operator error is . When and commute the commutator and the approximation is exact for any .
Mapping a Trotter step to gates
Consider the Hamiltonian
where is the two-qubit Pauli interaction from the previous lesson and acts only on qubit 0. The two terms do not commute — — so Trotterization introduces an approximation error proportional to .
A single first-order Trotter step at time decomposes as:
Reading the product right-to-left (standard operator convention), this means the factor is applied to the state first, followed by the factor — matching the left-to-right gate order in the circuit diagram below.
Each factor maps directly to known gate patterns:
Factor 1 (applied first to the state):
As derived in the previous lesson, the rotation is implemented with a CNOT sandwich:
Factor 2 (applied second to the state):
Using the general Pauli rotation identity ,
Chaining these two factors gives the full Trotter step as a four-gate circuit:
cx(0, 1) // parity encode
rz(2t, 1) // ZZ rotation
cx(0, 1) // parity decode
rx(2t, 0) // X_0 rotation
Generalising to many terms
The same recipe extends to any Hamiltonian written as a sum of Pauli strings:
Each can be implemented with at most CNOT gates (one CNOT ladder of length ), so a single Trotter step over an -qubit system with terms requires two-qubit gates in total. Larger (more repetitions) trades circuit depth for accuracy.
Try it
Implement one first-order Trotter step for at time . The grader checks the full unitary matrix, so an empty circuit will not pass.
After grading, try changing to a different value (such as or ) and observe how the unitary changes — but make sure your referenceSolution matches whatever you choose.
Sign in on the full site to ask questions and join the discussion.