tbplas.Analyzer
- class tbplas.Analyzer(info_name: str, echo_details: bool = False)
Class for analyzing correlation functions.
- _info
parameters controlling TBPM calculation
- Type:
‘JobInfo’ instance
- _mpi_env
mpi parallel environment
- Type:
‘MPIEnv’ instance
- __init__(info_name: str, echo_details: bool = False) None
- Parameters:
info_name – file name of *_info.dat
echo_details – whether to output parallelization details
Methods
__init__
(info_name[, echo_details])calc_ac_cond
(corr_ac[, window])Calculate optical (AC) conductivity from correlation function.
calc_bands
(corr_bands)Calculate band structure from correlation function. :param corr_bands: (num_kpt, num_steps+1) complex128 array correlation functions for each k-point :return: (energy, bands) energy: (num_eng,) float64 array energies in eV bands: (num_kpt, num_eng) complex128 array weight function (DOS) for each k-point.
calc_dc_cond
(corr_dos, corr_dc[, ...])Calculate electronic (DC) conductivity at zero temperature from its correlation function.
calc_dc_cond_t
(corr_dos, corr_dc[, ...])Similar as calc_dc_cond, but keeps the integral of correlation function up to each time step. :param corr_dos: (num_steps,) complex128 array dimensionless DOS correlation function :param corr_dc: (2, num_eng, num_steps_dc) complex128 array DC conductivity correlation function in e^2/hbar^2 * (eV)^2 * nm^2 :param window_dos: window function for DOS integral :param window_dc: window function for DC integral :return: (energies, dc) energies: (num_eng,) float64 array energies in eV dc: (2, num_eng, num_steps_dc) float64 array dc conductivity values integrated up to each time step for xx and yy directions in the same unit as ac conductivity.
calc_diff_coeff
(corr_dc[, window_dc])Calculate diffusion coefficient form DC correlation function.
calc_dos
(corr_dos[, window])Calculate DOS from correlation function.
calc_dyn_pol
(corr_dyn_pol[, window])Calculate dynamical polarization from correlation function.
calc_epsilon
(dyn_pol)Calculate dielectric function from dynamical polarization. :param dyn_pol: (num_qpt, num_steps) complex128 array dynamical polarization :return: (num_qpt, num_steps) complex128 array dielectric function.
calc_epsilon_q0
(omegas, ac_cond)Calculate dielectric function from AC conductivity for q=0. :param omegas: (num_steps,) float64 array energies in eV :param ac_cond: (4, num_steps) complex128 array AC conductivity in e**2/(hbar*nm) in 3d case along xx, yx, xy, yy directions :return: (4, num_steps) complex128 array relative dielectric function.
Attributes
Wrapper for determine the master process for compatibility.
- __init__(info_name: str, echo_details: bool = False) None
- Parameters:
info_name – file name of *_info.dat
echo_details – whether to output parallelization details
- calc_ac_cond(corr_ac: ~numpy.ndarray, window: ~typing.Callable = <function window_exp>) Tuple[ndarray, ndarray]
Calculate optical (AC) conductivity from correlation function.
Reference: eqn. 300-301 of graphene note.
The unit of AC conductivity in 2d case follows: [sigma] = [1/(hbar * omega * A)] * [j^2] * [dt]
= 1/(eV*nm^2) * e^2/hbar^2 * (eV)^2 * nm^2 * hbar/eV = e^2/hbar
which is consistent with the results from Lindhard function.
The reason for num_orbitals in the prefactor is that every electron contribute freely to the conductivity, and we have to take the number of electrons into consideration. See eqn. 222-223 of the note for more details.
- Parameters:
corr_ac – (4, num_steps) complex128 array AC correlation function along xx, yx, xy, yy directions Unit is e^2/hbar^2 * (eV)^2 * nm^2.
window – window function for integral
- Returns:
(omegas, ac_cond) omegas: (num_steps,) float64 array frequencies in eV ac_cond: (4, num_steps) complex128 array ac conductivity values corresponding to omegas for 4 directions (xx, yx, xy, yy, respectively) The unit is e^2/(hbar*nm) in 3d case and e^2/hbar in 2d case.
- calc_bands(corr_bands: ndarray) Tuple[ndarray, ndarray]
Calculate band structure from correlation function. :param corr_bands: (num_kpt, num_steps+1) complex128 array
correlation functions for each k-point
- Returns:
(energy, bands) energy: (num_eng,) float64 array energies in eV bands: (num_kpt, num_eng) complex128 array weight function (DOS) for each k-point
- calc_dc_cond(corr_dos: ~numpy.ndarray, corr_dc: ~numpy.ndarray, window_dos: ~typing.Callable = <function window_hanning>, window_dc: ~typing.Callable = <function window_exp>) Tuple[ndarray, ndarray]
Calculate electronic (DC) conductivity at zero temperature from its correlation function.
Reference: eqn. 381 of graphene note.
The unit of DC conductivity in 2d case follows: [sigma] = [D/A] * [j^2] * [dt]
= 1/(eV*nm^2) * e^2/hbar^2 * (eV)^2 * nm^2 * hbar/eV = e^2/hbar
which is consistent with the result of Lindhard function.
NOTE: the xy and yx components of conductivity are not accurate. So they will not be evaluated.
NOTE: Here we need to call analyze_corr_dos to obtain DOS, which is intended to analyze the result of calc_corr_dos by design. As in the c++ extension, the results of calc_corr_dos and calc_corr_ldos have the length of num_steps+1, while that of calc_corr_dc has length of num_steps. This is due to incomplete update of the source code. tbpm_dos and tbpm_ldos have been update, while other subroutines are not. So here we need to insert 1.0 to the head of corr_dos by calc_corr_dc before calling analyze_corr_dos.
- Parameters:
corr_dos – corr_dos: (num_steps,) complex128 array dimensionless DOS correlation function
corr_dc – (2, num_eng, num_steps_dc) complex128 array DC conductivity correlation function in e^2/hbar^2 * (eV)^2 * nm^2
window_dos – window function for DOS integral
window_dc – window function for DC integral
- Returns:
(energies, dc) energies: (num_eng,) float64 array energies in eV dc: (2, num_eng) float64 array dc conductivity values for xx and yy directions in the same unit as ac conductivity
- calc_dc_cond_t(corr_dos: ~numpy.ndarray, corr_dc: ~numpy.ndarray, window_dos: ~typing.Callable = <function window_hanning>, window_dc: ~typing.Callable = <function window_exp>) Tuple[ndarray, ndarray]
Similar as calc_dc_cond, but keeps the integral of correlation function up to each time step. :param corr_dos: (num_steps,) complex128 array
dimensionless DOS correlation function
- Parameters:
corr_dc – (2, num_eng, num_steps_dc) complex128 array DC conductivity correlation function in e^2/hbar^2 * (eV)^2 * nm^2
window_dos – window function for DOS integral
window_dc – window function for DC integral
- Returns:
(energies, dc) energies: (num_eng,) float64 array energies in eV dc: (2, num_eng, num_steps_dc) float64 array dc conductivity values integrated up to each time step for xx and yy directions in the same unit as ac conductivity
- calc_diff_coeff(corr_dc: ~numpy.ndarray, window_dc: ~typing.Callable = <function window_exp>) Tuple[ndarray, ndarray]
Calculate diffusion coefficient form DC correlation function.
Reference: eqn. 43-44 of feature article.
The unit of diff_coeff follows: [diff_coeff] = [1/e^2] * [j^2] * [dt]
= 1/e^2 * e^2/hbar^2 * (eV)^2 * nm^2 * hbar/eV = eV*nm^2/hbar
which does not depend on system dimension.
TODO: consider spin degeneracy?
- Parameters:
corr_dc – (2, num_eng, num_steps_dc) complex128 array DC conductivity correlation function in e^2/hbar^2 * (eV)^2 * nm^2
window_dc – window function for DC integral
- Returns:
(time, diff_coeff) time: (num_steps,) float64 array time for diffusion coefficient in hbar/eV diff_coeff: (2, num_eng, num_steps) complex128 array diffusion coefficient in nm^2/(hbar/eV)
- calc_dos(corr_dos: ~numpy.ndarray, window: ~typing.Callable = <function window_hanning>) Tuple[ndarray, ndarray]
Calculate DOS from correlation function.
Reference: eqn. 16-17 of feature article.
- The unit of dos follows:
[dos] = [C_DOS] [dt] = hbar / eV
So possibly the formula misses a hbar on the denominator. Anyway, the DOS is correct since it is explicitly normalized to 1.
- Parameters:
corr_dos – (num_steps+1, ) complex128 array dimensionless DOS correlation function
window – window function for integral
- Returns:
(energies, dos) energies: (2*num_steps,) float64 array energies in eV dos: (2*num_steps,) float64 array DOS in 1/eV
- calc_dyn_pol(corr_dyn_pol: ~numpy.ndarray, window: ~typing.Callable = <function window_exp_ten>) Tuple[ndarray, ndarray, ndarray]
Calculate dynamical polarization from correlation function.
Reference: https://journals.aps.org/prb/abstract/10.1103/PhysRevB.84.035439
The unit of dp in 2d case follows: [dp] = [1/A] * [C_DP] * [dt]
= 1/nm^2 * 1 * hbar/eV = hbar/(eV*nm^2)
which is inconsistent with the output of Lindhard! So, possibly the formula misses a hbar on the denominator.
- Parameters:
corr_dyn_pol – (num_qpt, num_steps) float64 array dimensionless dynamical polarization correlation function.
window – window function for integral
- Returns:
(q_points, omegas, dyn_pol) q_points: (num_qpt, 3) float64 array Cartesian coordinates of q-points in 1/nm omegas: (num_steps,) float64 array frequencies in eV dyn_pol: (num_qpt, num_steps) complex128 array dynamical polarization values corresponding to q-points and omegas The unit is 1/(eV*nm^2) or 1/(eV*nm^3) depending on the dimension.
- calc_epsilon(dyn_pol: ndarray) ndarray
Calculate dielectric function from dynamical polarization. :param dyn_pol: (num_qpt, num_steps) complex128 array
dynamical polarization
- Returns:
(num_qpt, num_steps) complex128 array dielectric function
- calc_epsilon_q0(omegas: ndarray, ac_cond: ndarray) ndarray
Calculate dielectric function from AC conductivity for q=0. :param omegas: (num_steps,) float64 array
energies in eV
- Parameters:
ac_cond – (4, num_steps) complex128 array AC conductivity in e**2/(hbar*nm) in 3d case along xx, yx, xy, yy directions
- Returns:
(4, num_steps) complex128 array relative dielectric function
- __weakref__
list of weak references to the object
- property is_master: bool
Wrapper for determine the master process for compatibility.