Skip to content

yuanliu1/QBootstrapEmbedding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quantum Bootstrap Embedding (QBE)

Introduction

In this work, we extend molecular bootstrap embedding to make it appropriate for implementation on a quantum computer. This enables solution of the electronic structure problem of a large molecule as an optimization problem for a composite Lagrangian governing fragments of the total system, in such a way that fragment solutions can harness the capabilities of quantum computers. By employing state-of-art quantum subroutines including the quantum SWAP test and quantum amplitude amplification, we show how a quadratic speedup can be obtained over the classical algorithm, in principle. Utilization of quantum computation also allows the algorithm to match -- at little additional computational cost -- full density matrices at fragment boundaries, instead of being limited to 1-RDMs. Current quantum computers are small, but quantum bootstrap embedding provides a potentially generalizable strategy for harnessing such small machines through quantum fragment matching.

Structure of the Repo

The repo is composed of several files:

  • cases, cases_vqe are scripts that are used to directly produce all calculations in this work. This will be the place to look at for specific implementations of relevant algorithms mentioned in the paper.

  • In addition, data contains all the integrals and Hamiltonian files for the H8 molecule in the current work. figures contains all plot script/data that can be used to reproduce all figures in the paper. jobs_vqe is an additional folder that has QBE+VQE related scripts.

  • Last but not the least, we have been reorganizing the entire QBE framework into a standalone package in the folder qbe, where an example demonstration of using this codebase is provided in cases/demo_qbe_classical.ipynb.

  • More details on the cases folder: This folder contains the code and data used to perform the calculation for each individual parts of the QBE algorithm. It contains the following sub-folders or files:

    • linear-qbe_deterministic: scripts to run QBE with linear constraint on H8 molecules. H8_lin.py is the main code, which read data files and save results in each iteration of QBE to separate files. energy_calc.py is a script to compute the energy from saved ground state vector gs_vec_lin_runxx.pkl for each run. rmse_H8_lin.npy stores the output root-mean-square-deviation of the mismatch in each run.
    • quadratic-qbe_deterministic: scripts to run QBE with quadratic constraint on H8 molecules. H8_quad.py is the main code, which read data files and save results in each iteration of QBE to separate files. energy_calc.py is a script to compute the energy from saved ground state vector gs_vec_quad_runxx.pkl for each run. rmse_H8_quad.npy stores the output root-mean-square-deviation of the mismatch in each run.
    • qpe+swap: Code to perform SWAP test on two H4 molecules where each one is solved using a quantum phase estimation routine. h4_swap_qpe.py is the main code, and post_process.py compute the standard deviation of the overlap from shot-based simulation results. The subfolder h4_$n$site.py contains the simulation shot count when there is $n$ hydrogen atoms overhap between the two H4 molecules. integrals folder contains the one- and two-electron integral files used for the two H4 molecules in the simulation.
    • vmc: bootstrap_embedding_vmc_H8.py is the main script to perform classical bootstrap embedding using variational Monte Carlo as a solver, which serves as benchmark as compared to quantum bootstrap embedding.
    • vqe: QBE using variational quantum eigensolver as fragment solver. H4_runner_vqe.py is QBE+VQE for H4 molecules, while ToyModel_runner_vqe.py is QBE+VQE for a top model composed of a 4 spin system which is splitted as two fragments with each of them having 3 spins. plot_jobs.ipynb is some plot utility. Different subfolders with name h4_linear_vqe*.ipynb and toymodel_linear_vqe_gd_001 are the generated running results for H4 and for the toy model. Note that in all QBE+VQE, only linear constraint is used.

Requirements

See environment.yml for the dependencies and packages needed to run the codes.

Citation

Liu, Y., Meitei, O. R., Chin, Z. E., Dutt, A., Tao, M., Chuang, I. L., & Van Voorhis, T.(2023). Bootstrap Embedding on a Quantum Computer. J. Chem. Theory Comput. 19, 8, 2230–2247 (2023). arXiv:2301.01457