A gate-model simulator like ours has no built-in "evolve under H for time dt" command — but
we can build one. The trick is Trotterization: approximate the continuous-time evolution of
an annealing Hamiltonian by a sequence of small, simple gate steps.
The problem with sums of non-commuting terms
The evolution operator over a small time dt is U(dt)=e−idtH (setting ℏ=1).
When H=A+B with [A,B]=0 — as for our H(s)=−(1−s)X−sZ, since X and Z
anticommute — we cannot simply factor e−idt(A+B) into e−idtAe−idtB. The
two are equal only when A and B commute.
The first-order Trotter formula
For small dt the Lie–Trotter formula gives a controlled approximation:
e−idt(A+B)=e−idtAe−idtB+O(dt2).
The error per step is O(dt2), set by the commutator [A,B]. Splitting a total time T into
N=T/dt steps gives total error O(Tdt)=O(T2/N), which shrinks as you use more, smaller
steps. This is exactly how Lloyd's universal quantum simulator turns any local Hamiltonian into a
gate sequence.
One step of the single-qubit anneal
Take H(s)=−(1−s)X−sZ, so A=−(1−s)X and B=−sZ. A single Trotter step is
e−idtH(s)≈eidt(1−s)XeidtsZ.
Now translate to gates. The simulator's rotations are
RX(ϕ)=e−iϕX/2,RZ(ϕ)=e−iϕZ/2.
Matching exponents, eidt(1−s)X=RX(−2dt(1−s)) and
eidtsZ=RZ(−2dts). Because the rightmost operator acts first on a ket, apply the
Z rotation, then the X rotation:
Ustep=RX(−2dt(1−s))RZ(−2dts).
Try it
Build one first-order Trotter step of e−idtH(s) at s=0.5, dt=0.1, using one
RZ and one RX. The grader checks the resulting 2×2unitary.
Run your code to see the quantum state.
The two rotation angles are both −0.1 here (since s=1−s=0.5 and 2dt=0.2 times each
gives −0.1), producing a unitary very close to the identity for this small time step.
Sign in on the full site to ask questions and join the discussion.