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.

calculator[source]

Universal model name string (resolved for MatGL potentials).

temperature[source]

Target temperature (K).

ensemble[source]

Thermostat/barostat choice.

timestep[source]

MD timestep (ps).

steps[source]

Total MD steps.

pressure[source]

Target pressure for NPT (bar).

taut, taup

Thermo/barostat time constants (ps).

infile, trajfile, logfile

LAMMPS IO paths.

loginterval[source]

Thermo output stride.

relax_structure[source]

Pre-MD RelaxCalc when True.

fmax, optimizer

Relaxation settings.

frames[source]

Number of trailing trajectory frames to return.

settings[source]

Extra template placeholders for LammpsRun.

relax_calc_kwargs[source]

Kwargs for pre-MD RelaxCalc.

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('/home/runner/work/matcalc/matcalc/src/matcalc/lammps_templates/md.template')) LammpsRun[source]

Write LAMMPS input files based on a given structure.

Parameters:
  • structure – Structure, atoms, or dict accepted by PropCalc.calc.

  • script_template – Path or string content of the LAMMPS script template.

Returns:

LammpsRun with inputs written to the current working directory.