Why inner loop and outer loop energy differs by a lot and how to reduce it

Queries about input and output files, running specific calculations, etc.


Moderators: Global Moderator, Moderator

Post Reply
Message
Author
mukesh.phy
Newbie
Newbie
Posts: 2
Joined: Tue Dec 03, 2024 6:48 am

Why inner loop and outer loop energy differs by a lot and how to reduce it

#1 Post by mukesh.phy » Wed Apr 16, 2025 5:57 pm

Hi,

During an analysis of a VASP calculation, I found that there is significant energy difference between KS-energy and E0 (energy at fixed lattice parameters). eg

DAV: 196 -0.489156938032E+03 0.17089E-02 -0.69304E-03 4720 0.393E-01 0.104E+00
DAV: 197 -0.489160004420E+03 -0.30664E-02 -0.13477E-03 4752 0.116E-01 0.105E+00
DAV: 198 -0.489160148463E+03 -0.14404E-03 -0.79678E-05 4176 0.342E-02 0.106E+00
DAV: 199 -0.489159714461E+03 0.43400E-03 -0.16140E-04 4544 0.549E-02 0.107E+00
DAV: 200 -0.489160798016E+03 -0.10836E-02 -0.49813E-05 3504 0.247E-02
1 F= -.49156194E+03 E0= -.49156220E+03 d E =-.491562E+03 mag= 0.1526

My expectation is E0 should be close to DAV here. Am I right? If not, could you please explain meaning of them and why they should not be close.

From this, we can see that the difference between DAV (-0.489160798016E+03) and E0 (-.49156220E+03) is significantly large 2.4014 eV. what are possible reasons and how to reduce it?

while searching for a reason of it, I thought that it is first iteration and KS-cycles is hitting the NELM, which is 200 here, so DAV and E0 may not be close and after relaxation, this difference will reduce. But I found contradictory.

For my relaxed system, I grepped DAV and E0 from OUTCAR. And marked with (DAV)/(E0) to indicate inner and outer loop energy

grep "TOTEN" OUTCAR | tail -n 10
free energy TOTEN = -492.84374337 eV (E0)
free energy TOTEN = -490.44259981 eV (DAV)
free energy TOTEN = -490.44261452 eV (DAV)
free energy TOTEN = -490.44261217 eV (DAV)
free energy TOTEN = -490.44260994 eV (DAV)
free energy TOTEN = -492.84374690 eV (E0)
free energy TOTEN = -490.44263434 eV (DAV)
free energy TOTEN = -490.44265212 eV (DAV)
free energy TOTEN = -490.44265556 eV (DAV)
free energy TOTEN = -492.84379379 eV (E0)

From here, we can see that there is only 3 KS-cycle and still DAV ( -490.44265556) and E0 (-492.84379379) differs significantly (2.401 eV).

Any suggestion of comments and how to reduce this difference will be highly appreciated.

thanks


michael_wolloch
Global Moderator
Global Moderator
Posts: 163
Joined: Tue Oct 17, 2023 10:17 am

Re: Why inner loop and outer loop energy differs by a lot and how to reduce it

#2 Post by michael_wolloch » Thu Apr 17, 2025 7:44 am

Dear Mukesh,

Please attach all input files and necessary output files (at least OUTCAR) of a minimal reproducible example in a .zip file according to our posting guidelines, so I can reproduce your calculation.

Thanks, Michael


mukesh.phy
Newbie
Newbie
Posts: 2
Joined: Tue Dec 03, 2024 6:48 am

Re: Why inner loop and outer loop energy differs by a lot and how to reduce it

#3 Post by mukesh.phy » Tue Apr 22, 2025 5:28 pm

Dear Michael,

thanks a lot for replying.

I figured out the reason for the same. It was van der Waal interactions (IVDW = 11), which is added into energy of the converged KS-cylcle's energy, so there is finite energy difference (because of Edisp (eV)) between converged KS-energy and its corresponding E0 energy.

Since in vasp (and other DFT codes), vdw correction are being calculated after KS-equation solving and then its is added to get the total energy and forces. What are other kinds of correction in DFT which are added after performing KS-equation calculations to get total energy (E0)?


michael_wolloch
Global Moderator
Global Moderator
Posts: 163
Joined: Tue Oct 17, 2023 10:17 am

Re: Why inner loop and outer loop energy differs by a lot and how to reduce it

#4 Post by michael_wolloch » Wed Apr 23, 2025 8:10 am

Dear Mukesh

Great that you figured it out yourself! Indeed, all available van der Waals corrections, other than the nonlocal vdw-DF functionals, will lead to these energy differences, because the corrections are getting added after the KS equations are solved, as you noted correctly. For the nonlocal vdw-DF functionals, the correction is part of the functional and thus included in each iteration.

As far as I know, no other corrections are added to the total energy after the KS system is converged for DFT. The situation differs for ACFDT/RPA, where Hartree-Fock exchange energy and the ACFDT-RPA correlation energy are computed non-self-consistently using previously converged Kohn-Sham orbitals. But this is a post-DFT method.

Let me know if this answers your question, so that I can lock the thread. Otherwise, I am happy to answer more questions on the topic!

Cheers, Michael


Post Reply