pw2wannier90: Fix a bug in compute_uHu and compute_sHu with DFT+U
Fixed a bug in pw2wannier90 that DFT+U parameters that are needed in h_psi are not initialized. This led to erroneous results for uHu and sHu calculations.
Courtesy of Tae Yun Kim and Seung-Ju Hong (Seoul National University).
Example: bcc Fe with DFT+U (U=3eV), uHu output
Before the fix, the uHu output changes when using different number of cores (for plane waves). They are all garbage values (often NaN). After the fix, the result is independent of parallelization. The same holds for the sHu output (not shown).
Before, 1 core:
Created on 24Dec2023 at 1: 1:25
24 27 12
-6.6866710553E+01 -1.7495380447E-14
1.6651792385E-06 4.6585901188E-06
...
Before, 8 cores:
Created on 24Dec2023 at 1: 1:10
24 27 12
-6.7755707566E+01 1.1896733598E-14
9.5536907036E-01 -3.6121872005E-01
...
After, 1 core:
Created on 24Dec2023 at 0:59:21
24 27 12
-6.6869281216E+01 -9.5549096939E-14
1.5389839615E-06 4.3061652965E-06
...
After, 8 cores:
24 27 12
-6.6869281216E+01 -2.8322396511E-14
1.5389839616E-06 4.3061652966E-06
...
Edited by Jae-Mo Lihm