Classes#

For now, there is the WannierTBmodel class:

class spinWannier.WannierTBmodel.WannierTBmodel(seedname='wannier90', sc_dir='0_self-consistent', nsc_dir='1_non-self-consistent', wann_dir='2_wannier', bands_dir='1_band_structure', output_dir='3_wann_interp_plot_and_quality', tb_model_dir_in_output_dir='tb_model_wann90', spn_formatted=False, spn_file_extension='spn', data_saving_format='npz', band_for_Fermi_correction=None, kpoint_for_Fermi_correction='0.0000000E+00  0.0000000E+00  0.0000000E+00', verbose=False)#

Bases: object

Calculates interpolated spin-texture on a dense k-point path. Plots the spin-texture on a 2D k-point mesh (Fermi surface). Calculates the quality of the Wannier functions.

Needed files are
  1. wannier90.eig

  2. wannier90.win

  3. wannier90.spn (or the WAVECAR file of VASP)

  4. wannier90_u.mat

  5. wannier90_u_dis.mat (if disentanglement was performed)

  6. (FERMI_ENERGY.in file containing the Fermi energy value)

PROCEDURE:
Take the
  1. spn_dict.dat and

  2. u_dis_dict.dat along with

  3. u_dict.dat

to obtain the S_mn(W), i.e., the spn matrix in the Wannier gauge.

Then interpolate on an arbitrary k-point by performing the
  1. Fourier transform to real space (on the coarse DFT k-point grid) and then

  2. inverse Fourier transform with an arbitrary k-point.

Interpolate the Hamiltonian on a dense k-point grid:
  1. Take the diagonal Hamiltonian from DFT (the eigenvalues for the coarse k-point grid).

  2. Apply the U(dis) and U to get the Hamiltonian in Wannier gauge H_mn(W).

  3. inverse Fourier transform for an arbitrary k-point (dense k-point mesh).

interpolate_bands_and_spin(kpoint_matrix, fout='bands_spin', kpath_ticks=None, kmesh_2D=False, kmesh_density=101, kmesh_2D_limits=[-0.5, 0.5], force_recalculate=False, save_real_space_operators=True, save_folder_in_output_dir='tb_model_wann90/', save_bands_spin_texture=True)#

Interpolate the bands and the spin texture on a dense k-point path or 2D mesh.

Parameters:
  • kpoint_matrix (list) – List of k-points in the path.

  • fout (str, optional) – Output file name. Defaults to ‘bands_spin’.

  • kpath_ticks (list, optional) – List of k-point ticks. Defaults to None.

  • kmesh_2D (bool, optional) – Whether to interpolate on a 2D mesh. Defaults to False.

  • kmesh_density (int, optional) – Density of the k-point mesh. Defaults to 101.

  • kmesh_2D_limits (list, optional) – Limits of the 2D mesh. Defaults to [-0.5, 0.5].

  • save_real_space_operators (bool, optional) – Whether to save the real space operators as dictionary files. Defaults to True.

  • save_folder_in_output_dir (str, optional) – Folder to save the data in the model directory. Defaults to “tb_model_wann90/”.

  • save_bands_spin_texture (bool, optional) – Whether to save the bands and spin texture. Defaults to True.

plot1D_bands(fout='spin_texture_1D_home_made.jpg', yaxis_lim=[-8, 6], savefig=True, showfig=True)#

Plot the bands and the spin texture on a 1D path.

Parameters:
  • fout (str, optional) – Output figure name. Defaults to ‘spin_texture_1D_home_made.jpg’. Will be saved to the ‘output_dir’ directory.

  • yaxis_lim (list, optional) – Y-axis limits. Defaults to [-8, 6].

  • savefig (bool, optional) – Whether to save the figure. Defaults to True.

  • showfig (bool, optional) – Whether to show the figure. Defaults to True.

plot2D_spin_texture(fin_2D='bands_spin_2D', fin_1D='bands_spin', fig_name='spin_texture_2D_home_made.jpg', E_to_cut=None, savefig=True, showfig=True, E_window=0.02, n_points_for_one_angstrom_radius=60, quiver_scale=1.6)#

Plot the spin texture on a 2D mesh (Fermi surface).

Parameters:
  • fin_2D (str, optional) – File name of the 2D mesh data. Defaults to ‘bands_spin_2D’.

  • fin_1D (str, optional) – File name of the 1D path data. Defaults to ‘bands_spin’.

  • fig_name (str, optional) – Output figure name. Defaults to “spin_texture_2D_home_made.jpg”.

  • E_to_cut (float, optional) – Energy to cut. Defaults to None.

  • savefig (bool, optional) – Whether to save the figure. Defaults to True.

  • showfig (bool, optional) – Whether to show the figure. Defaults to True.

  • E_window (float, optional) – Energy window in eV around the Fermi level where the points for Fermi surface determination will be looked for. Defaults to 0.020.

  • n_points_for_one_angstrom_radius (int, optional) – Number of points for one Angstrom radius. Defaults to 180.

wannier_quality(yaxis_lim=[-10, 10], savefig=True, showfig=True)#

Calculate the quality of the Wannier functions compared to the original DFT band structure.

Parameters:
  • band_for_Fermi_correction (_type_, optional) – Band number for Fermi correction. Defaults to None -> the lowest Wannier band wil be used.

  • kpoint_for_Fermi_correction (_type_, optional) – K-point for Fermi correction. Defaults to ‘0.0000000E+00 0.0000000E+00 0.0000000E+00’ (Gamma point).

  • yaxis_lim (list, optional) – Limits of the y-axis. Defaults to [-10, 10].

  • savefig (bool, optional) – Whether to save the figure. Defaults to True.

  • showfig (bool, optional) – Whether to show the figure. Defaults to

wannier_quality_calculation(kpoint_matrix, NK, kpath_ticks, yaxis_lim=None, savefig=True, showfig=True)#

Calculate the quality of the Wannierization.

Needed files from VASP:

= nsc_calculation_path:
  • EIGENVAL

  • DOSCAR

= dft_bands_folder:
  • EIGENVAL

  • “Sxyz_exp_values_from_spn_file.dat” (get automatically from wannier90.spn_formatted!!)

  • OUTCAR

Parameters:
  • kpoint_matrix (np.array) – K-point matrix.

  • NK (int) – Number of k-points.

  • kpath_ticks (list) – K-path ticks.

  • Fermi_nsc_wann (float) – Fermi energy in the non-self-consistent calculation.

  • yaxis_lim (list, optional) – Y-axis limits. Defaults to None.

  • savefig (bool, optional) – Save the figure. Defaults to True.

  • showfig (bool, optional) – Show the figure. Defaults to True.

Returns:

Error by energy.

Return type:

np.array