Ejemplo n.º 1
0
 def testMP2(self):
     solv = SCF(h2,method="HF")
     solv.iterate()
     nclosed,nopen = h2.get_closedopen()
     nbf = len(solv.basis_set.get())
     emp2 = MP2(solv.ERI,solv.solver.orbs,solv.solver.orbe,nclosed,nbf-nclosed)
     self.assertAlmostEqual(solv.energy+emp2,-1.157660,4)        
Ejemplo n.º 2
0
 def testMP2(self):
     solv = SCF(h2, method="HF")
     solv.iterate()
     nclosed, nopen = h2.get_closedopen()
     nbf = len(solv.basis_set.get())
     emp2 = MP2(solv.ERI, solv.solver.orbs, solv.solver.orbe, nclosed,
                nbf - nclosed)
     self.assertAlmostEqual(solv.energy + emp2, -1.157660, 4)
Ejemplo n.º 3
0
 def testCIS(self):
     solv = SCF(h2, method="HF")
     solv.iterate()
     nclosed, nopen = h2.get_closedopen()
     nbf = len(solv.basis_set.get())
     nocc = nclosed + nopen
     nvirt = nbf - nocc
     Ecis = CIS(solv.ERI, solv.solver.orbs, solv.solver.orbe, nocc, nvirt,
                solv.energy)
     self.assertAlmostEqual(Ecis[0], -0.573134, 3)
Ejemplo n.º 4
0
 def testCIS(self):
     solv = SCF(h2,method="HF")
     solv.iterate()
     nclosed,nopen = h2.get_closedopen()
     nbf = len(solv.basis_set.get())
     nocc = nclosed+nopen
     nvirt = nbf-nocc
     Ecis = CIS(solv.ERI,solv.solver.orbs,solv.solver.orbe,nocc,
                nvirt,solv.energy)
     self.assertAlmostEqual(Ecis[0],-0.573134,3)
Ejemplo n.º 5
0
from PyQuante.TestMolecules import h2
from PyQuante.LA2 import geigh,mkdens
from PyQuante.Ints import get2JmK,getbasis,getints
from PyQuante.Convergence import DIIS
from PyQuante.hartree_fock import get_energy

bfs = getbasis(h2,basis="3-21g")
nclosed,nopen = h2.get_closedopen()
nocc = nclosed
nel = h2.get_nel()
S,h,Ints = getints(bfs,h2)

orbe,orbs = geigh(h,S)

enuke = h2.get_enuke()
eold = 0

avg = DIIS(S)

for i in range(20):
    D = mkdens(orbs,0,nocc)
    G = get2JmK(Ints,D)
    F = h+G
    F = avg.getF(F,D)
    orbe,orbs = geigh(F,S)
    energy = get_energy(h,F,D,enuke)
    print i,energy,energy-eold
    if abs(energy-eold)<1e-5:
        break
    eold = energy
print "Converged"