CompPhysVienna / n2p2

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

Free atom reference energies in Lammps interface #41

Closed moabe84 closed 4 years ago

moabe84 commented 4 years ago

Hi. I've got a question regarding the "input.nn" file in the lammps interface. In the water example, the free atom reference energies are commented. Why don't we need them for the lammps simulations? I've found out this leads to predicting wrong potential energies in the simulations. I got the correct energies by removing # from the corresponding lines. Thanks.

singraber commented 4 years ago

Hey!

How do you know that the energies are wrong if you use the given example? When I run LAMMPS I find that the initial configuration has the potential energy -6000558.1 eV which corresponds to approximately -694.5 eV per atom. This is very close to the per-atom-energies in the data set taken from here (note the different units). So I think the prediction is correct and does not need any additional offset energies.

Regarding the atomic reference energies in the settings file: If the data set normalization is used (presence of keywords mean_energy, conv_energy and conv_length... more information coming up in the docs, in the meantime have a look here), the atom_energy keyword is usually not used. The reference energy (atom_energy) is absorbed in the mean_energy value.

moabe84 commented 4 years ago

Many thanks Andreas for the clarification. Actually the problem I got was in my own water example. Sorry for the misleading in my previous massage. The examples in the package work very well. I've just found out the problem is in my "norm" calculation. Definitely the mean energy is not correct. I used the input.nn file from the "examples\nnp-norm\H2O_RPBE-D3". Here is the output file: output.nn.txt I guess something is wrong in the data file: input.data.txt

Could you please have a look into that.

moabe84 commented 4 years ago

Can not be due to the inconsistency between the total potential energy in the data file and the free atomic energies? I did AIMD under PBC for this data set. In my case the energy of each water is around -17.2 Hartree (-551/32), while in your case (H2O_RPBE-D3) it is around -76.5 (-2450/32) in consistence with the free atom reference energies of O and H.

moabe84 commented 4 years ago

What happens if I compute the normalization factors without providing the free atomic reference energies?