コード例 #1
0
 def load_molecule(filename):
     if os.path.exists(filename):
         print(f"Found {filename}. Loading...")
         molecule = QMolecule(filename)
         molecule.load()
     else:
         # Regenerate
         print(f"Couldn't find {filename}. Regenerating...")
         molecule = self.driver.run()
         molecule.save(filename)
     return molecule
コード例 #2
0
#                     basis='sto3g')
                     
#FILENAME = "hdf5_files/femoco_sto3g_(-1,3).hdf5"
#FILENAME = "hdf5_files/femoco_nosulfer_sto3g_(-1,3).hdf5"
FILENAME = "hdf5_files/lih_sto3g_(0,0).hdf5"
#FILENAME = "hdf5_files/hydrogen.hdf5"

if os.path.exists(FILENAME):
    print(f"Found {FILENAME}. Loading...")
    molecule = QMolecule(FILENAME)
    molecule.load()
else:
    # Regenerate
    print(f"Couldn't find {FILENAME}. Regenerating...")
    molecule = driver.run()
    molecule.save(FILENAME)

#print("Loading 1 body integrals...")
#one_body_integrals = molecule.one_body_integrals
##np.save("results/old/lih_1d.npy", one_body_integrals)
#np.save("results/new/lih_1d.npy", one_body_integrals)
#
#print("Loading 2 body integrals...")
#two_body_integrals = molecule.two_body_integrals
#np.save("results/new/lih_2d.npy", two_body_integrals)

#print("Loading FermionicOperator...")
#ferm_op = FermionicOperator(
#        h1=one_body_integrals,
#        h2=two_body_integrals
#)