|q⟩ Bad Qubits

intermediate · Programming · Hamiltonian Simulation & Trotterization

Time Evolution Operators

In quantum mechanics, the state of a closed system evolves in time by a unitary operator. If the system's energy is described by a Hermitian operator called the Hamiltonian HH, the Schrodinger equation gives the time-evolution operator

U(t)=eiHtU(t) = e^{-iHt}

(setting =1\hbar = 1 throughout). Starting from state ψ0|\psi_0\rangle, after time tt the system is in the state ψ(t)=U(t)ψ0|\psi(t)\rangle = U(t)|\psi_0\rangle.

Why the matrix exponential?

For any Hermitian matrix HH with eigenvalues EkE_k and eigenstates Ek|E_k\rangle,

eiHt=keiEktEkEk.e^{-iHt} = \sum_k e^{-iE_k t}|E_k\rangle\langle E_k|.

Each energy eigenstate acquires a phase eiEkte^{-iE_k t}; superpositions of different energies therefore oscillate relative to each other — that oscillation is quantum dynamics.

Evolution under a single Pauli

The simplest nontrivial Hamiltonians are proportional to the Pauli matrices XX, YY, ZZ. Because Z2=IZ^2 = I, its matrix exponential closes into trigonometric functions:

eiθZ=cosθIisinθZ=(eiθ00eiθ).e^{-i\theta Z} = \cos\theta\, I - i\sin\theta\, Z = \begin{pmatrix} e^{-i\theta} & 0 \\ 0 & e^{i\theta} \end{pmatrix}.

Comparing with the standard definition of the RzR_z rotation gate,

Rz(ϕ)=(eiϕ/200eiϕ/2)=ei(ϕ/2)Z,R_z(\phi) = \begin{pmatrix} e^{-i\phi/2} & 0 \\ 0 & e^{i\phi/2} \end{pmatrix} = e^{-i(\phi/2)Z},

we get the identity

eiθZ=Rz(2θ).e^{-i\theta Z} = R_z(2\theta).

This is the key bridge between physics (Hamiltonian evolution) and gate-level quantum programming: evolving for time tt under the Hamiltonian H=ZH = Z with coupling strength θ/t\theta/t is exactly the same as applying an RzR_z gate with angle 2θ2\theta.

A concrete example

Take θ=π/4\theta = \pi/4. Then

ei(π/4)Z=(eiπ/400eiπ/4),e^{-i(\pi/4)Z} = \begin{pmatrix} e^{-i\pi/4} & 0 \\ 0 & e^{i\pi/4} \end{pmatrix},

which equals Rz(π/2)R_z(\pi/2). This is sometimes called the SS gate (up to a global phase), and it rotates the Bloch sphere by 90°90° around the zz-axis.

Why this matters for algorithms

Simulating the dynamics of a physical system (molecules, materials, quantum magnets) on a quantum computer reduces to implementing eiHte^{-iHt} as a sequence of gates. For multi-term Hamiltonians such as H=jhjPjH = \sum_j h_j P_j (a sum of Pauli products), the key technique is Trotterization:

ei(A+B)t(eiAt/neiBt/n)n,e^{-i(A+B)t} \approx \left(e^{-iAt/n}\, e^{-iBt/n}\right)^n,

which becomes exact as nn \to \infty. Each factor eiPjΔte^{-iP_j \Delta t} can then be compiled into one or a few primitive gates. Upcoming lessons build on this foundation.

Try it

Implement the unitary ei(π/4)Ze^{-i(\pi/4)Z} on a single qubit. Use the rotation-gate identity above to find the right call. The grader checks the full unitary matrix, so a do-nothing circuit will fail.

Run your code to see the quantum state.

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