exclude_bands bug (and spinors with W90)

General discussion around the EPW software

Moderator: stiwari

Post Reply
gio.piz

exclude_bands bug (and spinors with W90)

Post by gio.piz »

Hi,

there is a bug when running Wannier90 (or more precisely pw2wannier90) through EPW when exclude_bands are used. In this case the code crashes with SIGSEGV.

The reason is at the end of the computation of Mmn matrices (in pw2wan90epw.f90) in the code

Code: Select all

        DO n=1,nbnd
           IF (excluded_band(n)) CYCLE
           DO m=1,nbnd
              IF (excluded_band(m)) CYCLE
              m_mat(m,n,ib,ik_g)=Mkb(m,n)
           ENDDO
        ENDDO

Because if there are excluded bands the size of the two matrices is different, so the code is writing out of bounds.

Actually, this bug existed in an old version of pw2wannier90.f90 in library mode, but has since been fixed when we committed the new extended version to the QE repository:
Revision 10880 - Message:
Committed the new pw2wannier interface [...]
It includes the new features as spinor-projections,
and the evaluation of the matrix elements needed for the
calculation of spin and orbital magnetization
[...] Also includes a couple of bugfixes to the 'library' mode of
the interface


If possible, I would strongly suggest to realign your code to the current pw2wannier90.f90 codebase. Even better, if I can suggest (even if I understand that this will take time) would be to use the same function calls - this could be a good occasion to factor out the common parts of the routines so pw2wannier90.f90 and EPW use the same code - mainly because if bugs or improvements are done in pw2wannier90, these will be also in EPW.

On a slightly different note: I want to use spin-orbit with EPW. I did not try to run the Pb example yet, but there you do not specify explicitly the spinors input flag (I guess the reason is that W90 is ignoring that flag when running in Library mode...). In my system, this is an issue because I have difficulties converging to the right Wannier functions - do you have an easy solution for this, i.e., to tell Pw2Wannier90 + Wannier90 to use the correct (spinor) projections?

Thanks!

Giovanni Pizzi
THEOS and MARVEL, EPFL, Switzerland
gio.piz

Re: exclude_bands bug (and spinors with W90)

Post by gio.piz »

I just realised (for the second part of my previous post) that EPW reads the internal noncolin flag to set the spinors flag internally, without the need to set manually spinors=true in the input file - the convergence problem that I had was due to a missing flag in my input file.

Sorry about that!

Giovanni
carla.verdi
Posts: 155
Joined: Thu Jan 14, 2016 10:52 am
Affiliation:

Re: exclude_bands bug (and spinors with W90)

Post by carla.verdi »

Dear Giovanni,

Regarding the 'exclude_band' parameter, thanks for pointing out the bug, however this feature is not currently supported in EPW so I suspect that was an old attempt to include it - we should actually put it in the code! Also, thank you for your suggestions.
Glad the spinors are sorted.

Cheers
Carla
sponce
Site Admin
Posts: 616
Joined: Wed Jan 13, 2016 7:25 pm
Affiliation: EPFL

Re: exclude_bands bug (and spinors with W90)

Post by sponce »

Hello Giovanni,

Thank you for your remark.
I will try to call the w90 functions directly or at least to re-align with the code as you suggested.

Best,

Samuel
Prof. Samuel Poncé
Chercheur qualifié F.R.S.-FNRS / Professeur UCLouvain
Institute of Condensed Matter and Nanosciences
UCLouvain, Belgium
Web: https://www.samuelponce.com
Post Reply