md.Simulator
- class md.Simulator(*args: Any, **kwargs: Any)[source]
Main driver of the molecular dynamics simulation. Uses an integrator to propagate the molecular system defined in the system class according to the forces yielded by a provided calculator.
In addition, hooks can be applied at five different stages of each simulation step:
Start of the simulation (e.g. for initializing thermostat)
Before first integrator half step (e.g. thermostat)
After computation of the forces and before main integrator step (e.g.
for accelerated MD)
After second integrator half step (e.g. thermostat, output routines)
At the end of the simulation (e.g. general wrap up of file writes, etc.)
This routine has a state dict which can be used to restart a previous simulation.
- Parameters:
system (schnetpack.md.System) – Instance of the system class defined in molecular_dynamics.system holding the structures, masses, atom type, momenta, forces and properties of all molecules and their replicas
integrator (schnetpack.md.Integrator) – Integrator for propagating the molecular dynamics simulation, defined in schnetpack.md.integrators
calculator (schnetpack.md.calculator) – Calculator class used to compute molecular forces for propagation and (if requested) various other properties.
simulator_hooks (list(object)) – List of different hooks to be applied during simulations. Examples would be file loggers and thermostat.
step (int) – Index of the initial simulation step.
restart (bool) – Indicates, whether the simulation is restarted. E.g. if set to True, the simulator tries to continue logging in the previously created dataset. (default=False) This is set automatically by the restart_simulation function. Enabling it without the function currently only makes sense if independent simulations should be written to the same file.
progress (bool) – show progress bar during simulation. Can be deactivated e.g. for cluster runs.