Abstract
Quantum computing promises transformative impacts in simulating Hamiltonian dynamics, essential for studying physical systems inaccessible by classical computing. However, existing compilation techniques for Hamiltonian simulation, in particular the commonly used Trotter formulas struggle to provide gate counts feasible on current quantum computers for beyond-classical simulations. We propose partial Trotterization, where sets of non-commuting Hamiltonian terms are directly compiled allowing for less error per Trotter step and therefore a reduction of Trotter steps overall. Furthermore, a suite of novel optimizations are introduced which complement the new partial Trotterization technique, including reinforcement learning for complex unitary decompositions and high level Hamiltonian analysis for unitary reduction. We demonstrate with numerical simulations across spin and fermionic Hamiltonians that compared to state of the art methods such as Qiskit's Rustiq and Qiskit's Paulievolutiongate, our novel compiler presents up to 10x gate and depth count reductions.
Introduction
Simulating quantum systems is widely considered one of the most promising near-term applications of quantum computing. To simulate how a system evolves over time, researchers typically use Trotterization, a mathematical technique that decomposes the complex time-evolution operator $e^{iHt}$ into a sequence of simpler exponentials of individual Pauli strings. However, because these individual Hamiltonian terms generally do not commute, breaking them apart introduces approximation errors. To maintain low error, simulations must be divided into numerous tiny time steps (Trotter steps), resulting in extraordinarily deep quantum circuits that are impractical for today's noisy intermediate-scale quantum (NISQ) hardware. Existing compilers often focus on optimizing circuits within a single Trotter step, neglecting the opportunity to reduce the fundamental mathematical error of the Trotter formula itself.
Methods
The proposed framework, Kernpiler, addresses these challenges through three primary innovations:
1. Partial Trotterization via Partitioning
Unlike conventional methods that fully decompose the Hamiltonian into individual Pauli strings, Kernpiler employs a greedy algorithm to group non-commuting terms into dense "partitions" acting on a maximum of 3 qubits. By keeping these non-commuting terms together within a single exponential, the commutator error between them is eliminated, significantly reducing the overall Trotter error and the number of required steps.
2. Trotter Step Reordering and Randomization
Kernpiler utilizes a conflict graph to identify mutually commuting groups of unitaries. It strategically places the largest commuting groups at the boundaries of Trotter steps to facilitate merging with identical groups in adjacent steps. Additionally, it randomly shuffles the order of terms within groups to convert coherent errors into more manageable stochastic noise.
3. Unitary Decomposition via Monte Carlo Tree Search (MCTS)
Compiling an exponential of multiple Pauli strings into a hardware-native gate set is a complex task. Kernpiler utilizes a Reinforcement Learning approach based on Monte Carlo Tree Search (MCTS) to find optimal circuit structures. To maintain a tractable search space, the MCTS agent focuses exclusively on finding the optimal CNOT "skeleton" (the entanglement structure). Single-qubit gates are subsequently interleaved and optimized using continuous differentiable methods, such as Gauss-Newton, before final transpilation.
Results
Kernpiler was evaluated on a diverse set of benchmark Hamiltonians, including spin models (Fermi-Hubbard, Heisenberg, Ising) and molecular models (LiH, HF, PD-1 protein fragments), with sizes ranging from 8 to 222 qubits.
Key findings include:
- Significant Depth and Gate Reductions: For a target accuracy of >99.5%, Kernpiler achieved up to a 10x reduction in circuit depth and approximately a 3x reduction in CNOT gate counts compared to state-of-the-art tools like Qiskit's Rustiq and PauliEvolutionGate.
- Synthesis Efficiency: Even when the number of Trotter steps was held constant, Kernpiler's MCTS-based synthesis outperformed baseline tools like BQSkit, achieving average CNOT and depth reductions of 34% and 32%, respectively.
- Scalability: The ratio of non-commuting pairs—a key driver of Trotter error—decreases significantly with partitioned terms. This reduction remains consistent as the quantum lattice size scales, demonstrating the method's viability for larger systems.
Conclusion and Future Work
Kernpiler demonstrates that by integrating mathematical error analysis directly into the compilation process, substantial gains in circuit efficiency can be achieved. While highly effective, the current implementation sometimes results in higher single-qubit gate counts due to its focus on CNOT skeleton optimization. Future work will involve refining the MCTS heuristics to explicitly target U3 gate reduction and exploring larger partition sizes ($n > 3$) to further minimize intra-group commutation errors.
Summary updated