espressomd / espresso

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

Implement a Metatensor adaptor #4933

Open jngrad opened 5 months ago

jngrad commented 5 months 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 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!

jhossbach commented 5 months ago

I will start working on it.

RudolfWeeber commented 3 months ago

Where can we find a good example (trained) model to try this on?

Luthaf commented 3 months ago

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.

RudolfWeeber commented 3 months ago

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!

General

MetatensorSystemOptions

MetaTensorNeighborData

PairMetatensro

Provisoinal planning

Luthaf commented 3 months ago

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!

Luthaf commented 3 months ago

I'm back and available for a chat about this, let me know when it is convenient for you!