Page 1 of 1

weights do not add up to nqc1*nqc2*nqc3

Posted: Mon Mar 06, 2023 3:48 pm
by jqhuang
Dear EPW developers,
I run into a problem in graphene calculation with QE 7.1. The error occurs in routine wigner_seitzg, saying " weights do not add up to nqc1*nqc2*nqc3".
The relevant code segment in subroutine wigner_seitzg is following:

Code: Select all

    DO iw = 1, dims
      DO na = 1, dims2
        tot = 0.d0
        tot2 = 0.d0
        DO i = 1, nrr
          IF (ndegen(i, na, iw) > 0) THEN
            tot2 = tot2 + 1.d0 / DBLE(ndegen(i, na, iw))
          ENDIF
        ENDDO
        DO i = 1, nrr_tmp(na, iw)
          tot = tot + 1.d0 / DBLE(ndegen_tmp(i, na, iw))
        ENDDO
        !
        IF (ABS(tot - DBLE(nc1 * nc2 * nc3)) > eps6) CALL errore &
           ('wigner_seitzg', ' weights do not add up to nqc1*nqc2*nqc3', 1)
        IF (ABS(tot - tot2) > eps6) CALL errore &
           ('wigner_seitzg', ' weigths of pair of atoms is not equal to global weights', 1)
      ENDDO
    ENDDO
In EPW calculation, the coarse q-mesh is 14*14*1. After a test, the nc1*nc2*nc3 gives 196 as expected, while the "tot" gives 196.5 which is 0.5 higher than nc1*nc2*nc3.
The pseudopotential used is NCPP+LDA. It's strange that the issue is gone when I change the pseudopotential to NCPP+PBESOL and recalculate from scratch (including vc-relax). Both pseudopotentials are from Pseudo Dojo.
The input files (except the folder "save" which is too large) are attached. Maybe it's a bug or something related to atomic structure (I think maybe the second calculation with NCPP+PBESOL has changed the structure parameters a little and thus avoid the issue). Could you please check that?

Re: weights do not add up to nqc1*nqc2*nqc3

Posted: Mon Mar 06, 2023 10:33 pm
by hlee
Dear jqhuang:

As you said, this issue is related to the structural parameters.
When constructing WS cells, we assume the system preserves the correct (or precise) symmetry, but usually it is not the case, in particular, when performing variable cell relaxations.

To be specific, when constructing WS cells, we identify the degenerate ones and for this purpose, internally, we introduce some threshold (See the line at https://gitlab.com/QEF/q-e/-/blob/devel ... r.f90#L560).
In this case, if the degenerate ones are considered as non-degenerate ones, we can encounter the error. Such things can happen depending on this threshold and the calculated structural parameters.

At this time, there are not many solutions to this problem; one of them is to try to change the above threshold.

Sincerely,

H. Lee

Re: weights do not add up to nqc1*nqc2*nqc3

Posted: Wed Jun 14, 2023 10:49 pm
by jqhuang
Dear Dr. Lee,

Since there are not many solutions to this problem, is it possible to put this error message at the beginning of the calculation? It's really frustrating when it CRASH after a long time calculation of epbs, which I think is the most time-consuming part in the entire EPW.

Sincerely,
jqhuang

Re: weights do not add up to nqc1*nqc2*nqc3

Posted: Wed Aug 16, 2023 2:20 am
by mxh
Dear Dr. Lee,

When encountering the error message "Error in routine wigner_seitzkq (1): weights do not add up to nc1nc2nc3," you mentioned adjusting the threshold of the "DO WHILE (ABS(dist(i) - mindist) < eps6 .AND. i < 125)" condition. Specifically, which parameter should be modified, and after making the modification, should I proceed with executing "make w90 epw"?

Sincerely,
mxh

Re: weights do not add up to nqc1*nqc2*nqc3

Posted: Wed Aug 30, 2023 5:18 pm
by hmori
Dear jqhuang,

It is not easy to modify the source code and know in a single calculation a good threshold value. It may be time-consuming for you. As a quick fix, I recommend you to set use_ws = false to avoid using Wigner–Seitz cell. Note that use_ws = true often leads to better Wannier interpolation: use_ws = false may require the larger size of coarse k and q grids. Please re-check the decays of the electron-phonon matrix elements by plotting the files decay.epmate and decay.epmatp.

Sincerely,
Hitoshi

Re: weights do not add up to nqc1*nqc2*nqc3

Posted: Thu Aug 31, 2023 4:56 pm
by jqhuang
Dear Hitoshi,

Thank you for the suggestion. In my practice, changing the threshold even to 0.01 still cannot get rid of the error message. Finally, I get through by setting use_ws = false just as you suggested. Anyway, use_ws = false is a workaround in such situations.

By the way, the variable of "use_ws" is missing in the list of inputs currently, maybe since a previous version. It seems like a bit of an oversight.

In addition, forgive me for bringing up a different topic here. In the QE 7.2, there is a new ASR option "all" to consider more symmetry constrains in the phonon performance.
https://gitlab.com/QEF/q-e/-/merge_requests/1978
Maybe it can also be considered in the variable of "asr_typ" in next version of EPW. In my test, the new ASR option "all" has a significant impact on the low frequency region of phonon especially for large systems like twisted bilayer graphene.

Best regards,
jqhuang