integrate

torch_sim.runners.integrate(system, model, *, integrator, n_steps, temperature, timestep, trajectory_reporter=None, autobatcher=False, pbar=False, init_kwargs=None, **integrator_kwargs)[source]

Simulate a system using a model and integrator.

Parameters:
  • system (StateLike) – Input system to simulate

  • model (ModelInterface) – Neural network model module

  • integrator (Integrator | tuple) – Either a key from Integrator or a tuple of (init_func, step_func) functions.

  • n_steps (int) – Number of integration steps. If resuming from a trajectory, this is the number of additional steps to run.

  • temperature (float | ArrayLike) – Temperature or array of temperatures for each step or system: Float: used for all steps and systems 1D array of length n_steps: used for each step 1D array of length n_systems: used for each system 2D array of shape (n_steps, n_systems): used for each step and system.

  • timestep (float) – Integration time step

  • trajectory_reporter (TrajectoryReporter | dict | None) – Optional reporter for tracking trajectory. If a dict, will be passed to the TrajectoryReporter constructor.

  • autobatcher (BinningAutoBatcher | bool) – Optional autobatcher to use

  • pbar (bool | dict[str, Any], optional) – Show a progress bar. Only works with an autobatcher in interactive shell. If a dict is given, it’s passed to tqdm as kwargs.

  • init_kwargs (dict[str, Any], optional) – Additional keyword arguments for integrator init function.

  • **integrator_kwargs – Additional keyword arguments for integrator init function

Returns:

Final state after integration

Return type:

T