Open jngrad opened 5 months ago
Metatensor expects distances, forces and energies in standard SI units.
Not quite, but it does have to be one of the named units in there if you want metatensor to perform unit conversion: https://docs.metatensor.org/latest/atomistic/reference/models/index.html#known-quantities-and-units.
If some unit are left unset, metatensor will just pass data as-is from engine to model and respectively (which might fail if the model is not trained to work with the same units as espresso).
The rest of the plan here looks good to me!
I will start working on it.
Where can we find a good example (trained) model to try this on?
Where can we find a good example (trained) model to try this on?
We have been using https://github.com/Luthaf/metatensor-lj-test/ to test the interface to other simulation engines. It can define a LJ model for a single atomic type and export the model in the metatensor format.
We are currently going through the Lammps integration. Collecting our questions here.
@Luthaf could you maybe help us with those, either here on the issue, or in a video call? Many thanks!
Hey! I'm currently on vacation, but I'm happy to answer all your questions when I'm back. I should have some time the week of the 12th of August for a video chat!
I'm back and available for a chat about this, let me know when it is convenient for you!
Data flow
See Metatensor - Data flow
Metatensor expects distances, forces and energies in standard SI units. One has to set up the ESPResSo system such that e.g. the reduced unit is in Ångstroms, e.g.
box_l=[100, 100, 100]
means a box size of 100 Å. This can be achieved by designing a convenience function that leveragespint
to create an empty ESPResSo system with the correct size, time step and energy units.For domain decomposition: typically the ML model neighborhood radius is less than the interaction range. Thus we should be able to use metatensor in parallel without the need to tweak the ESPResSo domain decomposition and cell cutoff. One caveat: without LJ interaction the non-bonded cutoff will be zero, so we need to introduce a mechanism in the Metatensor plugin of the system call to adapt the
min_cutoff
cell system property.Contact persons from the ML side: @SamTov, @Luthaf, @PicoCentauri
Roadmap
std::vector<int> nbhood(System::System const &system, Utils::Vector3d const &pos, double dist)
to return a vector of particle distances (can be achieved withstd::ranges::transform
and aParticle
toVector3d
projector)autograd
feature to compute the force as the gradient of the energysystem.min_global_cut
testsuite/python
folderSee https://github.com/lammps/lammps/pull/4163 for how Metatensor is being integrated into LAMMPS.