oo-VQE
Schematic representation of an orbitally-optimized VQE workflow. \(\boldsymbol \theta\) and \(\boldsymbol \kappa\) represent the set of circuit and orbital rotation parameters, respectively. The expectation values of \(H\) are minimized via a classical two-step process; NR stands for Newton-Raphson.
The oo-VQE algorithm (refer to the figure) is implemented in two other dedicated classes:
qc2.algorithms.qiskit.oo_vqe.oo_VQE and qc2.algorithms.pennylane.oo_vqe.oo_VQE.
It is important to note that, in addition to handling circuit parameters, oo-VQE also optimizes
the initial Hartree-Fock molecular orbital coefficients through
additional classical Newton-Raphson steps (\(C'_{\rm MO} \rightarrow e^{-\boldsymbol \kappa} C_{\rm MO}\)) . This is done by resorting to analytic
first and second derivatives of the energy with respect to \(\boldsymbol \kappa\) as
implemented in the OrbitalOptimization class; for details, see [MMN+20, SAHR81, YSG+21, ZGS+23].
Similarly to VQE, the oo-VQE algorithm class in qc2 is primarily designed to be instantiated through the qc2Data.algorithm
attribute; this is further explained in Running quantum-classical algorithms via qc2Data class. However, it can also be instantiated
and operated independently, as long as an instance of qc2Data is available.
An illustrative example is shown below:
1from ase.build import molecule
2
3from qiskit_algorithms.optimizers import SLSQP
4from qiskit.primitives import Estimator
5
6from qc2.data import qc2Data
7from qc2.algorithms.qiskit import oo_VQE
8from qc2.algorithms.utils import ActiveSpace
9
10# set ASE Atoms object
11mol = molecule('H2O')
12
13# instantiate qc2Data class
14qc2data = qc2Data(
15 molecule=mol,
16 ...
17)
18
19# ... run qchem ab initio HF calculation via qc2-ASE
20
21# set up oo-VQE class
22oo_vqe = oo_VQE(
23 qc2data=qc2data,
24 active_space=ActiveSpace(
25 num_active_electrons=(2, 2),
26 num_active_spatial_orbitals=4
27 ),
28 mapper='jw',
29 optimizer=SLSQP(),
30 estimator=Estimator(),
31)
32
33# run algorithm
34oo_vqe.run()