Skip to content

Commit

Permalink
Add hcore for ecp
Browse files Browse the repository at this point in the history
  • Loading branch information
briling committed Apr 30, 2024
1 parent fc9c863 commit 3da58da
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions qstack/spahm/guesses.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,19 @@
import numpy
import scipy
import pyscf
import pyscf.dft
import pyscf.dft, pyscf.scf
from qstack.spahm.LB2020guess import LB2020guess as LB20

def hcore(mol, *_):
"""Uses the diagonalization of the core to compute the guess Hamiltonian.
"""Uses the core potential (kin + nuc + ecp) to compute the guess Hamiltonian.
Args:
mol (pyscf Mole): pyscf Mole object.
Returns:
A numpy ndarray containing the computed approximate Hamiltonian.
"""
h = mol.intor_symmetric('int1e_kin')
h += mol.intor_symmetric('int1e_nuc')
return h
return pyscf.scf.hf.get_hcore(mol)

def GWH(mol, *_):
"""Uses the generalized Wolfsberg-Helmholtz to compute the guess Hamiltonian.
Expand Down Expand Up @@ -51,7 +49,7 @@ def SAD(mol, func):
A numpy ndarray containing the computed approximate Hamiltonian.
"""
hc = hcore(mol)
dm = pyscf.scf.hf.init_guess_by_atom(mol)
dm = pyscf.scf.hf.init_guess_by_atom(mol)
mf = pyscf.dft.RKS(mol)
mf.xc = func
vhf = mf.get_veff(dm=dm)
Expand Down

0 comments on commit 3da58da

Please sign in to comment.