예제 #1
0
 def test_h2(self):
     bfs = basisset(h2,'6-31g**')
     solver=rhf(h2,bfs)
     solver.converge()
     nvirt = len(bfs)-h2.nocc()
     emp2 = mp2(solver.i2,solver.orbs,solver.orbe,h2.nocc(),len(bfs)-h2.nocc())
     self.assertAlmostEqual(emp2,-0.02632654197486595)
     return
예제 #2
0
 def test_H2(self):
     bfs = basisset(h2,'cc-pvdz')
     hamiltonian=rhf(bfs, twoe_factory=libint_twoe_integrals)
     iterator = SCFIterator(hamiltonian)
     iterator.converge()
     self.assertTrue(iterator.converged)
     nvirt = len(bfs)-h2.nocc()
     emp2 = mp2(hamiltonian, iterator.orbs, iterator.orbe, h2.nocc(), nvirt)
     self.assertAlmostEqual(emp2, -0.026304104341, 6)
예제 #3
0
 def test_CH4(self):
     bfs = basisset(ch4,'cc-pvdz')
     hamiltonian=rhf(bfs, twoe_factory=libint_twoe_integrals)
     iterator = SCFIterator(hamiltonian)
     iterator.converge()
     self.assertTrue(iterator.converged)
     nvirt = len(bfs)-ch4.nocc()
     emp2 = mp2(hamiltonian, iterator.orbs, iterator.orbe, ch4.nocc(), nvirt)
     self.assertAlmostEqual(emp2, -0.166640105042, 5)
예제 #4
0
 def test_LiH(self):
     bfs = basisset(lih,'cc-pvdz')
     hamiltonian=rhf(bfs, twoe_factory=libint_twoe_integrals)
     iterator = SCFIterator(hamiltonian)
     iterator.converge()
     self.assertTrue(iterator.converged)
     nvirt = len(bfs)-lih.nocc()
     emp2 = mp2(hamiltonian, iterator.orbs, iterator.orbe, lih.nocc(), nvirt)
     self.assertAlmostEqual(emp2, -0.023948620832, 5)
예제 #5
0
 def test_h2(self):
     bfs = basisset(h2, '6-31g**')
     solver = rhf(h2, bfs)
     solver.converge()
     nvirt = len(bfs) - h2.nocc()
     emp2 = mp2(solver.i2, solver.orbs, solver.orbe, h2.nocc(),
                len(bfs) - h2.nocc())
     self.assertAlmostEqual(emp2, -0.02632654197486595)
     return
예제 #6
0
 def test_HBr(self):
     HBr = read_xyz('./molfiles/HBr.xyz')
     bfs = basisset(HBr,'cc-pvdz')
     hamiltonian=rhf(bfs, twoe_factory=libint_twoe_integrals)
     iterator = SCFIterator(hamiltonian)
     iterator.converge()
     self.assertTrue(iterator.converged)
     nvirt = len(bfs)-HBr.nocc()
     emp2 = mp2(hamiltonian, iterator.orbs, iterator.orbe, HBr.nocc(), nvirt)
     self.assertAlmostEqual(emp2, -0.153284373119, 6)
예제 #7
0
 def test_N8(self):
     # 2.8 Gb memory needed
     N8 = read_xyz('./molfiles/N8.xyz')
     bfs = basisset(N8,'cc-pvdz')
     hamiltonian=rhf(bfs, twoe_factory=libint_twoe_integrals)
     iterator = SCFIterator(hamiltonian)
     iterator.converge()
     self.assertTrue(iterator.converged)
     nvirt = len(bfs)-N8.nocc()
     emp2 = mp2(hamiltonian, iterator.orbs, iterator.orbe, N8.nocc(), nvirt)
     self.assertAlmostEqual(emp2, -1.328348475507, 6)