matcalc._lammps module

Calculator for MD properties using LAMMPS.

class LAMMPSMDCalc(calculator: str, *, temperature: int = 300, ensemble: Literal['nve', 'nvt', 'npt', 'nvt_nose_hoover', 'npt_nose_hoover'] = 'nvt', timestep: float = 0.001, steps: int = 100, pressure: float = 1, taut: float | None = None, taup: float | None = None, infile: str = 'in.md', trajfile: str = 'md.lammpstrj', logfile: str = 'log.lammps', loginterval: int = 1, relax_structure: bool = True, fmax: float = 0.1, optimizer: str = 'FIRE', frames: int = 10, settings: dict | None = None, relax_calc_kwargs: dict | None = None)[source]

Bases: PropCalc

Class to manage molecular dynamics simulations using LAMMPS.

Variables:
  • calculator – Name of the potential/calculator model.

  • temperature – Simulation temperature in Kelvin.

  • ensemble – Statistical ensemble for simulation.

  • timestep – Simulation timestep in picoseconds.

  • steps – Number of MD steps.

  • pressure – Simulation pressure in bars.

  • taut – Temperature coupling constant (ps).

  • taup – Pressure coupling constant (ps).

  • infile – File for Input.

  • trajfile – File for trajectory output.

  • logfile – Logfile path.

  • loginterval – Logging interval in steps.

  • relax_structure – Whether to perform initial structural relaxation.

  • fmax – Maximum force for relaxation convergence.

  • optimizer – Optimizer for structural relaxation.

  • frames – Number of frames saved from the trajectory.

  • settings – Settings for the template script.

  • relax_calc_kwargs – Additional kwargs for relaxation calculation.

Initialize LAMMPSMDCalc with simulation parameters.

_abc_impl = <_abc._abc_data object>[source]
_generate_fix_command() str[source]

Generate LAMMPS fix command based on the selected ensemble.

calc(structure: Structure | Atoms | dict[str, Any]) dict[source]

Run the MD calculation using LAMMPS.

write_inputs(structure: Structure | Atoms | dict[str, Any], script_template: str | Path = PosixPath('/Users/shyue/repos/matcalc/src/matcalc/lammps_templates/md.template')) LammpsRun[source]

Write LAMMPS input files based on a given structure.

Parameters:
  • structure (Structure | Atoms | dict[str, Any]) – Input pymatgen Structure or equivalent dictionary.

  • script_template (str | Path) – Template of the input script.

Returns:

Instance representing written LAMMPS inputs.

Return type:

LammpsRun