[QE-developers] Potential bug in dipole correction of quantum espresso

Pietro Davide Delugas pdelugas at sissa.it
Sun Apr 2 23:44:03 CEST 2023


Dear Lingyuan

The saw-tooth function ( see PW/src/extfield.f90 ) has a  unitary slope, so the operations performed for ion_dipole and e_dipole are equivalent to what you are expecting.  The only difference is that the center  with respect to which we compute the dipole is  the point at which the saw-tooth function  –and the saw-tooth potential as well—  have their 0 value.
Best regards
Pietro

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows

From: Lingyuan Gao<mailto:lg041 at uark.edu>
Sent: Saturday, April 1, 2023 9:04 PM
To: developers at lists.quantum-espresso.org<mailto:developers at lists.quantum-espresso.org>
Subject: [QE-developers] Potential bug in dipole correction of quantum espresso

Dear developers of quantum espresso,
My name is Lingyuan Gao and I am a postdoc at the University of Arkansas. I am recently looking at the code relevant to dipole correction. The code about computing electron or ionic dipole written in "compute_dip.f90" drew my attention and I am wondering whether they are correct. Please look at Line 69 and Line 164:
"
   ion_dipole = ion_dipole + zvia* saw(emaxpos,eopreg, tvectb ) &
                                                * (alat/bmod) * (fpi/omega)

  e_dipole = e_dipole + rhoir * saw(emaxpos,eopreg, sawarg) &
                      * (alat/bmod) * (fpi/(dfftp%nr1*dfftp%nr2*dfftp%nr3))
"
As I understand,  these two lines of codes are to compute the dipole of ionic part and electronic part, so they are the product of charges and distance times a constant. Nevertheless, I didn't see the reason why the sawtooth function (saw(x)) should be used here for recalculating position, which should be a function for correcting potential. In my opinion, here it should straightly use 'tvectb' and 'sawarg'.

Thanks for your time, and let me know if my concern is correct.


Best
Lingyuan


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quantum-espresso.org/pipermail/developers/attachments/20230402/59e4f7e3/attachment.html>


More information about the developers mailing list