Paolo,<div><br></div><div>Thanks for the response. This gives me some more insight into what is going on, but I still don&#39;t understand.</div><div><br></div><div>As far as I can tell, the drhoscf in ef_shift is still the change in the density rather than the change in the potential, because the calls in solve_linter to dv_of_drho are using a copy of the density response rather than drhoscf itself:</div>
<div><br></div><div><div>        call zcopy (nrxx*nspin_mag,drhoscfh(1,1,ipert),1,dvscfout(1,1,ipert),1)</div><div>        call dv_of_drho (imode0+ipert, dvscfout(1,1,ipert), .true.)</div><div><br></div><div>The heart of the matter is the lines in ef_shift:</div>
<div><br></div><div>delta_n = delta_n + omega*drhoscf(nl(1),is,ipert)</div>def (ipert) = - delta_n / dos_ef</div><div><br></div><div>delta_n does not seem to refer to \Delta n_{ext} or the integral of the LDOS with \Delta V_{SCF}, as in the numerator of Eq. 79. Do those quantities exist in the calculation here?</div>
<div><br></div><div>Thanks,</div><div>David Strubbe</div><div>UC Berkeley</div><div><br><div class="gmail_quote">On Tue, Apr 19, 2011 at 1:44 PM, Paolo Giannozzi <span dir="ltr">&lt;<a href="mailto:giannozz@democritos.it">giannozz@democritos.it</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im"><br>
On Apr 8, 2011, at 20:39 , David Strubbe wrote:<br>
<br>
&gt; Eq. 79 refers to a quantity \Delta n_{ext} and an integral of the LDOS<br>
&gt; with \Delta V_{SCF} to calculate the shift in Fermi level. However in<br>
&gt; ef_shift it appears that the density response drhoscf is used instead<br>
&gt; of these quantities in the numerator, which doesn&#39;t seem like the<br>
&gt; same thing.<br>
<br>
</div>it doesn&#39;t, but it is. The (dirty) trick is well hidden in the call<br>
to routine dv_of_drho:<br>
it accepts in input the variation of the charge density, returns in<br>
output the<br>
variation of the potential, overwritten on the former. It was done a<br>
looong time<br>
ago in order to spare some memory, when machines had much less ram and<br>
the code was much simpler and smaller (occasional dirty tricks were<br>
under<br>
control, sort of). A comment in the code would have spared you (and me)<br>
some time. Unfortunately comments in code tend to belong to one of the<br>
following categories: 1) useless, 2) misleading, 3) obsolete, 4)<br>
nonexistent<br>
<br>
P.<br>
---<br>
Paolo Giannozzi, Dept of Chemistry&amp;Physics&amp;Environment<br>
Univ. Udine, via delle Scienze 208, 33100 Udine, Italy<br>
Phone <a href="tel:%2B39-0432-558216" value="+390432558216">+39-0432-558216</a>, fax <a href="tel:%2B39-0432-558222" value="+390432558222">+39-0432-558222</a><br>
<br>
<br>
<br>
_______________________________________________<br>
Pw_forum mailing list<br>
<a href="mailto:Pw_forum@pwscf.org">Pw_forum@pwscf.org</a><br>
<a href="http://www.democritos.it/mailman/listinfo/pw_forum" target="_blank">http://www.democritos.it/mailman/listinfo/pw_forum</a><br>
</blockquote></div><br></div>