ForceFieldMDMaker

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

Bases: AseMDMaker

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 .MolecularDynamics function through ase_md_kwargs.

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

  • force_field_name (str or .MLFF) – 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 (MDEnsemble = "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 .MolecularDynamics function

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

  • ionic_step_data (tuple[str,...] or None) – Quantities to store in the TaskDocument ionic_steps. Possible options are “struct_or_mol”, “energy”, “forces”, “stress”, and “magmoms”. “structure” and “molecule” are aliases for “struct_or_mol”.

  • store_trajectory (emmet .StoreTrajectoryOption = "partial") – Whether to store trajectory information (“no”) or complete trajectories (“partial” or “full”, which are identical).

  • tags (list[str] or None) – A list of tags for the task.

  • 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","xdatcar"]) – The format of the trajectory file to write. If “ase”, writes an ASE .Trajectory. If “pmg”, writes a Pymatgen .Trajectory. If “xdatcar, writes a VASP-style XDATCAR

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

  • mb_velocity_seed (int or 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 or None (deprecated)) – Options to pass to the TaskDoc.

  • verbose (bool)

make(structure, prev_dir=None)[source]

Perform MD on a structure using forcefields and jobflow.

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.