espressomd / espresso

The ESPResSo package
https://espressomd.org
GNU General Public License v3.0
222 stars 183 forks source link

Implement a Metatensor adaptor #4933

Open jngrad opened 3 weeks ago

jngrad commented 3 weeks ago

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 leverages pint 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

See https://github.com/lammps/lammps/pull/4163 for how Metatensor is being integrated into LAMMPS.

Luthaf commented 3 weeks 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!

jhossbach commented 1 week ago

I will start working on it.