pythtb.W90.bands_w90#

W90.bands_w90(return_k_cart=False, return_k_dist=False, return_k_nodes=False)[source]#

Read interpolated band structure from Wannier90 output files.

The purpose of this function is to compare the interpolation in Wannier90 with that in PythTB. This function reads in the band structure as interpolated by Wannier90.

The code assumes that the following files were generated by Wannier90,

  • prefix_band.kpt

  • prefix_band.dat

These files will be generated only if the prefix.win file contains the kpoint_path block.

Parameters:
return_k_cartbool, optional

If True, also return k-points in Cartesian coordinates.

Added in version 2.0.0.

return_k_distbool, optional

If True, also return the cumulative k-path distance (in inverse Angstroms).

Added in version 2.0.0.

return_k_nodesbool, optional

If True, also return the k-point nodes and labels used in the path. Format is (k_nodes, k_labels) where k_nodes is an array of reduced coordinates and k_labels is a list of strings.

Added in version 2.0.0.

Returns:
kptsarray

k-points in reduced coordinates used in the interpolation in Wannier90 code. The expected format is the same as the input to pythtb.TBModel.solve_ham().

energyarray

Energies interpolated by Wannier90 in eV. Format is energy[kpt,band].

k_distarray, optional

Cumulative distances along the path (1/Angstrom) as reported by Wannier90. Returned when return_k_dist=True. Useful for plotting band structures.

k_cartarray, optional

k-points in Cartesian coordinates (1/Angstrom). Returned when return_k_cart=True.

k_nodestuple[array, list[str]], optional

Tuple (k_nodes, k_labels) containing the reduced coordinates of the k-point nodes and their labels. Returned when return_k_nodes=True.

Notes

  • The bands returned here are not the same as the band structure calculated by the underlying DFT code. The two will agree only on the coarse set of k-points that were used in Wannier90 generation.

  • If no matrix elements were ignored in the call to pythtb.w90.model() then the two should be exactly the same (up to numerical precision). Otherwise one should expect deviations.

  • If one carefully chooses the cutoff parameters in pythtb.w90.model() it is likely that one could reproduce the full band-structure with only few dominant hopping terms.

Examples

Get band structure from Wannier90

>>> w90_kpt, w90_evals, w90_k_dist, w90_k_nodes, w90_k_labels = silicon.bands_w90(
... return_k_dist=True, return_k_nodes=True)

Get simplified model

>>> my_model_simple = silicon.model(min_hopping_norm=0.01)

Solve simplified model on the same k-path as in Wannier90

>>> evals = my_model.solve_ham(w90_kpt)

Now plot the comparison of the two

>>> import matplotlib.pyplot as plt
>>> fig, ax = plt.subplots()
>>> for i in range(evals.shape[1]):
>>>     ax.plot(range(evals.shape[1]), evals[i], "r-", zorder=-50)
>>> for i in range(w90_evals.shape[0]):
>>>     ax.plot(range(w90_evals.shape[1]), w90_evals[i], "k-", zorder=-100)
>>> fig.savefig("comparison.pdf")