pythtb.W90#
- class W90(path, prefix)[source]#
Interface to Wannier90
Wannier90 is a post-processing tool that takes as input Bloch wavefunctions and energies generated by first-principles electronic structure codes such as Quantum-Espresso (PWscf), ABINIT, SIESTA, FLEUR, WIEN2k, or VASP. It produces maximally localized Wannier functions together with a tight-binding Hamiltonian in the Wannier basis [1].
This class imports tight-binding model parameters from a Wannier90 calculation and makes them available in PythTB. Upon construction, it reads the relevant Wannier90 output files from the specified directory. Use
model()to convert the imported data into aTBModelinstance.The PythTB interface uses the following Wannier90 output files:
prefix.winprefix_hr.datprefix_centres.xyzprefix_band.kpt(optional)prefix_band.dat(optional)
The
prefix.winfile provides general input to Wannier90 and is here primarily to obtain the lattice vectors.To ensure the required files
prefix_hr.datandprefix_centres.xyzare written, include the following flags in theprefix.winfile:write_hr = True write_xyz = True translate_home_cell = False
These directives instruct Wannier90 to output (i) the real-space tight-binding Hamiltonian in
prefix_hr.datand (ii) the centers of the Wannier functions inprefix_centres.xyzwithout translating them to the home unit cell.The optional files
prefix_band.kptandprefix_band.datcan be used to import the Wannier-interpolated band structures computed by Wannier90. Please see documentation of functionbands_w90()for more detail.- Parameters:
- pathstr
Relative path to the folder that contains Wannier90 files. These are
prefix.win,prefix_hr.dat,prefix_centres.xyzand optionallyprefix_band.kptandprefix_band.dat.- prefixstr
This is the prefix used by Wannier90 code. Typically the input to the Wannier90 code is name
prefix.win.
See also
Notes
Units used throught this interface with Wannier90 are electron-volts (eV) and Angstroms.
Warning
This class has been tested on Wannier90 v3.1.0. Compatibility with other versions is not guaranteed.
Warning
The user needs to make sure that the Wannier functions computed using Wannier90 code are well localized. Otherwise the tight-binding model may not accurately interpolate the band structure. To ensure that the Wannier functions are well localized it is often enough to check that the total spread at the beginning of the minimization procedure (first total spread printed in .wout file) is not more than 20% larger than the total spread at the end of the minimization procedure. If those spreads differ by much more than 20% user needs to specify better initial projection functions.
Warning
The interpolation is only exact within the frozen energy window of the disentanglement procedure.
Warning
So far PythTB assumes that the position operator is diagonal in the tight-binding basis. This is discussed in the
notes on tight-binding formalismin Eq. 2.7., \(\langle\phi_{{\bf R} i} \vert {\bf r} \vert \phi_{{\bf R}' j} \rangle = ({\bf R} + {\bf t}_j) \delta_{{\bf R} {\bf R}'} \delta_{ij}\). However, this relation does not hold for Wannier functions! Therefore, if you use tight-binding model derived from this class in computing Berry-like objects that involve position operator such as Berry phase or Berry flux, you would not get the same result as if you computed those objects directly from the first-principles code! Nevertheless, this approximation does not affect other properties such as band structure dispersion.References
[1]“Wannier90 as a community code: new features and applications”, G. Pizzi et al., J. Phys. Cond. Matt. 32, 165902 (2020).
Examples
Read Wannier90 from folder called example_a This assumes that that folder contains files “silicon.win” (and so on)
>>> silicon = w90("example_a", "silicon")
Methods#
Read band structure output from Quantum ESPRESSO bands.x. |
|
Read interpolated band structure from Wannier90 output files. |
|
Get distances and hopping terms of Hamiltonian in Wannier basis. |
|
Get TBModel associated with this Wannier90 calculation. |
|
Get all shells of distances between Wannier function centers. |
|