diff --git a/pyscf/scf/dispersion.py b/pyscf/scf/dispersion.py index 45e5b05351..6bc02bb2a9 100644 --- a/pyscf/scf/dispersion.py +++ b/pyscf/scf/dispersion.py @@ -176,7 +176,3 @@ def get_dispersion(mf, disp=None, with_3body=None, verbose=None): return e_d4 else: raise RuntimeError(f'dispersion correction: {disp_version} is not supported.') - -# Inject to SCF class -scf.hf.SCF.do_disp = check_disp -scf.hf.SCF.get_dispersion = get_dispersion diff --git a/pyscf/scf/hf.py b/pyscf/scf/hf.py index 074ce1736b..fdc0dc99c3 100644 --- a/pyscf/scf/hf.py +++ b/pyscf/scf/hf.py @@ -33,6 +33,7 @@ from pyscf.scf import diis from pyscf.scf import _vhf from pyscf.scf import chkfile +from pyscf.scf import dispersion from pyscf.data import nist from pyscf import __config__ @@ -1875,6 +1876,9 @@ def get_init_guess(self, mol=None, key='minao', **kwargs): energy_elec = energy_elec energy_tot = energy_tot + do_disp = dispersion.check_disp + get_dispersion = dispersion.get_dispersion + def energy_nuc(self): return self.mol.enuc