Skip to content

Commit

Permalink
add skipping SCF cycles (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
kvkarandashev authored Oct 29, 2024
1 parent 9380efc commit 933f4f3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gpu4pyscf/scf/hf.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,14 @@ def _kernel(mf, conv_tol=1e-10, conv_tol_grad=None,
logger.info(mf, 'init E= %.15g', e_tot)
t1 = log.timer_debug1('total prep', *t0)
scf_conv = False

# Skip SCF iterations. Compute only the total energy of the initial density
if mf.max_cycle <= 0:
fock = mf.get_fock(h1e, s1e, vhf, dm) # = h1e + vhf, no DIIS
mo_energy, mo_coeff = mf.eig(fock, s1e)
mo_occ = mf.get_occ(mo_energy, mo_coeff)
return scf_conv, e_tot, mo_energy, mo_coeff, mo_occ

if isinstance(mf.diis, lib.diis.DIIS):
mf_diis = mf.diis
elif mf.diis:
Expand Down

0 comments on commit 933f4f3

Please sign in to comment.