Closed owenrett closed 2 years ago
I realize I forgot to attach the lammps structure file to the issue. I have attached it here.
Hello Owen!
thank you very much for this carefully prepared bug report, your effort makes it really much easier for me to follow the description and trace back the origin. I greatly appreciate that :-)!
I just submitted a commit (https://github.com/CompPhysVienna/n2p2/commit/e3ee6abef466d8d313f5b1d4bda421a444d3e4a0) to the master
branch which should fix the problem, could you please test if that is the case? (I cannot because I would need also the weights.???.data
and scaling.data
files.)
Thanks a lot for catching this!
Best, Andreas Singraber
My apologies on the delay; had a bug on my system related to openmpi, so took a while to recompile. The energies on a per atom and system basis seem to agree now; that is both are giving equivalent values.
Describe the bug The command
compute pe/atom
(atom specific energy) in lammps returns the potential energy without either the normalization offset ("mean_energy"), nor the atom energy offset ("atom_energy"). The commandcompute pe
(total system energy) appears to include these offsets. For a small scale system (96 atoms, 3 species, Zr Ce O) the energies returned by compute pe/atom (reduced and summed) are:Relevant input.nn Settings mean_energy: -3.3958016388641306E+00 atom_energy Zr -7.73537698 atom_energy Ce -4.63794868 atom_energy O -1.54279418
System Setup N_Zr N_Ce N_O 28 4 64
LAMMPS: computing energies per atom
compute ZrEnA ZrGp pe/atom
compute ZrEn ZrGp reduce sum c_ZrEnA
ZrEn = -210.00812 CeEn = 4.1838487 OEn = 211.13337
Computing total energy compute peAll all pe -654.24414
Comparing Zr_En_Sum + N_Zr Mean_Energy + N_Zr atom_energy_Zr = -210.00812 + 28 -3.395 + 28 -7.735 = -522.715 Ce_En_Sum + N_Ce Mean_Energy + N_Ce atom_energy_Ce = 4.1838487 + 4 -3.395 + 4 -4.637 = -27.584 O_En_Sum + N_O Mean_Energy + N_O atom_energy_O = 211.13337 + 64 -3.395 + 64 - 1.543 = -103.944
(-522.715) + (-27.584) + (-103.944) = -654.24414
To Reproduce Steps to reproduce the behavior:
compute pe/atom
does not matchcompute pe
when summedExpected behavior A clear and concise description of what you expected to happen. Expect
compute pe/atom
to match`compute pe
when per atom energies are summed. This issue can be fixed in post if energies calculated are necessary, however I figured that it should be brought to your attention.Additional context The relevant files have been attached below.
md_NETO.lmp.txt log.lammps.txt input.nn.txt
My apologies if the information here is not enough or formatted incorrectly. I have not submitted many issues through github before. I had drafted this issue for a significantly larger system before reporting for a smaller system, so some numbers may be slightly off; I am trying to fix them.
-Owen Rettenmaier