Page 1 of 1

bug in calculation of E%PSCENC

Posted: Mon Jul 24, 2006 10:04 pm
by cpp6f
In the pot.F file, this quantity is calculated as the total valance of the ions multiplied by the sum of the q=0 components of the pseudopotentials of all ions. The q=0 sum should really be multiplied by the number of electrons. The current implementation will lead to errors in charged systems since the compensating background charge density interacts with the actual coulombic potential, not the pseudopotential.

bug in calculation of E%PSCENC

Posted: Fri Aug 04, 2006 1:04 pm
by admin
Actually the VASP implementation is correct. (at the very beginning Georg Kresse, in fact, did exactly what you suggested).
If I recall correctly, the energy needs to be defined as the total energy *including* the background charge (and that requires to multiply the G=0 component with the total valance of the ions).
There are many energy contributions that are in error for charged systems, and if you want to correct the error, your energy needs to be defined exactly, as the energy calculated in the vicinity of the background charge. Excluding certain terms (or calculating certain terms incorrectly) spoils the possibility of a concise correction (LDIPOL = .TRUE.).
For a properly written code, the total energy must, for instance, change exactly by the eigenvalue of the state, which becomes occupied or deoccupied, when the number of electrons is increased or decreased, respectively. It is a simple test, that VASP fullfills. Using a different formula for PSCENC will make the results inconsistent and dependent on the actual pseudopotential.

bug in calculation of E%PSCENC

Posted: Fri Aug 04, 2006 7:00 pm
by cpp6f
Yes, that is true, but there is another test that (to me at least) is equally important. The only problem is that vasp cannot fulfill both of these tests at the same time. The test I have in mind is that of putting a neutral atom in the vacuum region of a charged slab. Since the atom is neutral, the energy

dE = E(atom+slab)-E(atom)-E(slab)

should be zero - because only the coulombic potential is non-zero in the middle of the vacuum region (and also varies linearly along the z-axis) and the atom is neutral (and symmetric along the z-axis). However, vasp does not give a dE of zero. It gives

dE = VPS_0_slab*(Za - Na) + VPS_0_atom*(Zs - Ns)

where VPS_0_slab is the G=0 component of the pseudopotential of the bare slab, VPS_0_atom is the same for the atom, Za and Zs are the valence of the atom and slab, and Na and Ns are the number of electrons in the atom and slab. Also assume that there is no electron transfer between the atom and slab or polarization of the atom orbitals by the electric field of the slab. If PSCENC is calculated using the NELECT rather than the valence, you would replace the Za and Zs in the above equation with Na and Ns and you would get the correct answer of dE = 0.

Another similar case would be putting a charged atom in the vacuum region of a neutral slab. dE should be equal to zero, but it is not with the current definition of PSCENC.

If the above two examples give the wrong answer for dE, then more realistic cases - such as adsorption energies where the initial slab or adsorbate is charged - will also be off by the same amount.

Obviously, you can't fulfill this test and the test you mentioned with the same definition of PSCENC. Perhaps you should make a note of this in user's manual and explain how to correct for this error in adsorption energy by subtracting the dE defined by the equation above from the value of dE you get from the raw energies from vasp.
<span class='smallblacktext'>[ Edited Fri Aug 04 2006, 09:01PM ]</span>