[QE-developers] Bug in PP/src/pw2bgw.f90

Bradford Barker bbarker6 at ucmerced.edu
Thu Jan 23 21:59:29 CET 2020

There appears to be a bug in Quantum Espresso v. 6.4.1 executable pw2bgw.x. This bug prevents the correct execution of the task to write out the charge density when the system has spin polarization.

The execution exits with the error message:

Error in routine rhoz_or_updw (1):
wrong input

Tracking down the source files on GitLab (unknown version), I believe the issue is caused by the following:

The routine "rhoz_or_updw" has as input the three variables:
"rho", "sp", "dir".

"rho" is the charge density data itself, while "sp" and "dir" are strings that the routine uses to inform which branches to take. "dir" has to be one of either "updw" or "rhoz" so the utility calling this routine can figure out how exactly to modify the spin-polarized charge-density. "sp" has to be one of either "only_g" or "only_r", to write the data out in G-vector space or real-space.

However, in the source code visible on GitLab (https://gitlab.com/QEF/q-e/blob/4132a64778b91c4b090d0213938e00d7b2b64b10/PP/src/pw2bgw.f90), the line 1353 has

IF ( nspin==2 ) CALL rhoz_or_updw(rho, 'r_and_g', 'updw_rhoz')

which is inconsistent with the demands of PW/src/scf_mod.f90 lines 712 to 732 (https://gitlab.com/QEF/q-e/blob/4132a64778b91c4b090d0213938e00d7b2b64b10/PW/src/scf_mod.f90), making "r_and_g" and "updw_rhoz" invalid options for "sp" and "dir", respectively.

The bug-fix of pw2bgw.f90 will have "dir = updw" and "sp = only_g" (with "only_r" as an option to be specified by the user, and only used in special cases such as when using hybrid functionals, etc.).

Thank you very much,
Bradford A. Barker,
Postdoctoral scholar,
University of California, Merced
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quantum-espresso.org/pipermail/developers/attachments/20200123/8a0f813a/attachment.html>

More information about the developers mailing list