Skip to content

Commit

Permalink
Improve hf.dispersion imports
Browse files Browse the repository at this point in the history
  • Loading branch information
sunqm committed Aug 9, 2024
1 parent e6b28d8 commit beda77d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 0 additions & 4 deletions pyscf/scf/dispersion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions pyscf/scf/hf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit beda77d

Please sign in to comment.