Skip to content

Conversation

@vir-k01
Copy link

@vir-k01 vir-k01 commented Apr 22, 2025

Summary

This is an effort that picks up from #173 to incorporate workflows to run LAMMPS in atomate2. Quite a bit of the initial code was taken from the atomate2-lammps add-on (here) written by @ml-evs and @gbrunin. The input set generator and templates have been moved to pymatgen.io.lammps, and a concurrent PR has been opened to integrate those into pymatgen. Also tagging in @esoteric-ephemera who helped structure some of the code here, and @davidwaroquiers for their interest in this PR.

  • Function to call lammps based on settings provided in the atomate2.yaml config file, including running in parallel with mpi.
  • Base Maker that generates inputs, runs lammps, and parses the outputs into a LAMMPS TaskDoc.
  • Implemented sets and makers for common MD simulations: NVE/NVT/NPT, and a job to perform geometry minimization under an applied pressure.
  • Implemented a flow to melt, then quench, then thermalize a structure, suitable for creating liquids/glasses/general phase transformations.
  • Wrote a convertor to parse lammps dump files into ase/pymatgen trajectories (might have to tweak this to match how other workflows do this step)
  • Implemented a CustomLammpsMaker that takes in a user written input file (for jobs that aren't a combination of NVT/NPT steps or more complicated lammps simulation) and user specified settings. This maker a port of the lammps implementation in atomate, and I expect this Maker to be the most used by existing LAMMPS users.
  • Added mock_lammps and basic tests for the sets, jobs and schemas.
  • Added a notebook under tutorials for how to set-up and use the makers.

TODO

  • These flows are primarily designed around solids (interfaced through the pymatgen Structure) with forcefields that rely on pair_styles (including MLIPs), and as such all design decisions, units, default values and validation checks are tuned for solids. I'm open to suggestions on how the current implementation can be extended to molecules. (Any changes in this regard will have to make changes to the pymatgen PR as well).
  • Dump files (in their entirety) are presently stored as strings in the job store, and are parsed and additionally stored as either an ASE/pymatgen trajectory if specified by the user. This is done to avoid parsing/storing exceedingly large dump files as the heavier trajectory objects, however, it could very well be possible that storing the files as strings also becomes prohibitively expensive (for large classical MD simulations). Any suggestions on how to deal with such problems are appreciated!
  • I haven't tested these flows with kokkos/gpu or the other lammps add-ons yet.

vir-k01 and others added 30 commits October 24, 2024 16:54
…cture, copied over all the work done on atomate2-lammps (by @ml-evs and @gbrunin at Matgenix). The basic functions have been implemented, the actual tasks to be done are generating the right input sets for a wide range of lammps calculations that can be done, and to write a task doc that can handle the outputs of these calculations. Will update the run.py once I get it to work with a complied version of lammps for a simple test case.
… are probably better expressed in the LAMMPS_CMD, which is specified through the environment's atomate2.yaml file.
…rs from pmg, better handling of inputs to the makers. TODO: make init more readable, and allow for better management of how upstream generators call base set generator
… based on atomate2.ase.utils.TrajectoryObserver. Also accounted for reading in molecules and saving as a trajectory.
…s to json files for easier access, added utility funcs to process settings dicts
…ings to allow restart keyword to be provided in template
…and langevin/berendsen for now. Added nph as a thermostat too.
…for langevin, need for nve integrator for nvt/npt with non-nose-hoover
… take in TaskState and StoreTrajectoryOption objects from emmet for consistency
@JaGeo
Copy link
Member

JaGeo commented Oct 3, 2025

@vir-k01 Let us know once you have addressed @gpetretto 's comments. I am happy to help getting this merged as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants