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)
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
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
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
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)
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)
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)
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
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)
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)
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)
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)
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)
def test6311G(self): solv = SCF(h2, method="HF", basis='6-311G**') solv.iterate() self.assertAlmostEqual(solv.energy, -1.132485, 4)
def testVTZ(self): solv = SCF(h2, method="HF", basis='cc-pvtz') solv.iterate() self.assertAlmostEqual(solv.energy, -1.133009, 4)
def test631Gdp(self): solv = SCF(h2, method="HF", basis='6-31G(d,p)') solv.iterate() self.assertAlmostEqual(solv.energy, -1.131344, 4)
def test321G(self): solv = SCF(h2, method="HF", basis='3-21g') solv.iterate() self.assertAlmostEqual(solv.energy, -1.122956, 4)
def testVTZ(self): solv = SCF(h2, method="HF",basis='cc-pvtz') solv.iterate() self.assertAlmostEqual(solv.energy,-1.133009,4)
def testDZVP(self): solv = SCF(h2, method="HF",basis='dzvp') solv.iterate() self.assertAlmostEqual(solv.energy,-1.127306,4)
def testH2LDA(self): h2_lda = SCF(self.h2, method="DFT", functional="SVWN") h2_lda.iterate() self.assertAlmostEqual(h2_lda.energy, -1.132799, 4)
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)
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)
def testSTO6G(self): solv = SCF(h2, method="HF",basis='sto-3g') solv.iterate() self.assertAlmostEqual(solv.energy,-1.117099,4)
def testH2LDA(self): h2_lda = SCF(h2,method='DFT',functional="SVWN") h2_lda.iterate() self.assertAlmostEqual(h2_lda.energy,-1.135061,4)
def testH2OMINDO(self): h2o_mindo3 = SCF(h2o,method="MINDO3") h2o_mindo3.iterate() self.assertAlmostEqual(h2o_mindo3.energy,-53.5176,2)
def test321G(self): solv = SCF(h2, method="HF",basis='3-21g') solv.iterate() self.assertAlmostEqual(solv.energy,-1.122956,4)
def testH2BLYP(self): h2_blyp = SCF(h2,method="DFT",functional='BLYP') h2_blyp.iterate() self.assertAlmostEqual(h2_blyp.energy,-1.167767,4)
def testTCPSolver(self): solv = SCF(h2,method='HF',SolverConstructor=DmatSolver) solv.iterate() self.assertAlmostEqual(solv.energy,-1.131334,4)
def test631Gdp(self): solv = SCF(h2, method="HF",basis='6-31G(d,p)') solv.iterate() self.assertAlmostEqual(solv.energy,-1.131344,4)
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)
def run(self): scf = SCF(*self.a, **self.opts) scf.iterate()
def testLiLDA(self): li_lda = SCF(self.li,method='DFT',functional="SVWN") li_lda.iterate() self.assertAlmostEqual(li_lda.energy,-7.332050,4)
def testH2OHF(self): h2o_hf = SCF(self.h2o, method='HF') h2o_hf.iterate() self.assertAlmostEqual(h2o_hf.energy, -76.011755864850628, 4)
def testLiUHF(self): li_uhf = SCF(self.li,method='UHF') li_uhf.iterate() self.assertAlmostEqual(li_uhf.energy,-7.431364,4)
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()
def test631Gppss(self): solv = SCF(h2, method="HF", basis='6-31g++**') solv.iterate() self.assertAlmostEqual(solv.energy, -1.131403, 4)
def testH2OMINDO(self): h2o_mindo3 = SCF(h2o, method="MINDO3") h2o_mindo3.iterate() self.assertAlmostEqual(h2o_mindo3.energy, -53.5176, 2)
def testVDZ(self): solv = SCF(h2, method="HF", basis='cc-pvdz') solv.iterate() self.assertAlmostEqual(solv.energy, -1.128571, 4)
def testVDZ(self): solv = SCF(h2, method="HF",basis='cc-pvdz') solv.iterate() self.assertAlmostEqual(solv.energy,-1.128571,4)
def testDZVP(self): solv = SCF(h2, method="HF", basis='dzvp') solv.iterate() self.assertAlmostEqual(solv.energy, -1.127306, 4)
def test6311G3d3p(self): solv = SCF(h2, method="HF",basis='6-311G++(3d,3p)') solv.iterate() self.assertAlmostEqual(solv.energy,-1.133023,4)
def test6311G3d3p(self): solv = SCF(h2, method="HF", basis='6-311G++(3d,3p)') solv.iterate() self.assertAlmostEqual(solv.energy, -1.133023, 4)
def testOHMINDO(self): oh_mindo = SCF(oh,method="UMINDO3") oh_mindo.iterate() self.assertAlmostEqual(oh_mindo.energy,16.49043,2)
def testOHMINDO(self): oh_mindo = SCF(oh, method="UMINDO3") oh_mindo.iterate() self.assertAlmostEqual(oh_mindo.energy, 16.49043, 2)
def testH2LDA(self): h2_lda = SCF(h2, method='DFT', functional="SVWN") h2_lda.iterate() self.assertAlmostEqual(h2_lda.energy, -1.135061, 4)
def testLiROHF(self): li_uhf = SCF(li, method='ROHF') li_uhf.iterate() self.assertAlmostEqual(li_uhf.energy, -7.431369, 4)
def test6311G(self): solv = SCF(h2, method="HF",basis='6-311G**') solv.iterate() self.assertAlmostEqual(solv.energy,-1.132485,4)
def testH2BLYP(self): h2_blyp = SCF(h2, method="DFT", functional='BLYP') h2_blyp.iterate() self.assertAlmostEqual(h2_blyp.energy, -1.167767, 4)
def testH2OHF(self): h2o_hf = SCF(self.h2o,method='HF') h2o_hf.iterate() self.assertAlmostEqual(h2o_hf.energy,-76.011755864850628,4)
def testLiLDA(self): li_lda = SCF(li, method='DFT', functional="SVWN") li_lda.iterate() self.assertAlmostEqual(li_lda.energy, -7.332050, 4)
def testHeHF(self): he_hf = SCF(self.he, method='HF') he_hf.iterate() self.assertAlmostEqual(he_hf.energy, -2.855260, 3)
def testH2HF(self): h2_hf = SCF(self.h2, method="HF") h2_hf.iterate() self.assertAlmostEqual(h2_hf.energy, -1.130501, 4)
def test631Gppss(self): solv = SCF(h2, method="HF",basis='6-31g++**') solv.iterate() self.assertAlmostEqual(solv.energy,-1.131403,4)
def testTCPSolver(self): solv = SCF(h2, method='HF', SolverConstructor=DmatSolver) solv.iterate() self.assertAlmostEqual(solv.energy, -1.131334, 4)
def testH2BLYP(self): h2_blyp = SCF(self.h2, method="DFT", functional="BLYP") h2_blyp.iterate() self.assertAlmostEqual(h2_blyp.energy, -1.166286, 4)
def testHeHF(self): he_hf = SCF(self.he, method="HF") he_hf.iterate() self.assertAlmostEqual(he_hf.energy, -2.855260, 3)
def testH2HF(self): h2_hf = SCF(self.h2, method='HF') h2_hf.iterate() self.assertAlmostEqual(h2_hf.energy, -1.130501, 4)