Skip to content

pw2wannier90: Remove wrong normalization of the guiding functions for amn

Jae-Mo Lihm requested to merge jmlihm/q-e:pw2w90_amn_fix into develop

In https://gitlab.com/QEF/q-e/-/blob/develop/PP/src/pw2wannier90.f90#L4569 of subroutine generate_guiding_functions, gf is normalized, but it should not be normalized.

If I remove this line, the symmetry of amn improves significantly. (For Cu example in !1885 (merged): deviation from a symmetric result is 1.86697e-01 before fix, 5.21608e-06 after fix)

This change does not affect Wannier90 results very much, but it has some small effects. For the Cu example, the spreads of the d-orbital-like WFs are

Before fix: 0.38825734, 0.38820842, 0.31968264, 0.31968264, 0.31968009
After fix:  0.38886288, 0.38886290, 0.31965038, 0.31965038, 0.31965037

The eg/t2g symmetry is slightly broken before the fix, the spreads are much more symmetric after the fix.

The fix is very important when one wants to inspect the symmetry of the amn matrix itself (like in !1885 (merged))

Details

https://gitlab.com/QEF/q-e/-/blob/develop/PP/src/pw2wannier90.f90#L4569 gf(:,iw) = gf(:,iw) / dsqrt(anorm)

This line is from subroutine generate_guiding_functions, which computes gf which is the initial guess orbitals in the plane wave basis. Since we are considering a single k point, gf should not be normalized (the atomic orbitals are not orthogonal). However, this line wrongly enforces normalization of gf. The normalization coefficient differs at each k point, thus breaking symmetry.

Before the fix:

A_{mi}(\mathbf{k}) = \sum_{|G| < E_{\rm cut}} \langle \psi_{m\mathbf{k}} | \mathbf{G+k} \rangle \langle \mathbf{G+k}| \phi_{i \mathbf{k}} \rangle / \sum_{|G| < E_{\rm cut}} \langle \phi_{i\mathbf{k}} | \mathbf{G+k} \rangle \langle \mathbf{G+k}| \phi_{i \mathbf{k}} \rangle
\neq \langle \psi_{m\mathbf{k}} | \phi_{i \mathbf{k}} \rangle

After the fix:

A_{mi}(\mathbf{k}) = \sum_{|G| < E_{\rm cut}} \langle \psi_{m\mathbf{k}} | \mathbf{G+k} \rangle \langle \mathbf{G+k}| \phi_{i \mathbf{k}} \rangle
= \langle \psi_{m\mathbf{k}} | \phi_{i \mathbf{k}} \rangle

Since \phi_{i\mathbf{k}} comes from non-orthogonal atomic orbitals, it is not normalized at each k:

\langle \phi_{i\mathbf{k}}| \phi_{i \mathbf{k}} \rangle \neq 1
Edited by Jae-Mo Lihm

Merge request reports