qrunch.tools.minimizers.reminimization_stopping_criteria.reminimization_stopping_criteria_creator

Creator for all our reminimization stopping criteria.

Classes

ReminimizationStoppingCriteriaSubCreator

Sub-creator for choosing a criterion deciding whether further periodic re-minimizations should be disabled.

class ReminimizationStoppingCriteriaSubCreator

Bases: Generic[T]

Sub-creator for choosing a criterion deciding whether further periodic re-minimizations should be disabled.

__init__(parent: T, field: str) → None

Initialize with parent and field.

Parameters:
  • parent (T)

  • field (str)

Return type:

None

minimum_improvement_stopping_criterion(minimum_improvement: float = 0.0001, patience: int = 1) → T

Stop periodic re-minimization when its energy reduction falls below minimum_improvement.

The reduction of a re-minimization is the energy found by the standard minimizer minus the energy after the re-minimizer, both from the same adaptive iteration. Re-minimization is stopped once each of the latest patience re-minimizations reduced the energy by less than minimum_improvement.

Parameters:
  • minimum_improvement (float) – Smallest energy decrease from a re-minimization for which re-minimization is still considered worthwhile. Must be non-negative. (default=1e-4)

  • patience (int) – Number of consecutive re-minimizations that must fall below minimum_improvement before re-minimization is stopped. Must be positive. (default=1)

Return type:

T

number_of_reminimizations_stopping_criterion(number_of_reminimizations: int) → T

Stop once number_of_reminimizations re-minimizations have been performed in the current adaptive run.

Parameters:

number_of_reminimizations (int) – Number of periodic re-minimizations to perform before disabling them. Must be positive.

Return type:

T