pytc.solver.bug_core.check_stop

pytc.solver.bug_core.check_stop(step, scale, valid, e_hist, tol, *, conv, amplitude_tol=None)[source]

The stop rule of every BUG solver; returns the reason, or None to go on.

step is ||T' - T|| (for CCSD also + ||t1' - t1||), scale the matching amplitude norm, and valid is False when the step came from a roundoff-negative Gram difference. The run stops on step < conv ('amplitude-step') or on the energy settling below tol over three iterations ('energy-plateau'); amplitude_tol, when given, additionally requires step < amplitude_tol * scale for either route.

Parameters:
  • step (float)

  • scale (float)

  • valid (bool)

  • tol (float)

  • conv (float)

  • amplitude_tol (float | None)