GROMACS (NNPot)¶
Status: not currently supported.
GROMACS 2025.0 introduced the NNPot interface, which loads a TorchScript .pt file via the nnpot-modelfile mdp option for QM-region energies and forces in QM/MM simulations. The 2026 series expanded model compatibility.
AIMNet2 cannot currently produce a .pt that the NNPot interface accepts. The reasons are upstream-internal, not a packaging gap:
- The shipped v2
.ptassets inaimnet/calculators/assets/aretorch.savestate-dict archives, not TorchScript archives. They are loaded into a Pythonnn.Modulebyaimnet.models.base.load_model. torch.jit.scripton the in-memoryAIMNet2model fails inaimnet/nbops.py-- the code usestensor.data_ptr()as a neighbor-cache key, which TorchScript rejects.torch.jit.scripton the externalDFTD3module fails because its custom autograd uses anaten::gradsignature TorchScript cannot resolve.- The published
aimnet2(wb97m-d3) model needs both external Coulomb and external D3 added on top of the core, so even if the core scripted, the wrapper would have to bundle all three pieces to matchAIMNet2Calculatorenergies.
Tracking¶
A starter wrapper is parked at aimnet/interfaces/gromacs.py -- the forward signature, unit conversions (nm -> A on input; eV -> kJ/mol on output), and pure-PyTorch all-pairs neighbor list have been verified to torch.jit.script cleanly with a dummy inner model and to round-trip via jit.save / jit.load. It will become functional once the blockers above are resolved.
The remediation plan lives at docs/superpowers/plans/2026-04-26-torchscript-export.md.
What works today instead¶
For QM/MM-style workflows that do not require GROMACS specifically:
AIMNet2ASE+ ASE's MD drivers (Langevin, NVT, NVE) for pure ML trajectories, with pysisyphus for path following.- OpenMM via openmm-ml -- pip-installable, runs the AIMNet2 calculator behind
openmm.PythonForce(no TorchScript needed); supports periodic systems andcreateMixedSystemfor QM/MM. - AMBER via torchani-amber -- compiled-in C++/Fortran integration for
sanderandpmemd; supports both full-ML and ML/MM modes via the&extpotand&qmmmmdin namelists.
A future GROMACS wrapper must include AIMNet2's D3 dispersion (the embedded D3 in the wb97m-d3 model is part of the published level of theory). A no-dispersion shortcut would silently shift conformer rankings, intermolecular binding, and torsion barriers by 1-10 kcal/mol vs the published numbers.