librascal icon indicating copy to clipboard operation
librascal copied to clipboard

Conversion of model.json

Open tavanfran opened this issue 5 months ago • 2 comments

I generated an interatomic potential using librascal and I get a model.json file, which works with ASE. However, the MD simulations are very slow due to difficulties in ASE parallelization. I was wondering how I can convert a model.json into a potential readable by Lammps. I tried to build a tabulated potential for Lammps by taking a couple of atoms (i.e. Ge-Ge) and computing the energies and forces for all distances from 0 to 8 angstrom. This results in big issues in Lammps due to the lack of a repulsive potential at low distances. I attach a figure for the energy of Ge-Ge. Is there any other way to export the potential into another format that is readable from Lammps, Gromacs, DL_POLY...? Or, is there any way to save the interatomic potentials in another format? Schermata 2024-01-30 alle 09 10 51

tavanfran avatar Jan 30 '24 08:01 tavanfran

I was wondering how I can convert a model.json into a potential readable by Lammps.

It can be directly read if you install a lammps version with our interface. We have instructions how to use librascal with lammps in this repo https://github.com/lgigli/BTO-paper The repo is using it together with PLUMED to do metadynamics, but I hope you can extract the instructions and files concerning lammps from it. If you need any help let me know.

I tried to build a tabulated potential for Lammps by taking a couple of atoms (i.e. Ge-Ge) and computing the energies and forces for all distances from 0 to 8 angstrom. This results in big issues in Lammps due to the lack of a repulsive potential at low distances. I attach a figure for the energy of Ge-Ge.

Can you add a repulsive term in Lammps with the interface? I am not sure if people in our lab do this usually with i-PI or add it LAMMPS. I will ask.

Is there any other way to export the potential into another format that is readable from Lammps, Gromacs, DL_POLY...?

There is no support for any other MD engine than Lammps

This is all a prototype code, that is why the lammps + librascal installation is such a patchwork. But we used it already for several projects. We started to move in a new direction that exploits TorchScript as functionality to deploy models into low-level language MD engines. This is still in the work but should have something a ready to use in 1-2 month(s) https://github.com/lab-cosmo/metatensor-models maybe you want to keep an eye on it.

agoscinski avatar Jan 31 '24 18:01 agoscinski

Hello, regarding the lack of short range repulsion, this is probably related to the absence of training structures containing interatomic distances of Ge-Ge with such short distances. A former member of our lab, had written a tutorial on how to add short range repulsive-only, LAMMPS pair potentials to librascal: https://github.com/victorprincipe/pair_potentials , maybe it can be of help. (this requires running LAMMPS through i-pi however)

bananenpampe avatar Jan 31 '24 19:01 bananenpampe