|
| 1 | +"""Known reference energy tests for DH functionals. |
| 2 | +""" |
| 3 | + |
| 4 | +import unittest |
| 5 | +from pyscf import gto |
| 6 | +from pyscf.dh import DFDH |
| 7 | + |
| 8 | + |
| 9 | +class TestKnownEnergy(unittest.TestCase): |
| 10 | + |
| 11 | + def test_DSD_PBEPBE_D3BJ(self): |
| 12 | + ref = -76.20415120 # QChem 5.1.1 |
| 13 | + mol = gto.M(atom="O; H 1 0.94; H 1 0.94 2 104.5", basis="6-31G").build() |
| 14 | + mf = DFDH(mol, xc="DSD-PBEPBE-D3BJ").run() |
| 15 | + self.assertAlmostEqual(mf.e_tot, ref, places=4) |
| 16 | + |
| 17 | + def test_DSD_PBEB95_D3BJ(self): |
| 18 | + ref = -76.22012321 # QChem 5.1.1 |
| 19 | + mol = gto.M(atom="O; H 1 0.94; H 1 0.94 2 104.5", basis="6-31G").build() |
| 20 | + mf = DFDH(mol, xc="DSD-PBEB95-D3BJ").run() |
| 21 | + self.assertAlmostEqual(mf.e_tot, ref, places=4) |
| 22 | + |
| 23 | + def test_wB2PLYP(self): |
| 24 | + ref = -76.223828450855 # ORCA 5.0.4 |
| 25 | + mol = gto.M(atom="O; H 1 0.94; H 1 0.94 2 104.5", basis="6-31G").build() |
| 26 | + mf = DFDH(mol, xc="wB2PLYP").run() |
| 27 | + self.assertAlmostEqual(mf.e_tot, ref, places=4) |
| 28 | + |
| 29 | + def test_wB2GPPLYP(self): |
| 30 | + ref = -76.216969239009 # ORCA 5.0.4 |
| 31 | + mol = gto.M(atom="O; H 1 0.94; H 1 0.94 2 104.5", basis="6-31G").build() |
| 32 | + mf = DFDH(mol, xc="wB2GPPLYP").run() |
| 33 | + self.assertAlmostEqual(mf.e_tot, ref, places=4) |
| 34 | + |
| 35 | + def test_wB88PP86(self): |
| 36 | + ref = -76.223203247789 # ORCA 5.0.4 |
| 37 | + mol = gto.M(atom="O; H 1 0.94; H 1 0.94 2 104.5", basis="6-31G").build() |
| 38 | + mf = DFDH(mol, xc="wB88PP86").run() |
| 39 | + self.assertAlmostEqual(mf.e_tot, ref, places=4) |
| 40 | + |
| 41 | + def test_wPBEPP86(self): |
| 42 | + ref = -76.261632401477 # ORCA 5.0.4 |
| 43 | + mol = gto.M(atom="O; H 1 0.94; H 1 0.94 2 104.5", basis="6-31G").build() |
| 44 | + mf = DFDH(mol, xc="wPBEPP86").run() |
| 45 | + self.assertAlmostEqual(mf.e_tot, ref, places=4) |
| 46 | + |
| 47 | + def test_RSX_0DH(self): |
| 48 | + ref = -76.223451307545 # ORCA 5.0.4 |
| 49 | + mol = gto.M(atom="O; H 1 0.94; H 1 0.94 2 104.5", basis="6-31G").build() |
| 50 | + mf = DFDH(mol, xc="RSX-0DH").run() |
| 51 | + self.assertAlmostEqual(mf.e_tot, ref, places=4) |
| 52 | + |
| 53 | + def test_RSX_QIDH(self): |
| 54 | + ref = -76.208221215310 # ORCA 5.0.4 |
| 55 | + mol = gto.M(atom="O; H 1 0.94; H 1 0.94 2 104.5", basis="6-31G").build() |
| 56 | + mf = DFDH(mol, xc="RSX-QIDH").run() |
| 57 | + self.assertAlmostEqual(mf.e_tot, ref, places=4) |
| 58 | + |
| 59 | + def test_PTPSS(self): |
| 60 | + ref = -76.28365901 # QChem 5.1.1 |
| 61 | + mol = gto.M(atom="O; H 1 0.94; H 1 0.94 2 104.5", basis="6-31G").build() |
| 62 | + mf = DFDH(mol, xc="PTPSS").run() |
| 63 | + self.assertAlmostEqual(mf.e_tot, ref, places=4) |
| 64 | + |
| 65 | + def test_PWPB95(self): |
| 66 | + ref = -76.30404653 # QChem 5.1.1 |
| 67 | + mol = gto.M(atom="O; H 1 0.94; H 1 0.94 2 104.5", basis="6-31G").build() |
| 68 | + mf = DFDH(mol, xc="PWPB95").run() |
| 69 | + self.assertAlmostEqual(mf.e_tot, ref, places=4) |
| 70 | + |
| 71 | + @unittest.skip('customized RSH support') |
| 72 | + def test_wB97X_2_TQZ(self): |
| 73 | + ref = -76.24074263 # QChem 5.1.1 |
| 74 | + mol = gto.M(atom="O; H 1 0.94; H 1 0.94 2 104.5", basis="6-31G").build() |
| 75 | + mf = DFDH(mol, xc="wB97X-2-TQZ").run() |
| 76 | + self.assertAlmostEqual(mf.e_tot, ref, places=4) |
| 77 | + |
| 78 | + @unittest.skip('customized RSH support') |
| 79 | + def test_wB97X_2_LP(self): |
| 80 | + ref = -76.28031455 # QChem 5.1.1 |
| 81 | + mol = gto.M(atom="O; H 1 0.94; H 1 0.94 2 104.5", basis="6-31G").build() |
| 82 | + mf = DFDH(mol, xc="wB97X-2-LP").run() |
| 83 | + self.assertAlmostEqual(mf.e_tot, ref, places=4) |
0 commit comments