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
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)
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)
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)
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
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)
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)