Energy inconsistency in the on-the-fly machine learning process
Moderators: Global Moderator, Moderator
-
- Newbie
- Posts: 14
- Joined: Tue Nov 19, 2019 9:45 am
Energy inconsistency in the on-the-fly machine learning process
Dear all:
In vasp.6.3.0, i tested the on-the-fly machine learning method. I found the "E0" in the OSZICAR file is a bit different. The "E0" obtained from ML force field (E0_ML) is smaller than that obtained from the ab initio (E0_FP) (Fig. 1 and Fig. 2), but "EK" is consistent. The ML_LOGFILE file reports the errors for energy, force and stress are 2.87738279E-03, 1.69086557E-01 and 4.55565253E+00, respectively.
I have two questions:
1. Why does this phenomenon occur? Is it a calculation error?
2. Which energy (E0_ML or E0_FP) is the correct one to reflect the energy of the system?
Fig.1 Fig. 2
In vasp.6.3.0, i tested the on-the-fly machine learning method. I found the "E0" in the OSZICAR file is a bit different. The "E0" obtained from ML force field (E0_ML) is smaller than that obtained from the ab initio (E0_FP) (Fig. 1 and Fig. 2), but "EK" is consistent. The ML_LOGFILE file reports the errors for energy, force and stress are 2.87738279E-03, 1.69086557E-01 and 4.55565253E+00, respectively.
I have two questions:
1. Why does this phenomenon occur? Is it a calculation error?
2. Which energy (E0_ML or E0_FP) is the correct one to reflect the energy of the system?
Fig.1 Fig. 2
You do not have the required permissions to view the files attached to this post.
-
- Global Moderator
- Posts: 460
- Joined: Mon Nov 04, 2019 12:44 pm
Re: Energy inconsistency in the on-the-fly machine learning process
Please post your calculation files (POSCAR, KPOINTS, POTCAR, INCAR, ML_LOGFILE, OUTCAR, stdout).
-
- Global Moderator
- Posts: 460
- Joined: Mon Nov 04, 2019 12:44 pm
Re: Energy inconsistency in the on-the-fly machine learning process
Also ML_REG file please.
-
- Newbie
- Posts: 14
- Joined: Tue Nov 19, 2019 9:45 am
Re: Energy inconsistency in the on-the-fly machine learning process
Dear Moderator,ferenc_karsai wrote: ↑Fri Mar 04, 2022 12:11 pm Please post your calculation files (POSCAR, KPOINTS, POTCAR, INCAR, ML_LOGFILE, OUTCAR, stdout).
Since the 20000-step OUTCAR file was too large, I ran a 100-step calculation to show the results.
Please download the files: The result:
You do not have the required permissions to view the files attached to this post.
-
- Global Moderator
- Posts: 460
- Joined: Mon Nov 04, 2019 12:44 pm
Re: Energy inconsistency in the on-the-fly machine learning process
E0 in ab-initio calculations is defined as the total energy ("F" in the OSZICAR file) minus an entropy part. The machine learning code learns only the totel energy "F" which already contains the entropy part. So for machine learning calculations the entropy part is not separately available and we cannot calculate E0. If it's an MLFF step where no ab initio calculation is printed out, then simply "E0=F" is printed out.
It's the best to look at the tofal free energy in the OUTCAR file. Since it is printed both for ab initio and MLFF (in the OSZICAR file it's only printed out for either one of them at every step).
You can grep like this:
"free energy TOTEN"
"free energy ML TOTEN"
I've plotted your calculation: The calculations looks fine.
At the beginning of course there is no free energy available in MLFF so that's why it starts from zero and also in the first steps the fit is probably very bad. But later you can see that the MLFF nicely lays on top of ab initio.
It's the best to look at the tofal free energy in the OUTCAR file. Since it is printed both for ab initio and MLFF (in the OSZICAR file it's only printed out for either one of them at every step).
You can grep like this:
"free energy TOTEN"
"free energy ML TOTEN"
I've plotted your calculation: The calculations looks fine.
At the beginning of course there is no free energy available in MLFF so that's why it starts from zero and also in the first steps the fit is probably very bad. But later you can see that the MLFF nicely lays on top of ab initio.
You do not have the required permissions to view the files attached to this post.
-
- Newbie
- Posts: 14
- Joined: Tue Nov 19, 2019 9:45 am
Re: Energy inconsistency in the on-the-fly machine learning process
Thank you very much!ferenc_karsai wrote: ↑Mon Mar 07, 2022 10:10 am E0 in ab-initio calculations is defined as the total energy ("F" in the OSZICAR file) minus an entropy part. The machine learning code learns only the totel energy "F" which already contains the entropy part. So for machine learning calculations the entropy part is not separately available and we cannot calculate E0. If it's an MLFF step where no ab initio calculation is printed out, then simply "E0=F" is printed out.
It's the best to look at the tofal free energy in the OUTCAR file. Since it is printed both for ab initio and MLFF (in the OSZICAR file it's only printed out for either one of them at every step).
You can grep like this:
"free energy TOTEN"
"free energy ML TOTEN"
I have another question. At this time, is the internal energy of the system "E0 + EK" in the ab-initio step or "free energy ML TOTEN + EK" in machine-learning step?
-
- Global Moderator
- Posts: 460
- Joined: Mon Nov 04, 2019 12:44 pm
Re: Energy inconsistency in the on-the-fly machine learning process
If you use the definition of potential (E0) plus kinetic energy (Ekin) is the internal energy of your system, then only the ab-initio steps give you this energy.
-
- Newbie
- Posts: 14
- Joined: Tue Nov 19, 2019 9:45 am
Re: Energy inconsistency in the on-the-fly machine learning process
It seems that in the original literature [PHYSICAL REVIEW B 100, 014105 (2019)], the potential energy calculated by the MLFF is used to match the potential energy calculated by the first principle Uα, so why is the U calculated by the MLFF now used to match the F calculated by the first principle instead of E0 ?ferenc_karsai wrote: ↑Thu Mar 10, 2022 3:33 pm If you use the definition of potential (E0) plus kinetic energy (Ekin) is the internal energy of your system, then only the ab-initio steps give you this energy.
Does it mean that the total energy (usually the internal energy) obtained by the machine learning force field is (F+EK)? where F=E0.
-
- Global Moderator
- Posts: 460
- Joined: Mon Nov 04, 2019 12:44 pm
Re: Energy inconsistency in the on-the-fly machine learning process
We always fitted F in our calculations, since it also contains the entropic part of the electrons (it's not a true free energy of the system since it contains only the entropic part of the electrons of the current system and is dependent on the smearing of your system).
If you don't run and MD F is the total energy. For an MD (using the Nose Hoover thermostat for example) E is the total energy, where E = F + Ekin + Etherm, where Etherm contains the potential and kinetic energy from the thermostat.
If you don't run and MD F is the total energy. For an MD (using the Nose Hoover thermostat for example) E is the total energy, where E = F + Ekin + Etherm, where Etherm contains the potential and kinetic energy from the thermostat.