Skip to main content
This is a dummy implementation that tracks state but doesn’t actually stop the optimization (that’s handled by CallbackManager). The callback sets a _should_stop flag when patience is exceeded.

Parameters

str
required
Metric name to monitor (e.g., “system_energy”, “best_system_energy”).
int
required
Number of steps with no improvement before stopping. Ideally, this should be set as a multiple of the number of Minimizer steps necessary to mutate the entire sequence (for the largest State).
float
default:"0.0"
Minimum change in the monitored metric to be considered an improvement.
str
default:"'min'"
Whether lower (“min”) or higher (“max”) values are better.

Methods

on_optimization_start

Reset tracking state at the start of optimization. Parameters
CallbackContext
required

on_step_end

Check if monitored metric has improved and update tracking state. Parameters
CallbackContext
required

Example