MD_openmm

mlptrain.sampling.md_openmm.run_mlp_md_openmm(configuration: mlt.Configuration, mlp: MACE, temp: float, dt: float, interval: int, init_temp: float | None = None, fbond_energy: dict | None = None, bbond_energy: dict | None = None, bias: 'mlt.Bias' | 'mlt.PlumedBias' | None = None, restart_files: List[str] | None = None, copied_substrings: Sequence[str] | None = None, kept_substrings: Sequence[str] | None = None, platform: str | None = None, **kwargs) mlt.Trajectory

Run molecular dynamics on a system using a MLP to predict energies and forces and OpenMM to drive dynamics. The function is executed in a temporary directory.

Parameters:
  • mlp – Machine learnt potential

  • temp – Temperature in K to initialise velocities and to run NVT MD, if temp=0 then will run NVE

  • init_temp – (float | None) Initial temperature to initialise momenta with. If None then will be set to temp

  • dt – (float) Time-step in fs

  • interval – (int) Interval between saving the geometry

  • bbond_energy – (dict | None) Additional energy to add to a breaking bond. e.g. bbond_energy={(0, 1), 0.1} Adds 0.1 eV to the ‘bond’ between atoms 0 and 1 as velocities shared between the atoms in the breaking bond direction

  • fbond_energy – (dict | None) As bbond_energy but in the direction to form a bond

  • bias – (mlt.Bias | mltr.PlumedBias) mlp-train constrain to use in the dynamics

  • restart_files – List of files which are needed for restarting the simulation, e.g. ‘simulation.state.xml’, ‘trajectory.traj’

  • kept_substrings – List of substrings with which files are copied back from the temporary directory e.g. ‘.json’, ‘trajectory_1.traj’

  • copied_substrings – List of substrings with which files are copied to the temporary directory. Files required for MLPs are added to the list automatically

  • platform – (str) OpenMM platform to use. If None, the fastest available platform is used in this order: ‘CUDA’, ‘OpenCL’, ‘CPU’, ‘Reference’.

Keyword Arguments:
  • constraints – (List) List of ASE constraints to use in the dynamics e.g. [ase.constraints.Hookean(a1, a2, k, rt)]

  • write_plumed_setup – (bool) If True saves the PLUMED input file as plumed_setup.dat

Return type:

(mlt.Trajectory)