Skip to content

Commit

Permalink
Abandon ROHF gradients and ROHF hessian (pyscf#2259)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunqm authored Jun 18, 2024
1 parent afe5eb1 commit 4effd2b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pyscf/df/df_jk.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ def Hessian(self):
return uks.Hessian(self)
else:
return uhf.Hessian(self)
elif isinstance(self, scf.rohf.ROHF):
raise NotImplementedError
elif isinstance(self, scf.rhf.RHF):
if isinstance(self, scf.hf.KohnShamDFT):
return rks.Hessian(self)
Expand Down
1 change: 1 addition & 0 deletions pyscf/grad/rhf.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,3 +474,4 @@ def make_rdm1e(self, mo_energy=None, mo_coeff=None, mo_occ=None):
from pyscf import scf
# Inject to RHF class
scf.hf.RHF.Gradients = lib.class_as_method(Gradients)
scf.rohf.ROHF.Gradients = lib.invalid_method('Gradients')
1 change: 1 addition & 0 deletions pyscf/grad/rks.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,3 +622,4 @@ def extra_force(self, atom_id, envs):

from pyscf import dft
dft.rks.RKS.Gradients = dft.rks_symm.RKS.Gradients = lib.class_as_method(Gradients)
dft.roks.ROKS.Gradients = lib.invalid_method('Gradients')
1 change: 1 addition & 0 deletions pyscf/hessian/rhf.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ class Hessian(HessianBase):
# Inject to RHF class
from pyscf import scf
scf.hf.RHF.Hessian = lib.class_as_method(Hessian)
scf.rohf.ROHF.Hessian = lib.invalid_method('Hessian')


if __name__ == '__main__':
Expand Down
1 change: 1 addition & 0 deletions pyscf/hessian/rks.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,3 +593,4 @@ def __init__(self, mf):

from pyscf import dft
dft.rks.RKS.Hessian = dft.rks_symm.RKS.Hessian = lib.class_as_method(Hessian)
dft.roks.ROKS.Hessian = dft.rks_symm.ROKS.Hessian = lib.invalid_method('Hessian')

0 comments on commit 4effd2b

Please sign in to comment.