xnn.common.deploy.lammps#
Export a trained model to TorchScript for LAMMPS.
LAMMPS coupling follows the established pattern used by pair_nequip / pair_mace
/ pair_allegro: the trained model is serialized with torch.jit.script and a
C++ pair style loads it and feeds it the local neighbor list each timestep.
LAMMPSWrapper exposes a forward whose inputs mirror what such a pair style
provides – positions, edge list, integer shifts, atom types and the cell – and
returns total energy, per-atom energy and forces. Pair the produced .pt file
with the matching C++ pair style for your model family.
Functions
|
Script the model and save a |
|
Generic TorchScript export (e.g. for custom C++/Python serving). |
Classes
|
TorchScript-friendly bridge between LAMMPS tensors and the model. |