From 8d03a6a696d49fa110554ecd832f372fff5f372b Mon Sep 17 00:00:00 2001 From: Qiming Sun Date: Fri, 6 Dec 2024 08:12:09 -0800 Subject: [PATCH] Update tests --- pyscf/qmmm/test/test_itrf.py | 2 +- pyscf/scf/dhf.py | 3 +++ pyscf/scf/test/test_addons.py | 2 +- pyscf/scf/test/test_rhf.py | 3 ++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pyscf/qmmm/test/test_itrf.py b/pyscf/qmmm/test/test_itrf.py index 34c7e7da20..d84a3108f7 100644 --- a/pyscf/qmmm/test/test_itrf.py +++ b/pyscf/qmmm/test/test_itrf.py @@ -109,7 +109,7 @@ def test_casci(self): mf = scf.RHF(mol).run(conv_tol=1e-10) mc = itrf.add_mm_charges(mcscf.CASCI(mf, 4, 4), coords, charges).run() - self.assertAlmostEqual(mc.e_tot, -75.98156095286714, 8) + self.assertAlmostEqual(mc.e_tot, -75.98156095286714, 7) def test_casscf(self): mol = gto.Mole() diff --git a/pyscf/scf/dhf.py b/pyscf/scf/dhf.py index a9216e81ef..7a9ced7eed 100644 --- a/pyscf/scf/dhf.py +++ b/pyscf/scf/dhf.py @@ -740,6 +740,9 @@ def x2c1e(self): from pyscf.x2c import x2c x2chf = x2c.UHF(self.mol) x2chf.__dict__.update(self.__dict__) + x2chf.mo_energy = None + x2chf.mo_coeff = None + x2chf.mo_occ = None return x2chf x2c = x2c1e diff --git a/pyscf/scf/test/test_addons.py b/pyscf/scf/test/test_addons.py index 62e440f842..2eed1872e2 100644 --- a/pyscf/scf/test/test_addons.py +++ b/pyscf/scf/test/test_addons.py @@ -276,7 +276,7 @@ def test_dynamic_level_shift(self): mf.max_cycle = 2 mf.diis = False mf.kernel() - self.assertAlmostEqual(mf.scf(), -71.6072956194109, 5) + self.assertAlmostEqual(mf.e_tot, -71.6072956194109, 5) def test_convert_to_scf(self): from pyscf.x2c import x2c diff --git a/pyscf/scf/test/test_rhf.py b/pyscf/scf/test/test_rhf.py index 514f90dcb9..2334cdd248 100644 --- a/pyscf/scf/test/test_rhf.py +++ b/pyscf/scf/test/test_rhf.py @@ -302,6 +302,7 @@ def test_input_diis(self): mf1.max_cycle = 4 eref = mf1.kernel() + mf1 = scf.RHF(mol) mf1.diis = adiis mf1.max_cycle = 1 e1 = mf1.kernel() @@ -808,7 +809,7 @@ def test_uniq_var(self): self.assertAlmostEqual(abs(f1 + f1.T).max(), 0, 12) def test_check_convergence(self): - mf1 = n2mf.copy() + mf1 = scf.RHF(n2sym) mf1.diis = False count = [0] def check_convergence(envs):