I am trying to use operfermion to calculated the eigen values for different molecules. Tried for Hydrogen, LithiumHydride, Water. It works fine. When Itried to calculated the same thing for Ozone, Oxygen, HCN etc., the program finally got killed after consuming all the memory.
Any help is deeply appreciated.
Here is the sample code to reproduce the issue
from numpy import pi
from openfermion.chem import MolecularData
geometry=[['O',[0,0,0]],['O',[0,1.0885,0.6697]],['O',[0,-1.0885,0.6697]]]
basis='sto-3g'
multiplicity=1 #singlet
charge=0 #neutral
ozone_molecule=MolecularData(geometry,basis,multiplicity,charge)
from openfermionpsi4 import run_psi4
ozone_molecule = run_psi4(ozone_molecule,
run_mp2=True,
run_cisd=True,
run_ccsd=True,
run_fci=True)
two_electron_integrals = ozone_molecule.two_body_integrals
orbitals = ozone_molecule.canonical_orbitals
ozone_filename = ozone_molecule.filename
ozone_molecule.save()
one_body_integrals = ozone_molecule.one_body_integrals
from openfermion.transforms import get_fermion_operator, jordan_wigner
ozone_qubit_hamiltonian = jordan_wigner(get_fermion_operator(ozone_molecule.get_molecular_hamiltonian()))
from openfermion.linalg import get_sparse_operator
from scipy.linalg import eigh
ozone_matrix= get_sparse_operator(ozone_qubit_hamiltonian).todense()
eigenvalues, eigenvectors = eigh(ozone_matrix)
print(eigenvalues)
This consumes roughly 128 GB of RAM and finally gets killed.