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 a TBModel instance.

The PythTB interface uses the following Wannier90 output files:

  • prefix.win

  • prefix_hr.dat

  • prefix_centres.xyz

  • prefix_band.kpt (optional)

  • prefix_band.dat (optional)

The prefix.win file provides general input to Wannier90 and is here primarily to obtain the lattice vectors.

To ensure the required files prefix_hr.dat and prefix_centres.xyz are written, include the following flags in the prefix.win file:

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.dat and (ii) the centers of the Wannier functions in prefix_centres.xyz without translating them to the home unit cell.

The optional files prefix_band.kpt and prefix_band.dat can be used to import the Wannier-interpolated band structures computed by Wannier90. Please see documentation of function bands_w90() for more detail.

Parameters:
pathstr

Relative path to the folder that contains Wannier90 files. These are prefix.win, prefix_hr.dat, prefix_centres.xyz and optionally prefix_band.kpt and prefix_band.dat.

prefixstr

This is the prefix used by Wannier90 code. Typically the input to the Wannier90 code is name prefix.win.

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 formalism in 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#

pythtb.W90.bands_qe

Read band structure output from Quantum ESPRESSO bands.x.

pythtb.W90.bands_w90

Read interpolated band structure from Wannier90 output files.

pythtb.W90.dist_hop

Get distances and hopping terms of Hamiltonian in Wannier basis.

pythtb.W90.model

Get TBModel associated with this Wannier90 calculation.

pythtb.W90.shells

Get all shells of distances between Wannier function centers.

pythtb.W90.w90_bands_consistency