ForceFieldMDMaker

class atomate2.forcefields.md.ForceFieldMDMaker(name='Forcefield MD', force_field_name='MLFF.Forcefield', time_step=None, n_steps=1000, ensemble='nvt', dynamics='langevin', temperature=300.0, pressure=None, ase_md_kwargs=None, calculator_kwargs=<factory>, traj_file=None, traj_file_fmt='ase', traj_interval=1, mb_velocity_seed=None, zero_linear_momentum=False, zero_angular_momentum=False, task_document_kwargs=<factory>)[source]

Bases: Maker

Perform MD with a force field.

Note the the following units are consistent with the VASP MD implementation: - temperature in Kelvin (TEBEG and TEEND) - time_step in femtoseconds (POTIM) - pressure in kB (PSTRESS)

The default dynamics is Langevin NVT consistent with VASP MD, with the friction coefficient set to 10 ps^-1 (LANGEVIN_GAMMA).

For the rest of preset dynamics (_valid_dynamics) and custom dynamics inherited from ASE (MolecularDynamics), the user can specify the dynamics as a string or an ASE class into the dynamics attribute. In this case, please consult the ASE documentation for the parameters and units to pass into the ASE MD function through ase_md_kwargs.

Parameters:
  • name (str) – The name of the MD Maker

  • force_field_name (str) – The name of the forcefield (for provenance)

  • time_step (float | None = None.) – The timestep of the MD run in fs. If None, defaults to 0.5 fs if a structure contains an isotope of hydrogen and 2 fs otherwise.

  • n_steps (int = 1000) – The number of MD steps to run

  • ensemble (str = "nvt") – The ensemble to use. Valid ensembles are nve, nvt, or npt

  • temperature (float | Sequence | np.ndarray | None.) – The temperature in Kelvin. If a sequence or 1D array, the temperature schedule will be interpolated linearly between the given values. If a float, the temperature will be constant throughout the run.

  • pressure (float | Sequence | None = None) – The pressure in kilobar. If a sequence or 1D array, the pressure schedule will be interpolated linearly between the given values. If a float, the pressure will be constant throughout the run.

  • dynamics (str | ASE .MolecularDynamics = "langevin") – The dynamical thermostat to use. If dynamics is an ASE .MolecularDynamics object, this uses the option specified explicitly by the user. See _valid_dynamics for a list of pre-defined options when specifying dynamics as a string.

  • ase_md_kwargs (dict | None = None) – Options except for temperature and pressure to pass into the ASE MD function

  • calculator_kwargs (dict) – kwargs to pass to the ASE calculator class

  • traj_file (str | Path | None = None) – If a str or Path, the name of the file to save the MD trajectory to. If None, the trajectory is not written to disk

  • traj_file_fmt (Literal["ase","pmg"]) – The format of the trajectory file to write. If “ase”, writes an ASE trajectory, if “pmg”, writes a Pymatgen trajectory.

  • traj_interval (int) – The step interval for saving the trajectories.

  • mb_velocity_seed (int | None = None) – If an int, a random number seed for generating initial velocities from a Maxwell-Boltzmann distribution.

  • zero_linear_momentum (bool = False) – Whether to initialize the atomic velocities with zero linear momentum

  • zero_angular_momentum (bool = False) – Whether to initialize the atomic velocities with zero angular momentum

  • task_document_kwargs (dict) –

    Options to pass to the TaskDoc. Default choice

    {“store_trajectory”: “partial”, “ionic_step_data”: (“energy”,),}

    is consistent with atomate2.vasp.md.MDMaker

make(structure, prev_dir=None)[source]

Perform MD on a structure using a force field.

Parameters:
  • structure (.Structure) – pymatgen structure.

  • prev_dir (str or Path or None) – A previous calculation directory to copy output files from. Unused, just added to match the method signature of other makers.

Return type:

ForceFieldTaskDocument

property calculator: Calculator

ASE calculator, can be overwritten by user.