Page 1 of 1

Possible bug in vmewan2bloch

Posted: Tue Aug 31, 2021 9:56 am
by jaemo.lihm
Dear developers,
I would like to report a possible bug in the degeneracy-lifting part of vmewan2bloch. AFAIU, it diagonalizes the velocity matrix within the degenerate subspace.

The relevant part of the code is https://gitlab.com/QEF/q-e/-/blob/devel ... L1240-1318

Code: Select all

        ijbndc = 0
        DO ibnd = 1, nbnd
          DO jbnd = 1, nbnd
            IF ((list_dup(ibnd) == ideg) .AND. (list_dup(jbnd) == ideg)) THEN
              ijbndc = ijbndc + 1
              jbndc = deg_dim(ideg) - MOD(ijbndc, deg_dim(ideg))
              ibndc = INT((ijbndc - 1) / deg_dim(ideg)) + 1
              vmef_deg(:, ibndc, jbndc) = vmef(:, ibnd, jbnd)
            ENDIF
          ENDDO
        ENDDO
Suppose bands 1, 2, 3 are degenerate. Then, the code above sets

Code: Select all

vmef_deg(:, 1, 2) = vmef(:, 1, 1)
vmef_deg(:, 1, 1) = vmef(:, 1, 2)
vmef_deg(:, 1, 3) = vmef(:, 1, 3)
while what seems natural is

Code: Select all

vmef_deg(:, 1, 1) = vmef(:, 1, 1)
vmef_deg(:, 1, 2) = vmef(:, 1, 2)
vmef_deg(:, 1, 3) = vmef(:, 1, 3)
Is this a bug, or is it intended?
Is there a reference (paper or preprint, code comment, commit message, etc) where this part of the code is explained?

Re: Possible bug in vmewan2bloch

Posted: Tue Aug 31, 2021 4:02 pm
by hlee
Dear jaemo.lihm:

Thank you for reporting this.

I think that in addition to this issue, this part has other issues and it should be removed (I already removed it in the private version) since it is unnecessary and harmful in some cases (for example, it can lead to gauge inconsistency in the optics module) if we fix the gauges in the rotation matrices.

I don't know the reference (previously, I asked other developers why this part was coded in this way, but I didn't get answers), but I thought that it was not correctly coded.

Sincerely,

H. Lee