Пример #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)        
Пример #2
0
 def testLiUHFFT(self):
     li_uhf = SCF(li,method="UHF",etemp=1e4)
     li_uhf.iterate()
     # No test, since I don't really know what the energy should be:
     # finite temperature HF is kind of a hack. But this at least
     # tests that the program runs
     return
Пример #3
0
 def testLiUHFFT(self):
     li_uhf = SCF(li, method="UHF", etemp=1e4)
     li_uhf.iterate()
     # No test, since I don't really know what the energy should be:
     # finite temperature HF is kind of a hack. But this at least
     # tests that the program runs
     return
Пример #4
0
def test():
    from PyQuante.PyQuante2 import SCF,DmatSolver
    print "Target energy: ",-1.130501
    h2 = Molecule('H2',atomlist=[(1,(0.35,0,0)),(1,(-0.35,0,0))],
                  units='Angs')
    h2_hf = SCF(h2,method='HF',SolverConstructor=DmatSolver)
    h2_hf.iterate()
    print "Energy:        ",h2_hf.energy
Пример #5
0
 def testMCWSolver(self):
     from PyQuante.DMP import McWeeny
     solv = SCF(h2,
                method='HF',
                SolverConstructor=DmatSolver,
                solver=McWeeny)
     solv.iterate()
     self.assertAlmostEqual(solv.energy, -1.131334, 4)
Пример #6
0
 def testJacobiSolver(self):
     from PyQuante.Solvers import jacobi
     solv = SCF(h2,
                method='HF',
                SolverConstructor=SubspaceSolver,
                solver=jacobi)
     solv.iterate()
     self.assertAlmostEqual(solv.energy, -1.131334, 4)
Пример #7
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)
Пример #8
0
def test():
    from PyQuante.PyQuante2 import SCF, DmatSolver
    print "Target energy: ", -1.130501
    h2 = Molecule('H2',
                  atomlist=[(1, (0.35, 0, 0)), (1, (-0.35, 0, 0))],
                  units='Angs')
    h2_hf = SCF(h2, method='HF', SolverConstructor=DmatSolver)
    h2_hf.iterate()
    print "Energy:        ", h2_hf.energy
Пример #9
0
 def testDavidsonSolver(self):
     from PyQuante.Solvers import davidson
     solv = SCF(h2,
                method='HF',
                SolverConstructor=SubspaceSolver,
                solver=davidson,
                pass_nroots=True)
     solv.iterate()
     self.assertAlmostEqual(solv.energy, -1.131334, 4)
Пример #10
0
 def testLiH_OEP_AN(self):
     do_oep_an = True
     lih_hf = SCF(lih,method="HF")
     lih_hf.iterate()
     ints = lih_hf.S,lih_hf.h,lih_hf.ERI
     E_exx,orbe_exx,orbs_exx = oep_hf_an(lih,lih_hf.solver.orbs,
                                         bfs=lih_hf.basis_set.get(),
                                         integrals=ints)
     self.assertAlmostEqual(E_exx,-7.981282,4)
Пример #11
0
 def testLiH_OEP_AN(self):
     do_oep_an = True
     lih_hf = SCF(lih, method="HF")
     lih_hf.iterate()
     ints = lih_hf.S, lih_hf.h, lih_hf.ERI
     E_exx, orbe_exx, orbs_exx = oep_hf_an(lih,
                                           lih_hf.solver.orbs,
                                           bfs=lih_hf.basis_set.get(),
                                           integrals=ints)
     self.assertAlmostEqual(E_exx, -7.981282, 4)
Пример #12
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)
Пример #13
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)
Пример #14
0
 def test6311G(self):
     solv = SCF(h2, method="HF", basis='6-311G**')
     solv.iterate()
     self.assertAlmostEqual(solv.energy, -1.132485, 4)
Пример #15
0
 def testVTZ(self):
     solv = SCF(h2, method="HF", basis='cc-pvtz')
     solv.iterate()
     self.assertAlmostEqual(solv.energy, -1.133009, 4)
Пример #16
0
 def test631Gdp(self):
     solv = SCF(h2, method="HF", basis='6-31G(d,p)')
     solv.iterate()
     self.assertAlmostEqual(solv.energy, -1.131344, 4)
Пример #17
0
 def test321G(self):
     solv = SCF(h2, method="HF", basis='3-21g')
     solv.iterate()
     self.assertAlmostEqual(solv.energy, -1.122956, 4)
Пример #18
0
 def testVTZ(self):
     solv = SCF(h2, method="HF",basis='cc-pvtz')
     solv.iterate()
     self.assertAlmostEqual(solv.energy,-1.133009,4)
Пример #19
0
 def testDZVP(self):
     solv = SCF(h2, method="HF",basis='dzvp')
     solv.iterate()
     self.assertAlmostEqual(solv.energy,-1.127306,4)
Пример #20
0
 def testH2LDA(self):
     h2_lda = SCF(self.h2, method="DFT", functional="SVWN")
     h2_lda.iterate()
     self.assertAlmostEqual(h2_lda.energy, -1.132799, 4)
Пример #21
0
 def testJacobiSolver(self):
     from PyQuante.Solvers import jacobi
     solv = SCF(h2,method='HF',SolverConstructor=SubspaceSolver,
                 solver=jacobi)
     solv.iterate()
     self.assertAlmostEqual(solv.energy,-1.131334,4)
Пример #22
0
 def testDavidsonSolver(self):
     from PyQuante.Solvers import davidson
     solv = SCF(h2,method='HF',SolverConstructor=SubspaceSolver,
                 solver=davidson,pass_nroots=True)
     solv.iterate()
     self.assertAlmostEqual(solv.energy,-1.131334,4)
Пример #23
0
 def testSTO6G(self):
     solv = SCF(h2, method="HF",basis='sto-3g')
     solv.iterate()
     self.assertAlmostEqual(solv.energy,-1.117099,4)
Пример #24
0
 def testH2LDA(self):
     h2_lda = SCF(h2,method='DFT',functional="SVWN")
     h2_lda.iterate()
     self.assertAlmostEqual(h2_lda.energy,-1.135061,4)
Пример #25
0
 def testH2OMINDO(self):
     h2o_mindo3 = SCF(h2o,method="MINDO3")
     h2o_mindo3.iterate()
     self.assertAlmostEqual(h2o_mindo3.energy,-53.5176,2)
Пример #26
0
 def test321G(self):
     solv = SCF(h2, method="HF",basis='3-21g')
     solv.iterate()
     self.assertAlmostEqual(solv.energy,-1.122956,4)
Пример #27
0
 def testH2BLYP(self):
     h2_blyp = SCF(h2,method="DFT",functional='BLYP')
     h2_blyp.iterate()
     self.assertAlmostEqual(h2_blyp.energy,-1.167767,4)
Пример #28
0
 def testTCPSolver(self):
     solv = SCF(h2,method='HF',SolverConstructor=DmatSolver)
     solv.iterate()
     self.assertAlmostEqual(solv.energy,-1.131334,4)
Пример #29
0
 def test631Gdp(self):
     solv = SCF(h2, method="HF",basis='6-31G(d,p)')
     solv.iterate()
     self.assertAlmostEqual(solv.energy,-1.131344,4)
Пример #30
0
 def testMCWSolver(self):
     from PyQuante.DMP import McWeeny
     solv = SCF(h2,method='HF',SolverConstructor=DmatSolver,
                 solver=McWeeny)
     solv.iterate()
     self.assertAlmostEqual(solv.energy,-1.131334,4)
Пример #31
0
 def run(self):
     scf = SCF(*self.a, **self.opts)
     scf.iterate()
Пример #32
0
 def testLiLDA(self):
     li_lda = SCF(self.li,method='DFT',functional="SVWN")
     li_lda.iterate()
     self.assertAlmostEqual(li_lda.energy,-7.332050,4)
Пример #33
0
 def testH2OHF(self):
     h2o_hf = SCF(self.h2o, method='HF')
     h2o_hf.iterate()
     self.assertAlmostEqual(h2o_hf.energy, -76.011755864850628, 4)
Пример #34
0
 def testLiUHF(self):
     li_uhf = SCF(self.li,method='UHF')
     li_uhf.iterate()
     self.assertAlmostEqual(li_uhf.energy,-7.431364,4)
Пример #35
0
 def testSTO6G(self):
     solv = SCF(h2, method="HF", basis='sto-3g')
     solv.iterate()
     self.assertAlmostEqual(solv.energy, -1.117099, 4)
 def run(self):
     scf = SCF(*self.a,**self.opts)
     scf.iterate()
Пример #37
0
 def test631Gppss(self):
     solv = SCF(h2, method="HF", basis='6-31g++**')
     solv.iterate()
     self.assertAlmostEqual(solv.energy, -1.131403, 4)
Пример #38
0
 def testH2OMINDO(self):
     h2o_mindo3 = SCF(h2o, method="MINDO3")
     h2o_mindo3.iterate()
     self.assertAlmostEqual(h2o_mindo3.energy, -53.5176, 2)
Пример #39
0
 def testVDZ(self):
     solv = SCF(h2, method="HF", basis='cc-pvdz')
     solv.iterate()
     self.assertAlmostEqual(solv.energy, -1.128571, 4)
Пример #40
0
 def testVDZ(self):
     solv = SCF(h2, method="HF",basis='cc-pvdz')
     solv.iterate()
     self.assertAlmostEqual(solv.energy,-1.128571,4)
Пример #41
0
 def testDZVP(self):
     solv = SCF(h2, method="HF", basis='dzvp')
     solv.iterate()
     self.assertAlmostEqual(solv.energy, -1.127306, 4)
Пример #42
0
 def test6311G3d3p(self):
     solv = SCF(h2, method="HF",basis='6-311G++(3d,3p)')
     solv.iterate()
     self.assertAlmostEqual(solv.energy,-1.133023,4)
Пример #43
0
 def test6311G3d3p(self):
     solv = SCF(h2, method="HF", basis='6-311G++(3d,3p)')
     solv.iterate()
     self.assertAlmostEqual(solv.energy, -1.133023, 4)
Пример #44
0
 def testOHMINDO(self):
     oh_mindo = SCF(oh,method="UMINDO3")
     oh_mindo.iterate()
     self.assertAlmostEqual(oh_mindo.energy,16.49043,2)
Пример #45
0
 def testOHMINDO(self):
     oh_mindo = SCF(oh, method="UMINDO3")
     oh_mindo.iterate()
     self.assertAlmostEqual(oh_mindo.energy, 16.49043, 2)
Пример #46
0
 def testH2LDA(self):
     h2_lda = SCF(h2, method='DFT', functional="SVWN")
     h2_lda.iterate()
     self.assertAlmostEqual(h2_lda.energy, -1.135061, 4)
Пример #47
0
 def testLiROHF(self):
     li_uhf = SCF(li, method='ROHF')
     li_uhf.iterate()
     self.assertAlmostEqual(li_uhf.energy, -7.431369, 4)
Пример #48
0
 def test6311G(self):
     solv = SCF(h2, method="HF",basis='6-311G**')
     solv.iterate()
     self.assertAlmostEqual(solv.energy,-1.132485,4)
Пример #49
0
 def testH2BLYP(self):
     h2_blyp = SCF(h2, method="DFT", functional='BLYP')
     h2_blyp.iterate()
     self.assertAlmostEqual(h2_blyp.energy, -1.167767, 4)
Пример #50
0
 def testH2OHF(self):
     h2o_hf = SCF(self.h2o,method='HF')
     h2o_hf.iterate()
     self.assertAlmostEqual(h2o_hf.energy,-76.011755864850628,4)
Пример #51
0
 def testLiLDA(self):
     li_lda = SCF(li, method='DFT', functional="SVWN")
     li_lda.iterate()
     self.assertAlmostEqual(li_lda.energy, -7.332050, 4)
Пример #52
0
 def testHeHF(self):
     he_hf = SCF(self.he, method='HF')
     he_hf.iterate()
     self.assertAlmostEqual(he_hf.energy, -2.855260, 3)
Пример #53
0
 def testH2HF(self):
     h2_hf = SCF(self.h2, method="HF")
     h2_hf.iterate()
     self.assertAlmostEqual(h2_hf.energy, -1.130501, 4)
Пример #54
0
 def test631Gppss(self):
     solv = SCF(h2, method="HF",basis='6-31g++**')
     solv.iterate()
     self.assertAlmostEqual(solv.energy,-1.131403,4)
Пример #55
0
 def testTCPSolver(self):
     solv = SCF(h2, method='HF', SolverConstructor=DmatSolver)
     solv.iterate()
     self.assertAlmostEqual(solv.energy, -1.131334, 4)
Пример #56
0
 def testH2BLYP(self):
     h2_blyp = SCF(self.h2, method="DFT", functional="BLYP")
     h2_blyp.iterate()
     self.assertAlmostEqual(h2_blyp.energy, -1.166286, 4)
Пример #57
0
 def testHeHF(self):
     he_hf = SCF(self.he, method="HF")
     he_hf.iterate()
     self.assertAlmostEqual(he_hf.energy, -2.855260, 3)
Пример #58
0
 def testH2HF(self):
     h2_hf = SCF(self.h2, method='HF')
     h2_hf.iterate()
     self.assertAlmostEqual(h2_hf.energy, -1.130501, 4)