auto_oo: an autodifferentiable framework for molecular orbital-optimized variational quantum algorithms
Generate orbital optimized cost functions based on electronic structure Hamiltonians in an active space, based on automatic differentation. Powered by PennyLane using either a Pytorch or Jax backend. Molecular structure calculations are performed with PySCF. Supports gradients and hessians of hybrid cost functions based on orbital rotations and parameterized quantum circuits. We use a parameterization of orbitals by rotating the orthogonal atomic orbitals (OAOs). This code was developed as a tool to enable the calculation of Berry phases in molecular systems, see arXiv:2304.06070.
- create an anaconda or pip environment.
- install PyTorch following the instructions in PyTorch's Get Started. (GPU support is not needed for small active spaces)
- Clone the repository
git clone [email protected]:EmielKoridon/auto_oo.git
and move into the cloned directorycd auto_oo
- Install auto_oo and its dependencies with
pip install .
Auto_oo requires the following dependencies:
- pytorch this should be installed manually
- numpy
- pennylane (version >= 0.31.1, where the orbital-rotation bug is fixed. See here.
- scipy
- openfermion
- pyscf
- jax
Furthermore in the tutorials, we use cirq to visualize states using Dirac notation.
For an extensive tutorial of the code, see the examples section. For the moment, we provide two jupyer notebooks
examples/Tutorial_auto_oo.ipynb
- in this introduction to the usage of the code, we implement a orbital-optimized PQC ansatz and optimize it using automatic differentationexamples/Tutorial_Berry_phase.ipynb
- in this tutorial we show how to use the orbital-optimized PQC ansatz to detect a conical intersection by calculating the Berry phase with the algorithm described in arXiv:2304.06070.
auto_oo
├── README.md
├── pyproject.toml
│
├── examples
│ ├── Tutorial_auto_oo.ipynb
│ └── Tutorial_Berry_phase.ipynb
│
├── src
│ └── auto_oo
│ ├── ansatze
│ │ ├── __init__.py
│ │ ├── kUpCCD.py
│ │ └── uccd.py
│ ├── __init__.py
│ ├── moldata_pyscf.py
│ ├── noisy_oo_pqc.py
│ ├── oo_energy.py
│ ├── oo_pqc.py
│ ├── pqc.py
│ └── utils
│ ├── active_space.py
│ ├── __init__.py
│ ├── miscellaneous.py
│ └── newton_raphson.py
└── test
└── ...