Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversion of model.json #433

Open
tavanfran opened this issue Jan 30, 2024 · 2 comments
Open

Conversion of model.json #433

tavanfran opened this issue Jan 30, 2024 · 2 comments

Comments

@tavanfran
Copy link

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

@agoscinski
Copy link
Contributor

agoscinski commented Jan 31, 2024

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.

@bananenpampe
Copy link

bananenpampe commented Jan 31, 2024

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants