User Tools

Site Tools


howto:allegro

This is an old revision of the document!


How to Train a neural network interatomic potential using Allegro and Perform Molecular Dynamics with CP2K

This Colab tutorial illustrates how to train an equivariant neural network interatomic potential for bulk water using the Allegro framework. You will learn how to train a model, deploy it in production, and run molecular dynamics simulations in CP2K. The training and inference will be carried out on the GPU provided by the Colab environment.

Allegro is designed for constructing highly accurate and scalable interatomic potentials for molecular dynamics simulations. The methodology is described in detail in this paper (10.1038/s41467-023-36329-y). An open-source package (https://github.com/mir-group/allegro) that implements Allegro, built on the nequip framework was developed by the Allegro and NequIP (https://github.com/mir-group/nequip) authors.

Inference in CP2K is performed through the MM package of CP2K, Fist. As an example, the relevant section for Allegro (or similarly for NequIP) is:

Allegro_si_MD.inp
      &ALLEGRO
        ATOMS Si
        PARM_FILE_NAME Allegro/si-deployed.pth
        UNIT_COORDS angstrom
        UNIT_ENERGY eV
        UNIT_FORCES eV*angstrom^-1
      &END ALLEGRO 
 

where the si-deployed.pth refers to the PyTorch model that was deployed using the Allegro framework, and the UNIT tags refer to the units of the coordinates, energy and forces of the model itself.

For additional references on NequIP, Allegro and equivariant neural networks (e3nn) see:

  1. NequIP/Allegro Tutorial on LAMMPS by the authors of the above papers, see Colab notebook here
  2. For an introduction to e3nn see here, 10.5281/zenodo.7430260
howto/allegro.1682344129.txt.gz · Last modified: 2023/04/24 13:48 by gtocci