How to calculate the wanniergap?

Hi, I have already calculated the wannier functions and just wanted the values of VBM, CBM and the band gap. I tried different syntax for the “wanniergap” keyword but nothing seems to be working, it gives no output file or message. Help?

Hi :slight_smile:
Can you please share your input.xml and the output of WANNIER_INFO.OUT for more information? Than I can try to figure out what the problem is.

Cheers, Sebastian

Hi, Sebastian.
Apparently I can’t upload attachments since I’m a new user, but here are the input.xml (without the “>” character so it’s readable):
<input

AuCs</title

<structure autormt=“false” speciespath=’/opt/exciting.oxygen/species’
<crystal scale=‘7.78189’
1.0 0.0 0.0 </basevect
0.0 1.0 0.0 </basevect
0.0 0.0 1.0 </basevect
</crystal
<species chemicalSymbol=“Au” speciesfile=‘Au.xml’ rmt=“2.2”
<atom coord=‘0.5 0.5 0.5’/
</species
<species chemicalSymbol=“Cs” speciesfile=‘Cs.xml’ rmt=“2.2”

</species
</structure

<groundstate
rgkmax=‘9’
gmaxvr=‘15’
ngridk=‘12 12 12’
epsengy=‘1d-6’
epspot=‘1d-6’
epschg=‘1d-6’
swidth=‘0.001’
nempty=‘40’
do=‘skip’
lmaxmat=‘10’
lmaxapw=‘10’
lmaxvr=‘10’
lmaxinr=‘2’
maxscl=‘200’
mixer=‘msec’
stype=‘libbzint’
xctype=‘HYB_HSE’
vkloff=‘0.5 0.5 0.5’
CoreRelativity=‘dirac’
ptnucl=‘true’
ValenceRelativity=‘zora’
outputlevel=‘high’
<Hybrid
excoeff=‘0.25’ /
</groundstate
<properties
<wannier input=“hybrid” do=“skip”
<group
method=“auto”
fst=“23”
lst=“35”
writeconv=“true”
maxitopf=“1000”
maxitdis=“5000”
maxitmax=“5000”
optim=“lbfgs”
minstepdis=“1.0d-3”
minstepmax=“1.0d-3”
minstepopf=“1.0d-3”
/
<group
method=“disFull”
innerwindow=“0.0 0.6”
outerwindow=“0.0 1.5”
maxitopf=“1000”
maxitdis=“5000”
maxitmax=“5000”
writeconv=“true”
neighcells=“true”
optim=“lbfgs”
minstepdis=“1.0d-3”
minstepmax=“1.0d-3”
minstepopf=“1.0d-3”
/
</wannier
<wannergap
</wanniergap
<bandstructure character=“true” wannier=‘true’
<plot1d
<path steps=“200”
<point coord=" 0.000 0.000 0.000" label=“GAMMA” /
<point coord=" 0.000 0.500 0.000" label=“X” /
<point coord=" 0.500 0.500 0.000" label=“M” /
<point coord=" 0.000 0.000 0.000" label=“GAMMA” /
<point coord=" 0.500 0.500 0.500" label=“R” /
<point coord=" 0.000 0.500 0.000" label=“X” /
<point coord=" 0.500 0.500 0.000" label=“M” /
<point coord=" 0.500 0.500 0.500" label=“R” /
</path
</plot1d
</bandstructure
</properties
</input

and the WANNIER_INFO.OUT:


  • Brillouin zone neighbors for k-gradient *

vectors to neighboring k-points (cartesian)

  length:     0.0672842684              weight:   110.4442053805
     1              0.0000000000          0.0000000000          0.0672842684
     2              0.0000000000          0.0672842684          0.0000000000
     3              0.0672842684          0.0000000000          0.0000000000

vectors to neighboring k-points (lattice)

  length:     0.0672842684              weight:   110.4442053805
     1              0.0000000000          0.0000000000          0.0833333333
     2              0.0000000000          0.0833333333          0.0000000000
     3              0.0833333333          0.0000000000          0.0000000000

consistency check (fullfilled if unity, consider grid-dimension)

                    1.0000000000          0.0000000000          0.0000000000
                    0.0000000000          1.0000000000          0.0000000000
                    0.0000000000          0.0000000000          1.0000000000

  • Preparation *

calculate plane-wave matrix-elements…
plane-wave matrix-elements read from file
duration (seconds): 2.1
#k-points: 1728
#neighbors per k-point: 3

calculate projection overlap matrices…
duration (seconds): 14.0
#k-points: 1728
#states: 54
#projection functions: 124


  • Overall set-up *

lowest band: 23
highest band: 76
#bands involved: 54
#Wannier functions: 43
#groups: 2
#k-points: 1728


  • Wannierization *


  • Group: 1 -

lowest band: 23
highest band: 35
#bands involved: 13
#Wannier functions: 13
#projection functions: 13
method: opfmax

calculate improved optimized projection functions (iOPF)…
duration (seconds): 135.1
iterations: 132
gradient cutoff: 0.100000E-01
norm of gradient: 0.971275E-02
Omega: 47.659262

minimize localization functional Omega…
duration (seconds): 3196.7
iterations: 5000
gradient cutoff: 0.100000E-05
norm of gradient: 0.915520E-04
Omega: 47.261115
reduction: 1%


  • Group: 2 -

lowest band: 36
highest band: 76
#bands involved: 41
#Wannier functions: 30
#projection functions (nc): 192
method: disFull
outer window: 0.0000 1.5000
inner window: 0.0000 0.6000
min/max bands inner window: 15/ 19
min/max bands outer window: 41/ 41

calculate improved optimized projection functions (iOPF)…
duration (seconds): 2299.7
iterations: 934
gradient cutoff: 0.100000E-01
norm of gradient: 0.975191E-02
Omega: 808.705065

disentangle optimal subspace…
duration (seconds): 443.8
iterations: 389
convergence cutoff: 0.100000E-03
norm of gradient: 0.964012E-04
Omega_I before: 842.511297
Omega_I after: 201.476407
reduction: 76%

calculate improved optimized projection functions (iOPF)…
duration (seconds): 2213.2
iterations: 1000
gradient cutoff: 0.100000E-01
norm of gradient: 0.997580E+01
Omega: 264.561156

minimize localization functional Omega…
duration (seconds): 18702.8
iterations: 3980
gradient cutoff: 0.100000E-05
norm of gradient: 0.899660E-06
Omega: 236.421261
reduction: 11%


  • total duration (seconds): 27324.1 -


  • Wannier functions *

localization center (lattice) Omega Omega_I Omega_D Omega_OD

================================================================================
1 -0.009119 -0.047705 0.054271 3.429667 3.165269 0.000008 0.264390
2 -0.071895 0.004066 -0.009776 3.518619 3.250227 0.000008 0.268384
3 -0.009097 0.003337 -0.072014 3.519712 3.251257 0.000008 0.268447
4 -0.025229 -0.061127 -0.024746 3.505455 3.233205 0.000007 0.272243
5 -0.030971 0.031166 0.055334 3.481061 3.210168 0.000007 0.270886
6 0.055977 0.030118 -0.030843 3.483040 3.212012 0.000007 0.271021
7 0.053775 -0.048447 -0.008034 3.429849 3.165435 0.000008 0.264405
8 -0.013161 0.070101 -0.014133 3.502857 3.235052 0.000007 0.267798
9 0.524090 0.526254 0.387693 3.991986 3.131614 0.000004 0.860368
10 0.387101 0.524898 0.522726 3.992051 3.131727 0.000004 0.860320
11 0.519253 0.385213 0.518383 3.991876 3.131785 0.000004 0.860086
12 0.569401 0.563409 0.571051 3.990097 3.128355 0.000004 0.861738
13 0.049727 0.018501 0.049946 3.424845 3.160937 0.000008 0.263900

                                       total:    47.261115    41.407043     0.000085     5.853987

14 0.137616 0.199201 -0.199171 9.505917 8.174473 0.002269 1.329176
15 -0.507342 -0.546921 -0.008207 7.689703 7.126097 0.005683 0.557922
16 -0.507439 0.008198 -0.453133 7.689324 7.125915 0.005676 0.557734
17 -0.143336 -0.070239 0.254603 9.865169 8.508996 0.005828 1.350345
18 -0.206400 -0.194247 -0.209942 9.480136 8.550326 0.002524 0.927287
19 0.087143 0.321268 0.092345 9.475844 8.366474 0.005879 1.103491
20 0.201837 -0.184099 0.184077 9.239582 8.159925 0.003860 1.075796
21 0.092654 0.116987 0.306924 9.453787 8.452997 0.005502 0.995288
22 -0.332061 -0.120956 0.121005 9.582131 8.830107 0.013220 0.738803
23 0.304897 -0.097193 -0.101035 9.498383 8.372892 0.003758 1.121733
24 -0.143308 -0.254521 0.070259 9.866161 8.509517 0.005818 1.350826
25 0.304829 0.101009 0.097206 9.498685 8.372818 0.003755 1.122111
26 0.426585 0.443155 0.410021 5.888241 4.940218 0.002164 0.945859
27 -0.541636 -0.398734 -0.555598 5.872071 4.833017 0.001002 1.038052
28 0.591327 -0.441350 0.441342 5.668315 4.753515 0.001737 0.913063
29 0.584306 -0.437317 -0.432718 5.900969 4.848207 0.000986 1.051777
30 -0.541620 -0.444426 0.398699 5.872266 4.833132 0.001004 1.038130
31 0.006675 -0.472144 -0.527806 7.411017 6.984658 0.003507 0.422852
32 0.429473 -0.572312 -0.427689 5.816465 4.807474 0.000583 1.008408
33 0.426537 -0.410021 -0.443193 5.887982 4.940067 0.002162 0.945753
34 -0.457569 0.397513 -0.397477 6.428904 5.409030 0.001680 1.018193
35 -0.123831 0.113079 -0.309967 9.449496 8.643253 0.009202 0.797040
36 -0.449582 0.397149 0.454019 5.970731 4.843382 0.001336 1.126013
37 -0.123806 0.310028 -0.113102 9.449070 8.642891 0.009199 0.796980
38 0.092667 -0.306893 -0.116915 9.453906 8.452941 0.005504 0.995461
39 -0.606710 0.470785 -0.470780 5.678829 4.602106 0.000537 1.076187
40 -0.415644 0.432733 0.437378 5.900813 4.848103 0.000987 1.051723
41 0.550408 -0.454006 -0.397148 5.971110 4.843605 0.001334 1.126171
42 0.087068 -0.092298 -0.321193 9.475927 8.366011 0.005869 1.104047
43 -0.206406 0.209948 0.194279 9.480328 8.550398 0.002524 0.927406

                                       total:   236.421261   206.692543     0.115091    29.613627

================================================================================
total: 283.682376 248.099587 0.115175 35.467614
average: 6.597265 5.769758 0.002678 0.824828

First, the resulting Wannier functions look quite good and should give you a proper interpolation :+1:
On the one hand, you can judge the success of the wannierization by the norm of the gradient after the minimization of the spread functional which is sufficiently small for both groups. On the other hand, the average spread of the Wannier functions is 6.6 Bohr^2 which is reasonably small meaning that the Wannier functions are well localized. From my experience, spreads in the order of ~10 Bohr^2 are good results.

Second, coming to your problem: I hope that this can be easily fixed by setting do="fromfile" in the <wannier> element. This will read the Wannier functions from the file WANNIER_TRANFORM.OUT and uses them to find the gap. In the case of do="skip" the hole <wannier> block is skipped and hence also all Wannier related properties such as band gap or bandstructure interpolation cannot be computed.

Please let me know, whether this solves the problem.

And as a hint for future posts: This forum uses the so called markdown language for formatting. This allows you to write code or other formatted output. E.g., for inline formatting you can type something like

# `inline formatting`

or for a code block, you can type

# ```
#  your code block
# ```

Of course without the comment sign #. For example

<input>
  <title>AuCs</title>

  <structure autormt=“false” speciespath=’/opt/exciting.oxygen/species’>
    <crystal scale=‘7.78189’>
      <basevect>1.0 0.0 0.0 </basevect>
      <basevect>0.0 1.0 0.0 </basevect>
      <basevect>0.0 0.0 1.0 </basevect>
    </crystal>
    <species chemicalSymbol=“Au” speciesfile=‘Au.xml’ rmt=“2.2”>
      <atom coord=‘0.5 0.5 0.5’/>
    </species>
    <species chemicalSymbol=“Cs” speciesfile=‘Cs.xml’ rmt=“2.2”>

    </species>
  </structure>
  ...
</input>

It worked with the “fromfile” option, thank you!

Now, I was able to plot the band structure with Wannier but the DOS calculation gives this error:

Error (wfint_findbandmap) Bands cannot be maped!

This is my input:

        <dos
         wannier="true"
         ngridkint="40 40 40"
         winddos="-0.2 0.2"
         nwdos="1000"
         inttype="tetra"/>

I don’t have a quick fix for that error. I wanted to redo your calculation (with less accurate numerical settings) to reproduce, find and understand the origin of that error message. Can you share your input.xml and your species files (unless you use the default ones)? You can share them vial email to [email protected].

Hi! Just sent the email, let me know if you received it. Thank you!