Skip to content

Commit

Permalink
optimize.py modified to return converged status when Converge_maxiter…
Browse files Browse the repository at this point in the history
… provided
  • Loading branch information
hjnpark committed Sep 21, 2023
1 parent 970e37e commit e82507f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions geometric/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -853,10 +853,14 @@ def reset_irc():
self.state = OPT_STATE.CONVERGED
return

if self.Iteration > params.maxiter:
if self.Iteration >= params.maxiter:
self.SortedEigenvalues(self.H)
logger.info("Maximum iterations reached (%i); increase --maxiter for more\n" % params.maxiter)
self.state = OPT_STATE.FAILED
if params.Converge_maxiter:
logger.info("Exiting normally because --converge maxiter was set.\n")
self.state = OPT_STATE.CONVERGED
else:
self.state = OPT_STATE.FAILED
return

if params.qccnv and Converged_grms and (Converged_drms or Converged_energy) and self.conSatisfied:
Expand Down

0 comments on commit e82507f

Please sign in to comment.