Representing quantum chemical systems
In this section, we introduce the MolecularOrbitals
object, which is what represents a quantum chemical system such as a molecule in QURI Parts.
The MolecularOrbitals
is a protocol class that is defined to hold:
- number of electrons in the system.
- number of spatial orbitals in the system.
- of the system.
- molecular orbital coefficient (mo coefficient).
In this tutorial, we specifically focus on PySCFMolecularOrbitals
, which is what represents a molecule in QURI Parts with PySCF input. We will also introduce the ActiveSpaceMolecularOrbitals
object, which holds the active space information of the molecule.
Defining the Molecules and Molecular Orbitals
Now, let's first build a water molecule with PySCF and create a PySCFMolecularOrbitals
.
from pyscf import gto, scf
mole = gto.M(atom="O 0 0 0; H 0.2774 0.8929 0.2544; H 0.6068, -0.2383, -0.7169")
mf = scf.RHF(mole).run(verbose=0)
The PySCFMolecularOrbitals
is created with a pyscf.gto.Mole
object and an array that represents the mo coefficient.
from quri_parts.pyscf.mol import PySCFMolecularOrbitals
h2o_mo = PySCFMolecularOrbitals(mole, mf.mo_coeff)
print(f'Number of electrons: {h2o_mo.n_electron}')
print(f'Number of spatial orbitals: {h2o_mo.n_spatial_orb}')
print(f'Spin of the molecule: {h2o_mo.spin}')
print(f'MO coefficients:\n {h2o_mo.mo_coeff.round(3)}')
#output
Number of electrons: 10
Number of spatial orbitals: 7
Spin of the molecule: 0
MO coefficients:
[[ 0.994 -0.233 -0. 0.103 0. -0.13 0. ]
[ 0.026 0.838 0. -0.535 -0. 0.863 -0. ]
[ 0.003 0.093 -0.131 0.572 0.636 0.552 -0.212]
[ 0.002 0.069 0.45 0.424 -0.388 0.408 0.728]
[-0.002 -0.049 0.386 -0.299 0.667 -0.289 0.625]
[-0.006 0.158 0.446 0.283 0. -0.788 -0.828]
[-0.006 0.158 -0.446 0.283 0. -0.788 0.828]]