def test_h2(self): bfs = basisset(h2,'sto-3g') hamiltonian = rhf(bfs) iterator = SCFIterator(hamiltonian) iterator.converge() self.assertTrue(iterator.converged) self.assertAlmostEqual(iterator.energy, -1.117099435262, 7)
def test_h2o(self): bfs = basisset(h2o,'sto-3g') hamiltonian = rhf(bfs) iterator = SCFIterator(hamiltonian) iterator.converge() self.assertTrue(iterator.converged) self.assertAlmostEqual(iterator.energy, -74.959857776754, 5)
def test_lih(self): bfs = basisset(lih,'sto-3g') hamiltonian = rhf(bfs) iterator = SCFIterator(hamiltonian) iterator.converge() self.assertTrue(iterator.converged) self.assertAlmostEqual(iterator.energy, -7.860746149768, 6)
def test_h2_631(self): bfs = basisset(h2,'6-31gss') hamiltonian = rhf(bfs) iterator = SCFIterator(hamiltonian) iterator.converge() self.assertTrue(iterator.converged) self.assertAlmostEqual(iterator.energy, -1.131333590574, 7)
def test_CH4(self): """CH4 symmetry Td""" bfs = basisset(ch4,'sto-3g') hamiltonian = rhf(bfs, twoe_factory=libint_twoe_integrals) iterator = SCFIterator(hamiltonian) iterator.converge() self.assertTrue(iterator.converged) self.assertAlmostEqual(iterator.energy, -39.726862723517, 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() eccsd = ccsd(hamiltonian, iterator.orbs, iterator.orbe, ch4.nocc(), nvirt) self.assertAlmostEqual(eccsd, -0.189626419684193, 7)
def test_B12(self): """B12 symmetry Ih""" B12 = read_xyz('./molfiles/B12.xyz') bfs = basisset(B12,'sto-3g') hamiltonian = rhf(bfs, twoe_factory=libint_twoe_integrals) iterator = SCFIterator(hamiltonian) iterator.converge() self.assertTrue(iterator.converged) self.assertAlmostEqual(iterator.energy, -290.579419642829, 0)
def test_N8(self): """N8""" 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) self.assertAlmostEqual(iterator.energy, -434.992755329296, 5)
def test_C8H8(self): """C8H8""" C8H8 = read_xyz('./molfiles/C8H8.xyz') bfs = basisset(C8H8,'sto-6g') hamiltonian = rhf(bfs, twoe_factory=libint_twoe_integrals) iterator = SCFIterator(hamiltonian) iterator.converge() self.assertTrue(iterator.converged) self.assertAlmostEqual(iterator.energy, -306.765545547300, 5)
def test_HBr(self): """HBr""" HBr = read_xyz('./molfiles/HBr.xyz') bfs = basisset(HBr,'sto-3g') hamiltonian = rhf(bfs, twoe_factory=libint_twoe_integrals) iterator = SCFIterator(hamiltonian) iterator.converge() self.assertTrue(iterator.converged) self.assertAlmostEqual(iterator.energy, -2545.887434128302, 4)
def test_BrF5(self): """BrF5 symmetry C4v""" BrF5 = read_xyz('./molfiles/BrF5.xyz') bfs = basisset(BrF5,'sto-3g') hamiltonian = rhf(bfs, twoe_factory=libint_twoe_integrals) iterator = SCFIterator(hamiltonian) iterator.converge() self.assertTrue(iterator.converged) self.assertAlmostEqual(iterator.energy, -3035.015731331871, 4)
def test_H2O_4(self): """H2O tethramer symmetry S4""" H2O4 = read_xyz('./molfiles/H2O_4.xyz') bfs = basisset(H2O4,'sto-3g') hamiltonian = rhf(bfs, twoe_factory=libint_twoe_integrals) iterator = SCFIterator(hamiltonian) iterator.converge() self.assertTrue(iterator.converged) self.assertAlmostEqual(iterator.energy, -299.909789863537, 5)
def test_C2H2Cl2(self): """C2H2Cl2 symmetry C2H""" C2H2Cl2 = read_xyz('./molfiles/C2H2Cl2.xyz') bfs = basisset(C2H2Cl2,'sto-3g') hamiltonian = rhf(bfs, twoe_factory=libint_twoe_integrals) iterator = SCFIterator(hamiltonian) iterator.converge() self.assertTrue(iterator.converged) self.assertAlmostEqual(iterator.energy, -967.533150337277, 4)
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() eccsd = ccsd(hamiltonian, iterator.orbs, iterator.orbe, h2.nocc(), nvirt) self.assertAlmostEqual(eccsd, -0.034544318453406, 8)
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_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() eccsd = ccsd(hamiltonian, iterator.orbs, iterator.orbe, lih.nocc(), nvirt) self.assertAlmostEqual(eccsd, -0.032399770519793, 7)
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_C24(self): # FAIL """C24 symmetry Th""" C24 = read_xyz('./molfiles/C24.xyz') bfs = basisset(C24,'sto-3g') hamiltonian = rhf(bfs, twoe_factory=libint_twoe_integrals) iterator = SCFIterator(hamiltonian) iterator.converge() self.assertTrue(iterator.converged) self.assertAlmostEqual(iterator.energy, -890.071915453874, 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)
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)
def test_h4(self): h4 = molecule([ (1, 0.00000000, 0.00000000, 0.36628549), (1, 0.00000000, 0.00000000, -0.36628549), (1, 0.00000000, 4.00000000, 0.36628549), (1, 0.00000000, 4.00000000, -0.36628549), ], units='Angstrom') bfs = basisset(h4,'sto-3g') hamiltonian = rhf(bfs) iterator = SCFIterator(hamiltonian) iterator.converge() self.assertTrue(iterator.converged) self.assertAlmostEqual(iterator.energy, -2.234185358600, 7)