This repository contains code to simulate a wide array of variants of the Adaptive Derivative-Assembled Problem-Tailored (ADAPT) - Variational Quantum Eigensolver (VQE). In particular, this code was used in the following papers:
- Reducing the Resources Required by ADAPT-VQE Using Coupled Exchange Operators and Improved Subroutines
- Reducing measurement costs by recycling the Hessian in adaptive variational quantum algorithms
You can install the required packages as follows:
pip install qiskit[visualization]
pip install pyscf
pip install openfermion
pip install openfermionpyscf
pip install scipy
Creating a clean virtual environment using Anaconda is recommended. Note that PySCF does not support Windows. You can use Windows Subsystem for Linux (WSL) to install a Linux distribution (e.g. Ubunto), then install Anaconda.
The results in the papers were obtained with the following package versions:
qiskit 0.43.3
pyscf 2.2.0
openfermion 1.5.1
openfermionpyscf 0.5
scipy 1.10.1
While I tried to make the code compatible with more recent releases, I cannot guarantee proper functioning or identical results with versions other than those specified.
Before running the scripts, you must append the repository path to the Python path:
import sys
sys.path.append("/path/to/repo")
If done this way, the change is temporary. A permanent change is achieved via modification of PYTHONPATH
.
All example scripts use the molecules
).
For larger molecules, such as create_eig_decomp()
in submodule pools
and method load()
in algorithms.adapt_vqe
). While the eigendecomposition itself takes hours to compute, once it is created it can be used for the simulation of any system with the same number of qubits (with the same pool).
For all options regarding the ADAPT-VQE implementation, see AdaptVQE
class constructor in algorithms.adaptvqe
. The current implemention supports Hessian recycling [2], TETRIS [4] and orbital optimization [7], as well as a variety of selection and convergence criteria.
A variety of pool options are also supported, namely all CEO variants (OVP, MVP, DVG, DVE) [1], the qubit pool [5], the QE pool [6], and fermionic pools - GSD, SD, Spin-Adapted GSD, etc [3]. For details, see submodule pools
.
[2] Reducing measurement costs by recycling the Hessian in adaptive variational quantum algorithms
[3] An adaptive variational algorithm for exact molecular simulations on a quantum compute
[4] TETRIS-ADAPT-VQE: An adaptive algorithm that yields shallower, denser circuit ansätze
[6] Qubit-excitation-based adaptive variational quantum eigensolver