[Pw_forum] implementation of variation of occupations and Fermi level with perturbations

Paolo Giannozzi giannozz at democritos.it
Tue Apr 19 22:44:55 CEST 2011


On Apr 8, 2011, at 20:39 , David Strubbe wrote:

> Eq. 79 refers to a quantity \Delta n_{ext} and an integral of the LDOS
> with \Delta V_{SCF} to calculate the shift in Fermi level. However in
> ef_shift it appears that the density response drhoscf is used instead
> of these quantities in the numerator, which doesn't seem like the  
> same thing.

it doesn't, but it is. The (dirty) trick is well hidden in the call  
to routine dv_of_drho:
it accepts in input the variation of the charge density, returns in  
output the
variation of the potential, overwritten on the former. It was done a  
looong time
ago in order to spare some memory, when machines had much less ram and
the code was much simpler and smaller (occasional dirty tricks were  
under
control, sort of). A comment in the code would have spared you (and me)
some time. Unfortunately comments in code tend to belong to one of the
following categories: 1) useless, 2) misleading, 3) obsolete, 4)  
nonexistent

P.
---
Paolo Giannozzi, Dept of Chemistry&Physics&Environment
Univ. Udine, via delle Scienze 208, 33100 Udine, Italy
Phone +39-0432-558216, fax +39-0432-558222






More information about the users mailing list