matcalc._lammps module

Calculator for MD properties using LAMMPS (deprecated; use MDCalc with MATCALC_BACKEND=LAMMPS).

class LAMMPSMDCalc(calculator: str, *, temperature: float = 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 | None = None, equilibration_frames: int = 0, seed: int = 142857, set_com_stationary: bool = True, set_zero_rotation: bool = True, settings: dict | None = None, relax_calc_kwargs: dict | None = None)[source]

Bases: PropCalc

Class to manage molecular dynamics simulations using LAMMPS.

Deprecated since version Use: MDCalc with MATCALC_BACKEND=LAMMPS. LAMMPSMDCalc needs LAMMPS with the AdvanceSoft ML-GNNP package, which is no longer supported or tested, and will be removed in a future release.

calculator[source]

Registered model name or alias, raw MatGL model name, or local MatGL model directory. MatGL models are passed to LAMMPS as gnnp type matgl; other names are passed through as lower-cased gnnp types.

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]

Steps between saved frames and between thermo outputs.

relax_structure[source]

Pre-MD RelaxCalc when True.

fmax, optimizer

Relaxation settings.

frames[source]

Number of trailing trajectory frames to return, or None for all frames.

equilibration_frames[source]

Leading saved frames to discard before selecting trailing frames.

seed[source]

Positive integer seed for initial velocities.

set_com_stationary, set_zero_rotation

Remove initial linear and angular momentum.

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], *, directory: str | Path = '.') → dict[source]

Run MD and return the selected frames and the mean energies over the steps they span.

Parameters:
  • structure – Structure, ASE Atoms, or upstream result dict.

  • directory – Working directory for LAMMPS and its relative input/output paths. If the input script and md.data already exist there, e.g. from write_inputs with a custom script_template, they are run as is and structure is not written.

Returns:

Result dict including the selected trajectory and the mean thermo energies from its first to its last frame.

write_inputs(structure: Structure | Atoms | dict[str, Any], script_template: str | Path = PosixPath('/home/runner/work/matcalc/matcalc/src/matcalc/lammps_templates/md.template'), *, directory: str | Path = '.') → 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.

  • directory – Directory for input files and relative output paths.

Returns:

LammpsRun with inputs written to the selected directory.