Possible bug in vmewan2bloch

General discussion around the EPW software

Moderator: stiwari

Post Reply
jaemo.lihm
Posts: 5
Joined: Tue Jun 16, 2020 3:47 am
Affiliation: Seoul National University

Possible bug in vmewan2bloch

Post 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?

hlee
Posts: 415
Joined: Thu Aug 03, 2017 12:24 pm
Affiliation: The University of Texas at Austin

Re: Possible bug in vmewan2bloch

Post 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

Post Reply