SumK DFT Tools¶
-
class
dft.sumk_dft_tools.
SumkDFTTools
(hdf_file, h_field=0.0, use_dft_blocks=False, dft_data='dft_input', symmcorr_data='dft_symmcorr_input', parproj_data='dft_parproj_input', symmpar_data='dft_symmpar_input', bands_data='dft_bands_input', transp_data='dft_transp_input', misc_data='dft_misc_input')[source]¶ Bases:
dft.sumk_dft.SumkDFT
Extends the SumkDFT class with some tools for analysing the data.
-
__init__
(hdf_file, h_field=0.0, use_dft_blocks=False, dft_data='dft_input', symmcorr_data='dft_symmcorr_input', parproj_data='dft_parproj_input', symmpar_data='dft_symmpar_input', bands_data='dft_bands_input', transp_data='dft_transp_input', misc_data='dft_misc_input')[source]¶ Initialisation of the class. Parameters are exactly as for SumKDFT.
-
cellvolume
(lattice_type, lattice_constants, latticeangle)[source]¶ Determines the conventional und primitive unit cell volumes.
Parameters: lattice_type : string
Lattice type according to the Wien2k convention (P, F, B, R, H, CXY, CYZ, CXZ).
lattice_constants : list of double
Lattice constants (a, b, c).
lattice angles : list of double
Lattice angles (\(\alpha, \beta, \gamma\)).
Returns: vol_c : double
Conventional unit cell volume.
vol_p : double
Primitive unit cell volume.
-
conductivity_and_seebeck
(beta, method=None)[source]¶ Calculates the Seebeck coefficient and the optical conductivity by calling
transport_coefficient
. The required members (Gamma_w, directions, Om_mesh) have to be obtained first by calling the functiontransport_distribution
.Parameters: beta : double
Inverse temperature \(\beta\).
Returns: optic_cond : dictionary of double vectors
Optical conductivity in each direction and frequency given by Om_mesh.
seebeck : dictionary of double
Seebeck coefficient in each direction. If zero is not present in Om_mesh the Seebeck coefficient is set to NaN.
-
dos_parproj_basis
(mu=None, broadening=None, mesh=None, with_Sigma=True, with_dc=True, save_to_file=True)[source]¶ Calculates the orbitally-resolved DOS. Different to dos_Wannier_basis is that here we calculate projections also to non-Wannier projectors, in the flavour of Wien2k QTL calculatuions.
Parameters: mu : double, optional
Chemical potential, overrides the one stored in the hdf5 archive.
broadening : double, optional
Lorentzian broadening of the spectra. If not given, standard value of lattice_gf is used.
mesh : real frequency MeshType, optional
Omega mesh for the real-frequency Green’s function. Given as parameter to lattice_gf.
with_Sigma : boolean, optional
If True, the self energy is used for the calculation. If false, the DOS is calculated without self energy.
with_dc : boolean, optional
If True the double counting correction is used.
save_to_file : boolean, optional
If True, text files with the calculated data will be created.
Returns: DOS : Dict of numpy arrays
Contains the full density of states.
DOSproj : Dict of numpy arrays
DOS projected to atoms.
DOSproj_orb : Dict of numpy arrays
DOS projected to atoms and resolved into orbital contributions.
-
dos_wannier_basis
(mu=None, broadening=None, mesh=None, with_Sigma=True, with_dc=True, save_to_file=True)[source]¶ Calculates the density of states in the basis of the Wannier functions.
Parameters: mu : double, optional
Chemical potential, overrides the one stored in the hdf5 archive.
broadening : double, optional
Lorentzian broadening of the spectra. If not given, standard value of lattice_gf is used.
mesh : real frequency MeshType, optional
Omega mesh for the real-frequency Green’s function. Given as parameter to lattice_gf.
with_Sigma : boolean, optional
If True, the self energy is used for the calculation. If false, the DOS is calculated without self energy.
with_dc : boolean, optional
If True the double counting correction is used.
save_to_file : boolean, optional
If True, text files with the calculated data will be created.
Returns: DOS : Dict of numpy arrays
Contains the full density of states.
DOSproj : Dict of numpy arrays
DOS projected to atoms.
DOSproj_orb : Dict of numpy arrays
DOS projected to atoms and resolved into orbital contributions.
-
fermi_dis
(w, beta)[source]¶ Fermi distribution.
\[f(x) = 1/(e^x+1).\]Parameters: w : double
frequency
beta : double
inverse temperature
Returns: f : double
-
partial_charges
(beta=40, mu=None, with_Sigma=True, with_dc=True)[source]¶ Calculates the orbitally-resolved density matrix for all the orbitals considered in the input, consistent with the definition of Wien2k. Hence, (possibly non-orthonormal) projectors have to be provided in the partial projectors subgroup of the hdf5 archive.
Parameters: with_Sigma : boolean, optional
If True, the self energy is used for the calculation. If false, partial charges are calculated without self-energy correction.
beta : double, optional
In case the self-energy correction is not used, the inverse temperature where the calculation should be done has to be given here.
mu : double, optional
Chemical potential, overrides the one stored in the hdf5 archive.
with_dc : boolean, optional
If True the double counting correction is used.
Returns: dens_mat : list of numpy array
A list of density matrices projected to all shells provided in the input.
-
print_hamiltonian
()[source]¶ Prints the Kohn-Sham Hamiltonian to the text files hamup.dat and hamdn.dat (no spin orbit-coupling), or to ham.dat (with spin-orbit coupling).
-
read_transport_input_from_hdf
()[source]¶ Reads the data for transport calculations from the hdf5 archive.
-
spaghettis
(broadening=None, plot_shift=0.0, plot_range=None, ishell=None, mu=None, save_to_file='Akw_')[source]¶ Calculates the correlated band structure using a real-frequency self energy.
Parameters: mu : double, optional
Chemical potential, overrides the one stored in the hdf5 archive.
broadening : double, optional
Lorentzian broadening of the spectra. If not given, standard value of lattice_gf is used.
plot_shift : double, optional
Offset for each A(k,w) for stacked plotting of spectra.
plot_range : list of double, optional
Sets the energy window for plotting to (plot_range[0],plot_range[1]). If not provided, the energy mesh of the self energy is used.
ishell : integer, optional
Contains the index of the shell on which the spectral function is projected. If ishell=None, the total spectrum without projection is calculated.
save_to_file : string, optional
Filename where the spectra are stored.
Returns: Akw : Dict of numpy arrays
Data as it is also written to the files.
-
transport_coefficient
(direction, iq, n, beta, method=None)[source]¶ Calculates the transport coefficient A_n in a given direction for a given \(\Omega\). The required members (Gamma_w, directions, Om_mesh) have to be obtained first by calling the function
transport_distribution
. For n>0 A is set to NaN if \(\Omega\) is not 0.0.Parameters: direction : string
\(\alpha\beta\) e.g.: ‘xx’,’yy’,’zz’,’xy’,’xz’,’yz’.
iq : integer
Index of \(\Omega\) point in the member Om_mesh.
n : integer
Number of the desired moment of the transport distribution.
beta : double
Inverse temperature \(\beta\).
method : string
Integration method: cubic spline and scipy.integrate.quad (‘quad’), simpson rule (‘simps’), trapezoidal rule (‘trapz’), rectangular integration (otherwise) Note that the sampling points of the the self-energy are used!
Returns: A : double
Transport coefficient.
-
transport_distribution
(beta, directions=['xx'], energy_window=None, Om_mesh=[0.0], with_Sigma=False, n_om=None, broadening=0.0)[source]¶ Calculates the transport distribution
\[\Gamma_{\alpha\beta}\left(\omega+\Omega/2, \omega-\Omega/2\right) = \frac{1}{V} \sum_k Tr\left(v_{k,\alpha}A_{k}(\omega+\Omega/2)v_{k,\beta}A_{k}\left(\omega-\Omega/2\right)\right)\]in the direction \(\alpha\beta\). The velocities \(v_{k}\) are read from the transport subgroup of the hdf5 archive.
Parameters: beta : double
Inverse temperature \(\beta\).
directions : list of double, optional
\(\alpha\beta\) e.g.: [‘xx’,’yy’,’zz’,’xy’,’xz’,’yz’].
energy_window : list of double, optional
Specifies the upper and lower limit of the frequency integration for \(\Omega=0.0\). The window is automatically enlarged by the largest \(\Omega\) value, hence the integration is performed in the interval [energy_window[0]-max(Om_mesh), energy_window[1]+max(Om_mesh)].
Om_mesh : list of double, optional
\(\Omega\) frequency mesh of the optical conductivity. For the conductivity and the Seebeck coefficient \(\Omega=0.0\) has to be part of the mesh. In the current version Om_mesh is repined to the mesh provided by the self-energy! The actual mesh is printed on the screen and stored as member Om_mesh.
with_Sigma : boolean, optional
Determines whether the calculation is performed with or without self energy. If this parameter is set to False the self energy is set to zero (i.e. the DFT band structure \(A(k,\omega)\) is used). Note: For with_Sigma=False it is necessary to specify the parameters energy_window, n_om and broadening.
n_om : integer, optional
Number of equidistant frequency points in the interval [energy_window[0]-max(Om_mesh), energy_window[1]+max(Om_mesh)]. This parameters is only used if with_Sigma = False.
broadening : double, optional
Lorentzian broadening. It is necessary to specify the boradening if with_Sigma = False, otherwise this parameter can be set to 0.0.
-