Page 1 of 1

exclude_bands bug (and spinors with W90)

Posted: Mon May 23, 2016 10:08 pm
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

Re: exclude_bands bug (and spinors with W90)

Posted: Mon May 23, 2016 10:27 pm
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

Re: exclude_bands bug (and spinors with W90)

Posted: Tue May 24, 2016 9:13 am
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

Re: exclude_bands bug (and spinors with W90)

Posted: Wed May 25, 2016 10:25 am
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