Hello! Welcome back to our deep dive into quantum computing.
In our previous lessons, we focused on the Variational Quantum Eigensolver (VQE), a hybrid algorithm designed to find the static ground state energy of a Hamiltonian. We saw how to construct the necessary components and implement the full workflow for the H₂ molecule.
Today, we shift our focus from static properties to the dynamics of quantum systems. This lesson addresses the learning outcome: Implement Hamiltonian simulation using a first-order Trotter-Suzuki decomposition and analyze its gate complexity and error scaling. We will explore how to simulate the time evolution of a quantum state, a task for which quantum computers are believed to hold a significant advantage over classical ones.
1. The Challenge of Simulating Quantum Dynamics
The evolution of a closed quantum system over time is described by the Schrödinger equation, whose solution is given by the application of a unitary operator to an initial state , where is the system's Hamiltonian (we set ).
The core task of Hamiltonian simulation is to implement this unitary operator on a quantum computer.
If the Hamiltonian can be implemented as a single quantum gate, this is trivial. However, most Hamiltonians of interest, like those you encountered in VQE, are sums of many simple terms:
For example, in the transverse-field Ising model, the terms are local Pauli operators like and . While we can easily implement the evolution for each individual term , we cannot simply multiply them together to get the total evolution. This is because, in general, the terms do not commute (), and for non-commuting operators and , the identity fails.
This is the central problem that Hamiltonian simulation algorithms must solve. The most direct approach is called Trotterization or Trotter-Suzuki decomposition.
To begin, let's watch a short video from Quantum Village that introduces the concept of Trotterization and the fundamental challenge posed by non-commuting Hamiltonian terms.
Please watch the first two minutes (00:00 - 02:05). This segment explains why simulating local Hamiltonians is important and why the non-commutativity of terms requires an approximation method like Trotterization.
2. The First-Order Trotter-Suzuki Decomposition
The foundation of Trotterization is the Lie-Trotter product formula, which states that for operators and :
This formula becomes an approximation when we use a large but finite number of steps, . For a small time step , the first-order Trotter-Suzuki formula gives us a practical approximation:
The error in this approximation for a single step is of the order .
To simulate the evolution for a total time , we break the evolution into small, discrete time steps of duration . We then apply the first-order approximation for each step.

The full evolution is thus approximated by:
This decomposes the complex, large-scale evolution into a sequence of simpler unitaries that we can implement with basic quantum gates.
4-2. Quantum simulation using Trotter decomposition
The Qulacs Dojo tutorial 'Quantum simulation using Trotter decomposition' provides a clear, practical explanation of this method.
Please read the first two sections, 'Trotter decomposition' and 'Quantum simulation using Trotter decomposition'. These sections formalize the approximation and explain how it allows us to simulate an exponentially large unitary using a polynomial number of simple gates.
3. Error Analysis and Gate Complexity
Understanding the performance of an algorithm requires analyzing its resource costs (gate complexity) and its accuracy (error scaling).
Error Scaling
As we saw, the error of a single Trotter step of size is . When we concatenate such steps, the errors add up. A common heuristic suggests the total error scales as:
This crucial result tells us that to achieve a desired accuracy , the number of Trotter steps must be proportional to . The error decreases as we increase , as you'll see demonstrated in the video later.
For a more rigorous understanding, which your background supports, the error bound depends on the structure of the Hamiltonian. For , the error of a single first-order step is bounded by:
This shows that the approximation error is directly related to how much the Hamiltonian terms fail to commute.
The presentation 'A Theory of Trotter Error' by Su et al. provides a formal analysis. It's a research-level resource that aligns with your preference for original sources.
Please review slides 4 ('Product formulas') and 9-10 ('Analysis of the first-order formula'). Slide 4 gives the high-level formula and error. Slides 9-10 derive the error bound in terms of the commutator, providing a deeper insight into the source of the Trotter error.
Gate Complexity
The gate complexity is the total number of elementary gates required for the simulation. Let's estimate it for a Hamiltonian .
- Cost per Trotter step: To implement one step, we must implement unitaries of the form . Let's say the gate cost for the -th term is . The total cost for one step is roughly .
- Number of steps: To achieve a target error , we need steps.
- Total Gate Complexity: Combining these, the total complexity is:
This analysis reveals how the simulation cost scales with the evolution time , the desired precision , and the complexity of the Hamiltonian itself (both the number of terms and the cost to implement them ).
4. Implementation: The Transverse-Field Ising Model
Let's make this concrete by implementing a simulation for the transverse-field Ising model, a cornerstone model in quantum magnetism. Its Hamiltonian on qubits is:
This Hamiltonian is an excellent test case because the interaction terms () do not commute with the transverse-field terms (), making Trotterization necessary.
To build the circuit for one Trotter step of duration , we need to sequence the circuits for each term:
- Transverse-field terms: The evolution is simply a rotation around the X-axis, implemented by an
RXgate: . - Interaction terms: The two-qubit term can be decomposed using CNOT and RZ gates. The identity is: This works because conjugating a single-qubit rotation on the target qubit by a CNOT gate effectively turns it into a two-qubit rotation.
4-2. Quantum simulation using Trotter decomposition
The Qulacs Dojo tutorial provides a full implementation for this model, showing how to construct the circuit and compare the simulation with the exact result.
Please read and study the code in the sections 'Implementation of quantum dynamics (1): Ising model', '(2): Transverse Magnetic Field Ising Model', and '(3): Comparison with exact solution'. Focus on: How the exp(-iδt Z_i Z_{i+1}) gate is built from CNOTs and an RZ gate. How the full Trotter step for the transverse-field model is constructed by adding the RX gates. How the final plot shows the error between the Trotterized simulation and the exact evolution, demonstrating the approximation's accuracy.
The comparison with the exact solution in the tutorial is a practical demonstration of the error analysis we discussed. By changing the number of steps M in the code, you can directly observe how the approximation improves as M increases, just as our scaling predicted.
To reinforce this, let's see a visual example of this convergence.
The 'Trotterization' video we saw earlier concludes with a simple single-qubit example, H = X + Z, visually demonstrating how the approximation improves as the number of Trotter steps increases.
Please watch from 02:05 to the end (09:05). This part first introduces the error scaling and then shows the simulated evolution on the Bloch sphere for 1, 5, and 20 Trotter steps, comparing it to the exact evolution. Notice how the approximated trajectory converges to the exact one.
Conclusion
In this lesson, we have explored the fundamentals of simulating quantum dynamics on a digital quantum computer. We moved from the static problem of finding ground states to the dynamic problem of simulating time evolution.
Key Takeaways:
- Hamiltonian simulation aims to implement the time evolution operator .
- When a Hamiltonian is a sum of non-commuting terms, we cannot simply multiply the individual evolution operators.
- The first-order Trotter-Suzuki decomposition provides a practical solution by approximating the evolution over a small time step : .
- The total evolution for time is simulated by repeating this approximation for steps, where .
- The error of this method scales as , meaning the number of steps must grow quadratically with time and inversely with the desired precision.
- The gate complexity scales as , where is the number of Hamiltonian terms and is their average implementation cost.
- We saw how to implement this for the transverse-field Ising model by decomposing each term's evolution into a sequence of elementary quantum gates.
Preview of the Next Lesson
The technique of simulating evolution under a Hamiltonian is a powerful building block. In our next lesson, Construct the QAOA ansatz circuit for a given problem Hamiltonian, such as for MaxCut, we will see how this idea is repurposed for optimization problems. The Quantum Approximate Optimization Algorithm (QAOA) uses an ansatz that alternates between evolution under a "problem" Hamiltonian and a "mixer" Hamiltonian. The evolution times become the variational parameters, creating a powerful link between Hamiltonian simulation and the variational algorithms we studied earlier.