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.
The repo is composed of several files:
-
cases,cases_vqeare 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,
datacontains all the integrals and Hamiltonian files for the H8 molecule in the current work.figurescontains all plot script/data that can be used to reproduce all figures in the paper.jobs_vqeis 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 incases/demo_qbe_classical.ipynb. -
More details on the
casesfolder: 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.pyis the main code, which read data files and save results in each iteration of QBE to separate files.energy_calc.pyis a script to compute the energy from saved ground state vectorgs_vec_lin_runxx.pklfor each run.rmse_H8_lin.npystores 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.pyis the main code, which read data files and save results in each iteration of QBE to separate files.energy_calc.pyis a script to compute the energy from saved ground state vectorgs_vec_quad_runxx.pklfor each run.rmse_H8_quad.npystores 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.pyis the main code, andpost_process.pycompute the standard deviation of the overlap from shot-based simulation results. The subfolderh4_$n$site.pycontains the simulation shot count when there is$n$ hydrogen atoms overhap between the two H4 molecules.integralsfolder contains the one- and two-electron integral files used for the two H4 molecules in the simulation. -
vmc:bootstrap_embedding_vmc_H8.pyis 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.pyis QBE+VQE for H4 molecules, whileToyModel_runner_vqe.pyis 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.ipynbis some plot utility. Different subfolders with nameh4_linear_vqe*.ipynbandtoymodel_linear_vqe_gd_001are the generated running results for H4 and for the toy model. Note that in all QBE+VQE, only linear constraint is used.
-
See environment.yml for the dependencies and packages needed to run the codes.
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