1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>Tutorial preparing Wannier90 run</title></head>
<body bgcolor="#ffffff">
<hr>
<h1>ABINIT, Wannier90 lesson of the tutorial:</h1>
<h2>The Wannier90 interface tutorial. </h2>
<hr>
<p>This lesson aims at showing how to use the Wannier90 interface to
compute Maximally Localized Wannier Functions (MLWFs). </p>
<ul>
</ul>
You will learn how to get MLWFs with ABINIT and Wannier90 and what are
the basic variables to govern the numerical efficiency. <br>
It is supposed that you already know how to use ABINIT in the norm
conserving pseudopotential case.
<p>This lesson should take about 1 hour.
And it is important to note that all the cases in the tutorial are
not converged they are just examples to show how to use the code. </p>
<h5>Copyright (C) 2008-2014 ABINIT group (TRangel) <br>
This file is distributed under the terms of the GNU General Public
License, see ~abinit/COPYING or <a href="http://www.gnu.org/copyleft/gpl.txt">
http://www.gnu.org/copyleft/gpl.txt </a>. <br>
For the initials of contributors, see ~abinit/doc/developers/contributors.txt . </h5>
<script type="text/javascript" src="list_internal_links.js"> </script>
<h3><b>Content of the Wannier90 lesson </b></h3>
<ul>
<li><a href="lesson_wannier90.html#0">0.</a> Summary of Wannier90 in
ABINIT</li>
<li><a href="lesson_wannier90.html#1">1.</a> A first example: the
silicon case</li>
<li><a href="lesson_wannier90.html#2">2.</a> A PAW case </li>
<li><a href="lesson_wannier90.html#3">3.</a> Defining the initial
projections </li>
<li><a href="lesson_wannier90.html#4">4.</a> More on Wannier90 + ABINIT </li>
</ul>
<hr>
<h4><a name="0"></a></h4>
<h3><b>0. Summary of Wannier90 in ABINIT</b></h3>
<p> Wannier90 is a code that computes MLWFs (see <A
href="http://www.wannier.org"><B>www.wannier.org</B></A>
). Wannier90 uses the
methodology introduced by N. Marzari and
D. Vanderbilt in 1997 and it is highly recommended to read the
following papers to understand its basics:
<p>
<a name="MV">MV</a>
<pre>
N. Marzari and D. Vanderbilt,<i> Maximally localized generalized
Wannier functions for composite energy bands</i>, Phys. Rev. B 56, 12847
(1997)
</pre>
<p>
<a name="SMV">SMV</a>
<pre>
I. Souza, N. Marzari and D. Vanderbilt,<i> Maximally localized
Wannier functions for entangled energy bands</i>, Phys. Rev. B 65,
035109 (2002)
</pre>
Wannier functions (WFs) can be obtained from Bloch states by means of
the formulas 1-3 of <a href="lesson_wannier90.html#SMV">SMV</a>.
As you may note there is a freedom of choice of Bloch orbital's phase which is reflected on the shape and spatial extent of
the WF. i.e., for different phases there will be WFs with different spatial
localizations. To obtain the MLWFs we minimize the spread of the WF
with respect to the choice of phase. This is done by using a
steepest-descent algorithm, see section D of <a
href="lesson_wannier90.html#MV">MV</a>.
<br>
After a ground state calculation the Wannier90 code will obtain the
MLWFs requiring just two ingredients:
<ul>
<li>The overlaps between the cell periodic part of the Bloch states
|u_nk>
<br> M_mn= < u_mk | u_nk+b >
<br> See Eq. 25 of <a href="lesson_wannier90.html#MV">MV</a>.
<li>As a starting guess the projection of the Bloch states |psi_nk>
onto trial localized orbitals |g_n>
<br> A_mn= < psi_mk | g_n >
<br> See section D of <a href="lesson_wannier90.html#SMV">SMV</a>.
</ul>
What ABINIT do is to take the Bloch functions from a ground state
calculation and compute these two ingredients. Then, Wannier90 is run.
Wannier90 is included as a library and ABINIT and the process is
automatic, so that in a single run you can do both the ground state
calculation and the computation of MLWFs.
<hr>
<h4><a name="1"></a></h4>
<h3><b>1. A first example: the silicon case</b></h3>
Before starting make sure that you compiled abinit enabling Wannier90.
You may have to recompile it using the flag <i> --enable-wannier90</i>.
<p>Now we will compute a set of MLWFs for the silicon case. We are going
to extract the Wannier functions corresponding to the four valence
states of silicon.
<br>
<i>Before beginning, you might consider to work in a different
sub-directory as for the other lessons. Why not "Work_w90" ?
</i>
<li><i>mkdir Work_w90 </i></li>
<li><i>cd Work_w90 </i></li>
<p>Copy the files tw90_1.files, tw90_1.in and wannier90.win in "Work_w90" :
<li><i>cp ../tw90_1.files . </i></li>
<li><i>cp ../tw90_1.in . </i></li>
<p>Wannier90 also uses a secondary input file which is called
wannier90.win. Therefore, you must include this file in the folder:
<li><i>cp ../wannier90.win . </i></li>
<p> Now you are ready to run abinit. Please type in:
<li><i> abinit < tw90_1.files >& log </i></li>
<p>
<br>
Let's examine the input file tw90_1.in, while the calculation is running.
<br>
The input file should look familiar to you. It is indeed the silicon
case. It has two data sets: first a SCF calculation and then a NSCF calculation which will call the Wannier90 library.
The only new input variable is
<a href="../input_variables/varfil.html#prtwant"
target="kwimg">prtwant</a> which has to be set to 2 in order to use
the Wannier90 utility.
<p>
Now lets look the secondary input file wannier90.win.
This is a mandatory input file required by the Wannier90
library. There are many variables that can be defined inside this
file. In our case we used <b>num_wann </b> and
<b>num_iter</b>. These variables are to be used in the minimization of
the spread to obtain the MLWF. In particular, <b>num_wann</b> tell us
the number of
Wannier functions to extract while <b>num_iter</b> sets the number of
iterations.
There are also variables to govern the disentanglement procedure
outlined in <a href="lesson_wannier90.html#SMV">SMV</a> which are not
used in this simple case.
The complete list of input variables can be found in
the Wannier90 user guide (see <A
href="http://www.wannier.org"><B>www.wannier.org</B></A>).
<p> We can now examine the log file.
After the convergence of the SCF cycle is reached. We can see that the
Wannier90 library is called. You will find the following lines:
<pre>
Calculation of overlap and call to Wannier90 library
to obtain Maximally Localized Wannier functions
- wannier90.win is a mandatory secondary input
- wannier90.wout is the output for the library
- wannier90.amn contains projections
- wannier90random.amn contains random projections
- wannier90.mmn contains the overlap
- wannier90.eig contains the eigenvalues
</pre>
This is an explanation of the input and output files for the Wannier90
library. As you can see many new files were created. The input files
for Wannier90 which were created by ABINIT are:
<ul>
<li> <b>wannier90random.amn</b> contains a list of
projections to be used as a starting guess of the WF. This is the A_mn
matrix which was mentioned before in this tutorial.
<li> <b> wannier90.eig</b> contains a list of eigenvalues for each
k-point and band.
<li> <b> wannier90.mmn</b> contains the overlaps between the cell
periodic part of the Bloch states. This is the M_mn matrix mentioned
before in this tutorial.
<li><b> UNK..</b> files containing the wavefunction in real space for every k-point.
</ul>
Once these files were computed by ABINIT the Wannier90 library was
used. The output files of Wannier90 are:
<ul>
<li> <b>wannier90.wout</b> is the main output file of the library.
You should read it carefully to see the details of the calculation.
<li> <b> wannier90.chk </b> is required to restart a calculation is
case you use Wannier90 in standalone mode. In our case it is not used.
</ul>
<p>If you want to obtain information about the disentanglement procedure
just type:
<li><i>grep DIS wannier90.wout </i></li>
You will obtain a table of the following form:
<pre>
+---------------------------------------------------------------------+<-- DIS
| Iter Omega_I(i-1) Omega_I(i) Delta (frac.) Time |<-- DIS
+---------------------------------------------------------------------+<-- DIS
</pre>
Similarly to obtain information about the steepest-descent
minimization just issue:
<li><i>grep CONV wannier90.wout </i></li>
You will obtain a table of the following form:
<pre>
+--------------------------------------------------------------------+<-- CONV
| Iter Delta Spread RMS Gradient Spread (Ang^2) Time |<-- CONV
+--------------------------------------------------------------------+<-- CONV
</pre>
You can verify that the final spread you get is around 4.0 ang^2
<p><b> Visualize the Wannier functions</b>
<pre>
You can see the Wannier functions in <A href="http://www.xcrysden.org">xcrysden</A> format. Just type:
<li><i>xcrysden --xsf wannier90_00001.xsf </i></li>
To see the isosurface click on: Tools->Data Grid -> OK
And modify the Isovalue, put, for instance, 0.3 and check the option "Render +/- isovalue" then click on OK
</pre>
<p><b> Notes:</b>
<ul>
<li>
It is important to set <a href="../input_variables/vardev.html#istwfk"
target="kwimg">istwfk</a> equal to 1 for every k-point avoiding using symmetries. The reason is that the formalism used to extract the MLWF assumes that you have a uniform grid of
k-points. See section IV of <a href="lesson_wannier90.html#MV">MV</a>.
<li>
The number of Wannier functions to extract should be minor or equal to
the number of bands. If <i>nband > nwan</i> then the disentanglement
routines will be called.
<li> The number of k-points should be equal to
ngkpt(1)*ngkpt(2)*ngkpt(3). This is achieved by using the
input variables <a href="../input_variables/varbas.html#kptopt"
target="kwimg">kptopt</a> = 3, <a href="../input_variables/varbas.html#ngkpt"
target="kwimg">ngkpt</a> and <a
href="../input_variables/varbas.html#nshiftk"
target="kwimg">nshiftk</a> = 1.
<li> The prefix of all wannier90 files in this sample case is <i>wannier90</i>.
<br>Other possible prefixes are w90</i>
and <b>abo</b><i>_w90</i>, where <b>abo</b> is the fourth line on your .file file.
<br>To setup the prefix, ABINIT will first look
for a file named <b>abo</b><i>_w90.win</i>
if it is not found then it will look for <i>w90.win</i> and finally for <i>wannier90.win</i>.
</ul>
<hr>
<h4><a name="2"></a></h4>
<h3><b>2. A PAW case</b></h3>
Before starting it is assumed that you have already completed the
tutorials <a href="lesson_paw1.html">PAW1</a> and <a
href="lesson_paw1.html">PAW2</a>.
<p> The PAW method is implemented in such a way that it is very easy
to use. For the silicon case we just have to add the variable
<a href="../input_variables/varpaw.html#pawecutdg"
target="kwimg">pawecutdg</a>. And the PAW Atomic Data is included in the
pseudopotential file. An example has already been prepared.
<p>Just copy the files tw90_2.files and tw90_2.in into "Work_w90":
<li><i>cp ../tw90_2.files . </i></li>
<li><i>cp ../tw90_2.in . </i></li>
<p> We are going to reuse the wannier90.win of the previous
example. Now, just run abinit again
<li><i> abinit < tw90_2.files >& log </i></li>
<p>
<br>
As it is expected, the results should be similar than those of the PW case.
<p>
<b> Important </b> For the PAW case the UNK files are not those of the real wavefunctions. The contribution inside the spheres is not computed, however, they can be used to plot the Wannier functions.
<hr>
<h4><a name="3"></a></h4>
<h3><b>3. Defining the initial projections</b></h3>
Up to now we have obtained the MLWF for the four valence
bands of silicon. It is important to note that for valence states the
MLWF can be
obtained starting from a random initial position. However, for conduction
states we have to give a very accurate starting guess to get the MLWF.
<p> We are going to extract the sp3 hybrid orbitals of Silane SiH4. You
can start by copying the following files:
<li><i>cp ../tw90_3.files . </i></li>
<li><i>cp ../tw90_3.in . </i></li>
<li><i>cp ../tw90_3o_DS2_w90.win . </i></li>
<p>Now run abinit
<li><i>abinit < tw90_3.files >& log </i></li>
<p> While it is running we
can start to examine the input files.
<br> Open the main input file tw90_3.in. The file is divided into
three datasets. First a SCF calculation is done. What follows is a NSCF
calculation including more bands. Finally, in the third dataset we just read
the wavefunction from the previous one and the Wannier90 library is
called.
<a target="kwimg">w90iniprj</a> is a keyword used to indicate that the
initial projections will be given in the <b>.win</b> file.
<p><b>Note.</b>
<ul>
<li>You may notice that the <b>.win</b> file is now called tw90_3o_DS2_w90.win.
It has the following form: prefix_dataset_w90.win,
where the prefix is taken from the third line of your .file file.
and dataset is the dataset number at which you call Wannier90 (dataset 2 in this example).
</ul>
<p> Now open the <b>.win</b> file.
The initial projections will be the sp3 hybrid
orbitals centered in the position of the silicon atom. This is written
explicitly as:
<pre>
begin projections
Si:sp3
end projections
</pre>
There is an enormous freedom of choice for the initial projections.
For instance, you can define the centers in Cartesian coordinates
or rotate
the axis. Please refer to the Wannier90 user guide and see the part
related to projections (see <A
href="http://www.wannier.org"><B>www.wannier90.org</B></A>).
<hr>
<h4><a name="4"></a></h4>
<h3><b>4. More on Wannier90 + ABINIT</b></h3>
<p>
Now we will going to redo the silicon case but defining different initial projections.
<p>This calculation will be more time consuming, so you can start by running the calculation while reading:
<li><i>cp ../tw90_4.in . </i></li>
<li><i>cp ../tw90_4.files . </i></li>
<li><i>cp ../tw90_4o_DS3_w90.win . </i></li>
<p><b> Initial projections:</b>
<p>
In this example we extract sp3 orbitals centered on the silicon
atoms. But you could also extract bonding and anti-bonding orbitals by
uncommenting and commenting the required lines as it is indicated in
tw90_4o_DS3_w90.win.
</p>
<p>
You can see that we are using <b>r=4</b> in the initial projections block.
This is to indicate that the radial part will be a Gaussian function whose width can be controlled by the value of the variable "zona". The main advantage over radial functions in the form of hydrogenic orbitals is that the time to write the .amn file will be reduced.
</p>
<p><b> Interpolated band structure</b><p>
We are going to run Wannier90 in standalone mode.
Just comment out the first two lines of the <b>.win</b> file:
<pre>
postproc_setup = .true. !used to write .nnkp file at first run
num_iter = 100
wannier_plot = .true.
wannier_plot_supercell = 3
</pre>
And uncomment the following two lines:
<pre>
!restart = plot
!bands_plot = .true.
</pre>
Now run Wannier90:
<li><i> [abinit-home]/plugins/wannier90/wannier90.x tw90_4o_DS3_w90 </i></li>
The interpolated bandstructure is in:
tw90_4o_DS3_w90_band.dat
<p>
Now you can continue discovering the capabilities of Wannier90.
</p>
<script type="text/javascript" src="list_internal_links.js"> </script>
</body></html>
|