CompPhysVienna / n2p2

n2p2 - A Neural Network Potential Package
https://compphysvienna.github.io/n2p2/
GNU General Public License v3.0
217 stars 82 forks source link

Is N2P2 capable to predict long range interactions? #122

Closed Matheus-Novoa closed 2 years ago

Matheus-Novoa commented 3 years ago

I would like to know if N2P2 is able to predict long range interactions. I plan to build a ML potential that predicts interactions in metal oxide slabs like ZnO2.

moabe84 commented 3 years ago

As far as I know, N2P2 is not able to predict the long range interactions. However, you can try Runner developed by Jörg Behler for the potential training and N2P2/Lammps interface for performing MD simulations.

https://www.uni-goettingen.de/de/560580.html

singraber commented 2 years ago

Long-range interactions of the type "4G-HDNNP" (see https://www.nature.com/articles/s41467-020-20427-2) are currently under development in n2p2. There are to pull requests open which are already quite mature: #107 deals with 4G-HDNNP training in n2p2 whereas #77 is about prediction with n2p2 tools (nnp-predict) and integration in LAMMPS. Last time I checked the nnp-predict tool was already compatible with RuNNer output. Training with nnp-train and the LAMMPS interface are still work in progress.

moabe84 commented 2 years ago

Is it going to happen in near future? I am working on a project and inclusion of the long range interactions is required to increase the reliability of results. Thanks.

Mostafa

singraber commented 2 years ago

Well, it depends on what you define as near future.. as far as I know the training part can be finished rather soon (maybe in next 1-2 months). The LAMMPS integration requires still more work since parallelization is not trivial with the global charge equilibration. I would estimate that there is a working version around end of this year. However, I am only assisting in the development, the main developers of the 4G-HDNNP are @emirkocer (LAMMPS) and @philippmisof (n2p2 prediction and training).

philippmisof commented 2 years ago

As @singraber said I am currently implementing the long range interactions on the n2p2 side. nnp-predict should be working fine as far as I know, by that I mean it deliveres the same results as RuNNer for a periodic and a non-periodic system. Regarding nnp-train I included all of the new features and first examples seem to deliver reasonable results but I am still eradicating a few bugs and looking for performance bottlenecks (although computation time already seems to be descent). I am planning on getting the recent implementation ready for production during the next month. Regarding the LAMMPS integration I do not have enough insights to estimate the progress.

moabe84 commented 2 years ago

That is great. By the near future, I was actually referring to 2-3 months. I am now wondering about the LAMMPS integration. I have seen a few papers from Behler that they included the long-range electrostatic interactions in the nnp training and I thought if I use RuNNer for the training I would be able to use N2P2/Lammps interface for the MLMD simulations. But it seems it's not true. I am greatly looking forward to using this feature in n2p2. I greatly appreciate your great work. Thanks.

omaraek commented 2 years ago

Dear @philippmisof,

I see here that you were capable of using an old RuNNer potential with the n2p2 package. I would like to ask you how did you mange to reshape the the scaling.data and weights.??.data files form the RuNNer format to n2p2 format? Is there any tool available to this transformation safely?

Also, I would like to ask you how did you face the fact that in RuNNer the cutoff_type was not mandatory while in n2p2 it is?

example from the weights.??.data that I have: 0.7687375104 5.7056093262 -4.5217175115 1.0616692096 4.5810339440

while what n2p2 wants: ################################################## 1 2 3 4 5 6 7 connection t index l_s n_s l_e n_e ################################################## -6.2446602207005186E-01 a 1 0 1 1 1 7.9109168478070069E-01 a 2 0 1 1 2 5.0258947941284748E-01 a 3 0 1 1 3 5.5154910097820120E-01 a 4 0 1 1 4 1.4505158314343458E+00 a 5 0 1 1 5

example from the scaling.data that I have: 1 1 0.000000000 9.650448658 2.976205229 1 2 0.000000000 7.281561717 3.278659279 1 3 0.000000000 7.368214687 1.927503271 1 4 0.000000000 5.162462777 2.214860272 1 5 0.000000000 4.368753732 0.841284349

while what n2p2 wants: ######################################################################################################################### 1 2 3 4 5 6 e_index sf_index sf_min sf_max sf_mean sf_sigma ######################################################################################################################### 1 1 9.1739161189824411E-08 7.0593095050533450E-01 2.2372649929284196E-02 9.6379208796011293E-02 1 2 2.6433999906765265E-01 2.4749666370750676E+00 1.0378805142792313E+00 1.9413782463770093E-01 1 3 1.5504686427401054E-05 1.4168627312588329E+00 5.5254915214857578E-02 2.1495058826125538E-01 1 4 1.4086411910634238E+00 4.7388215758712082E+00 3.1031877925923803E+00 3.5864448236496921E-01 1 5 9.8043626772015909E-04 1.9535901883323099E+00 1.1429456309160095E-01 2.2901461288065855E-01

Thanks in advance. Best regards, Omar

philippmisof commented 2 years ago

Since your question isn't related to this issue I opened a new issue for you: #143. I kindly ask you to do this yourself in the future. In the new issue you will find my suggested solution to your problem. Best, Philipp