Exemple #1
0
 def setUpClass(self):
     import warnings
     warnings.simplefilter('ignore', FutureWarning)
     self.m = mol.Molecule(atoms='O 0 0 0; H 0 0 1; H 0 1 0',
                           basis='cc-pvdz')
     self.rhf = hf.RHF(self.m).run()
     self.uhf = hf.UHF(self.m).run()
     self.gf = aux.Aux(self.rhf.e,
                       np.eye(self.rhf.nao),
                       chempot=self.rhf.chempot)
     self.se = aux.build_rmp2(self.rhf.e,
                              self.rhf.eri_mo,
                              chempot=self.rhf.chempot)
     self.gf_a = aux.Aux(self.uhf.e[0],
                         np.eye(self.uhf.nao),
                         chempot=self.uhf.chempot[0])
     self.gf_b = aux.Aux(self.uhf.e[1],
                         np.eye(self.uhf.nao),
                         chempot=self.uhf.chempot[1])
     self.se_a = aux.build_ump2(self.uhf.e,
                                self.uhf.eri_mo[0],
                                chempot=self.uhf.chempot)
     self.se_b = aux.build_ump2(self.uhf.e[::-1],
                                self.uhf.eri_mo[1][::-1],
                                chempot=self.uhf.chempot[::-1])
     self.e_rmp2 = -0.20905684700662164
     self.e_ump2 = -0.20905685057662993
Exemple #2
0
 def setUpClass(self):
     import warnings
     warnings.simplefilter('ignore', FutureWarning)
     self.m = mol.Molecule(atoms='O 0 0 0; H 0 0 1; H 0 1 0', basis='sto-3g')
     self.rhf = hf.RHF(self.m).run()
     self.fock = self.rhf.fock_mo
     self.se = aux.build_rmp2(self.rhf.e, self.rhf.eri_mo, chempot=self.rhf.chempot) #FIXME remove test dependency?
     self.imfq = grids.ImFqGrid(2**5, beta=2**3)
Exemple #3
0
    def build(self):
        eri = self.eri
        chempot = self.chempot
        self.se = aux.build_rmp2(self.hf.e,
                                 self.eri,
                                 chempot=chempot,
                                 **self.options['_build'])

        log.write('naux (build) = %d\n' % self.naux, self.verbose)
Exemple #4
0
 def setUpClass(self):
     import warnings
     warnings.simplefilter('ignore', FutureWarning)
     self.m = mol.Molecule(atoms='O 0 0 0; H 0 0 1; H 0 1 0',
                           basis='cc-pvdz')
     self.rhf = hf.RHF(self.m).run()
     self.se = aux.build_rmp2(self.rhf.e,
                              self.rhf.eri_mo,
                              chempot=self.rhf.chempot)
     self.fock = self.rhf.fock_mo
Exemple #5
0
 def setUpClass(self):
     import warnings
     warnings.simplefilter('ignore', FutureWarning)
     self.m = mol.Molecule(atoms='O 0 0 0; H 0 0 1; H 0 1 0',
                           basis='sto-3g')
     self.rhf = hf.RHF(self.m).run()
     self.se = aux.build_rmp2(self.rhf.e,
                              self.rhf.eri_mo,
                              chempot=self.rhf.chempot)
     self.imfq = grids.ImFqGrid(2**5, beta=2**3)
     self.refq = grids.ReFqGrid(2**5, minpt=-5, maxpt=5, eta=0.01)
     self.imqd = grids.ImFqQuad(2**5, beta=2**3, lamb=0.01)
Exemple #6
0
 def setUpClass(self):
     import warnings
     warnings.simplefilter('ignore', FutureWarning)
     self.m = mol.Molecule(atoms='O 0 0 0; H 0 0 1; H 0 1 0',
                           basis='cc-pvdz')
     self.rhf = hf.RHF(self.m).run()
     self.se = aux.build_rmp2(self.rhf.e,
                              self.rhf.eri_mo,
                              chempot=self.rhf.chempot)
     self.fock = self.rhf.fock_mo
     self.se = self.se.se_compress(self.fock, nmom=10)
     self.w, self.v = self.se.eig(self.fock)
     self.gf = self.se.new(self.w, self.v[:self.rhf.nao])
Exemple #7
0
 def setUpClass(self):
     import warnings
     warnings.simplefilter('ignore', FutureWarning)
     self.m = mol.Molecule(atoms='O 0 0 0; H 0 0 1; H 0 1 0',
                           basis='cc-pvdz')
     self.rhf = hf.RHF(self.m).run()
     self.rhf_df = hf.RHF(self.m, with_df=True).run()
     self.eri = self.rhf.eri_mo
     self.eri_df = self.rhf_df.eri_mo
     self.se = aux.build_rmp2(self.rhf_df.e,
                              util.einsum('qij,qkl->ijkl', self.eri_df,
                                          self.eri_df),
                              chempot=self.rhf_df.chempot,
                              wtol=0)
     self.e_mp2 = -0.20905684700662164
     self.e_mp2_scs = -0.20503556854447708
Exemple #8
0
# Build the Molecule object:
m = mol.Molecule(atoms='H 0 0 0; Li 0 0 1.64', basis='cc-pvdz')

# Build the RHF object:
rhf = hf.RHF(m)
rhf.run()

# Build some MO quantities:
e_mo = rhf.e
eri_mo = rhf.eri_mo
fock_mo = rhf.fock_mo
chempot = rhf.chempot

# We can build the auxiliaries via the MO energies and MO integrals:
se_rmp2_a = aux.build_rmp2(e_mo, eri_mo, chempot=chempot)

# We can also do this by iterating (once) an empty auxiliary space:
s0 = aux.Aux(np.zeros(0), np.zeros((rhf.nao, 0)), chempot=chempot)
se_rmp2_b = aux.build_rmp2_iter(s0, fock_mo, eri_mo)
# In the above, chempot is inherited from s0

# Calculate the MP2 energies and compare them to canonical MP2:
e_mp2_a = aux.energy_mp2(rhf.e, se_rmp2_a)
e_mp2_b = aux.energy_mp2(rhf.e, se_rmp2_b)
e_mp2_c = mp.MP2(rhf).run().e_corr
print('a) E(mp2) = %.12f' % e_mp2_a)
print('b) E(mp2) = %.12f' % e_mp2_b)
print('c) E(mp2) = %.12f' % e_mp2_c)

# a) and c) should be exact, because they use the same eigenvalue and eigenvectors