generate_force_convergence_fn

torch_sim.runners.generate_force_convergence_fn(force_tol=1e-1, *, include_cell_forces=True)[source]

Generate a force-based convergence function for the convergence_fn argument of the optimize function.

Parameters:
  • force_tol (float) – Force tolerance for convergence

  • include_cell_forces (bool) – Whether to include the cell_forces in the convergence check. Defaults to True.

Returns:

Convergence function that takes a state and last energy and returns a batchwise boolean function

Return type:

Callable