Page 1 of 1
Energy inconsistency in the on-the-fly machine learning process
Posted: Fri Mar 04, 2022 8:45 am
by Yicheng
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
ML.png
Fig. 2
ML2.png
Re: Energy inconsistency in the on-the-fly machine learning process
Posted: Fri Mar 04, 2022 12:11 pm
by ferenc_karsai
Please post your calculation files (POSCAR, KPOINTS, POTCAR, INCAR, ML_LOGFILE, OUTCAR, stdout).
Re: Energy inconsistency in the on-the-fly machine learning process
Posted: Fri Mar 04, 2022 12:11 pm
by ferenc_karsai
Also ML_REG file please.
Re: Energy inconsistency in the on-the-fly machine learning process
Posted: Fri Mar 04, 2022 1:19 pm
by Yicheng
ferenc_karsai wrote: ↑Fri Mar 04, 2022 12:11 pm
Please post your calculation files (POSCAR, KPOINTS, POTCAR, INCAR, ML_LOGFILE, OUTCAR, stdout).
Dear Moderator,
Since the 20000-step OUTCAR file was too large, I ran a 100-step calculation to show the results.
Please download the files:
ML_test.rar
The result:
ML_01.png
Re: Energy inconsistency in the on-the-fly machine learning process
Posted: Mon Mar 07, 2022 10:10 am
by ferenc_karsai
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:
ML_vs_FP.png
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.
Re: Energy inconsistency in the on-the-fly machine learning process
Posted: Tue Mar 08, 2022 8:19 am
by Yicheng
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"
Thank you very much!
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?
Re: Energy inconsistency in the on-the-fly machine learning process
Posted: Thu Mar 10, 2022 3:33 pm
by ferenc_karsai
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.
Re: Energy inconsistency in the on-the-fly machine learning process
Posted: Fri Mar 11, 2022 7:44 am
by Yicheng
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.
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 ?
Does it mean that the total energy (usually the internal energy) obtained by the machine learning force field is (F+EK)? where F=E0.
Re: Energy inconsistency in the on-the-fly machine learning process
Posted: Mon Mar 14, 2022 7:24 am
by ferenc_karsai
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.