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:
PropCalcClass to manage molecular dynamics simulations using LAMMPS.
Deprecated since version Use:
MDCalcwithMATCALC_BACKEND=LAMMPS.LAMMPSMDCalcneeds 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
gnnptypematgl; other names are passed through as lower-casedgnnptypes.
- taut, taup
Thermo/barostat time constants (ps).
- infile, trajfile, logfile
LAMMPS IO paths.
- fmax, optimizer
Relaxation settings.
- set_com_stationary, set_zero_rotation
Remove initial linear and angular momentum.
Initialize LAMMPSMDCalc with simulation parameters.
- 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.dataalready exist there, e.g. fromwrite_inputswith a customscript_template, they are run as is andstructureis 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:
LammpsRunwith inputs written to the selected directory.