Skip to content

Python code for constructing and simulating quantum circuits to carry out Hamiltonian simulation of benchmark molecules.

Notifications You must be signed in to change notification settings

teaguetomesh/dqs-term-grouping

Repository files navigation

Digital Quantum Simulation

Overview

Digital quantum simulation is an algorithm which a quantum computer may use to simulate the time evolution of real-world, quantum systems. A specific example of where this might be useful is for the task of simulating the behavior of complex molecules. To perform this task, we must first write down the Hamiltonian (a matrix describing the allowed states of the system) corresponding to a particular molecule. Then, we can generate a quantum program using this Hamiltonian which a quantum computer will execute to simulate the molecule's time evolution. We also call this task "Hamiltonian simulation" and the process of compiling these quantum programs is the subject of this repository and the paper Optimized Program Execution Ordering to Mitigate Errors in Simulations of Quantum Systems which was published in the 2021 International Conference on Rebooting Computing.

An overview of the paper and the code contained here is shown in the image below:

Screen Shot 2022-08-12 at 3 59 08 PM

The dqs module contains the code used to compile Hamiltonian simulation circuits with the max-commute-tsp and other term-ordering strategies. The main Dynamics class is defined within dqs/quantum_dynamics.py and it can be constructed by passing in one of the molecular Hamiltonians found within dqs/hamiltonians. Once the Dynamics instance is constructed, the terms within the Hamiltonian can be sorted using a number of different compilation strategies in the Dynamics.sort_hamiltonian() function, and the corresponding quantum circuit can be generated by calling Dynamics.gen_circuit().

Installation

First create and activate a Python virtual environment:

python3 -m venv your_virtual_env
source your_virtual_env/bin/activate

Then clone and install the dqs package:

git clone https://github.com/teaguetomesh/dqs-term-grouping.git
cd dqs-term-grouping
pip install -e .

References

If you use the code in this repository we ask that you please cite our work:

Teague Tomesh, Kaiwen Gui, Pranav Gokhale, Yunong Shi, Frederic T. Chong, Margaret Martonosi, and Martin Suchara, "Optimized Quantum Program Execution Ordering to Mitigate Errors in Simulations of Quantum Systems," 2021 International Conference on Rebooting Computing (ICRC), 2021, pp. 1-13, doi: 10.1109/ICRC53822.2021.00013.

About

Python code for constructing and simulating quantum circuits to carry out Hamiltonian simulation of benchmark molecules.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published