From e82507fe511ff789c8ceeb3490599c9dd238bfef Mon Sep 17 00:00:00 2001 From: Heejune Park Date: Thu, 21 Sep 2023 16:52:11 -0700 Subject: [PATCH] optimize.py modified to return converged status when Converge_maxiter provided --- geometric/optimize.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/geometric/optimize.py b/geometric/optimize.py index 94c2a119..60b37464 100644 --- a/geometric/optimize.py +++ b/geometric/optimize.py @@ -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: