Skip to content

therooler/variational_compilation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code for "Scalable quantum dynamics compilation via quantum machine learning"

Here, we provide Python code to reproduce the results of ARXIV LINK

Instructions

Clone the repo and create a fresh Conda environment with Python 3.10 and use Pip to install requirements.txt. Alternatively, you can run sh setup.sh, which will create the conda environemnt for you and activate it.

The main driver codes are run_1d.py and run_evolution.py in the vff folder.

If you want to run your own scripts, look at reproduce.py for examples.

GPU support

If you have a GPU available, PyTorch and Quimb should detect the GPU automatically and run the code on GPU.

Reproducing the figures

To reproduce the figures in the paper, activate the Conda environment described above and run python reproduce.py. The data needed to produce all the plots has been added to the repo in the data folder. Figures will automatically be saved in figures

If you delete the folder data, then reproduce.py will generate all the data for you, but this will likely take a long time and require HPC resources.

As of September 18th 2024, the following works on MacOS 14.6.1 and Conda 24.3.0:

sh setup.sh
conda activate var_comp
python -u reproduce.py

Help

Please reach out on Github or via email if you have any questions about the code.

A minimal piece of code

Since the code is complex and not well documented, I added a piece of code in vff called run_1d_minimal.py that can be used to run a simple example. Most of the code in run_1d_minimal.py is removed and only everything necessary to run the hotstart method remains. The following command

python -u run_1d_minimal.py

should compile an L=16 1D ISing Hamiltonian for t=0.5 within a couple of seconds.

About

Code for "Scalable quantum dynamics compilation via quantum machine learning"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published