Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sunqm committed Dec 6, 2024
1 parent 8e29fab commit 8d03a6a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyscf/qmmm/test/test_itrf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 3 additions & 0 deletions pyscf/scf/dhf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion pyscf/scf/test/test_addons.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion pyscf/scf/test/test_rhf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 8d03a6a

Please sign in to comment.