Conductivity Calculator#
- class elecboltz.Conductivity(band: BandStructure, field: Sequence[float] = array([0., 0., 0.]), scattering_rate: Callable | float | None = None, scattering_kernel: Callable | None = None, scattering_params: dict[str, float | ~collections.abc.Sequence[float]]={}, frequency: float = 0.0, correct_curvature: bool = True, solver: Callable = <function spsolve>, Bamp: float = None, Btheta: float = None, Bphi: float = None, **kwargs)#
Calculates the conductivity of a material solving the Boltzmann transport equation using a finite element method (FEM).
- Parameters:
band (BandStructure) – The class holding band structure information of the material.
field (Sequence[float]) – The magnetic field in the x, y, and z directions in units of Tesla.
scattering_rate (Callable or float or None) – The (out-)scattering rate as a function of kx, ky, and kz, in units of THz. Can also be a constant value instead of a function. If None, it will be calculated from the scattering kernel.
scattering_kernel (Callable or None) – The scattering kernel as a function of a pair of coordinates
(kx, ky, kz)and(kx', ky', kz'), in units of angstrom THz. All coordinates are given to the function in order, so the function signature would beC(kx, ky, kz, kx', ky', kz', **kwargs). Be sure to collect the scattering parameters in**kwargsregardless of whether you use any, to keep the function signature consistent. If None, the scattering rate should be specified instead.scattering_params (dict[str, float or Sequence[float]], optional) – Extra parameters passed to the scattering kernel or the scattering rate function.
frequency (float) – The frequency of the applied field in units of THz.
correct_curvature (bool, optional) – If True, correct for the curvature of the Fermi surface.
solver (Callable, optional) – The solver used to solve the linear system. Takes the (sparse) matrix as the first argument and the right-hand side as the second argument. When using a custom solver, keep in mind that the right-hand side might not be a vector. So, solvers that only work with vectors need to be adapted to solve each column of the right-hand side separately.
Bamp (float, optional) – The amplitude of the magnetic field in units of Tesla. If provided, it will be used to set the field.
Btheta (float, optional) – The polar angle of the magnetic field in units of degrees. If provided, it will be used to set the field.
Bphi (float, optional) – The azimuthal angle of the magnetic field in units of degrees. If provided, it will be used to set the field.
- band#
The class holding band structure information of the material.
- Type:
- field#
The magnetic field in the x, y, and z directions in units of Tesla.
- Type:
Sequence[float] or None
- scattering_rate#
The (out-)scattering rate as a function of kx, ky, and kz. Can also be a constant value instead of a function. If initialized as None, it will be calculated from the scattering kernel upon the next calculation.
- Type:
Callable or float or Sequence[float] or None
- scattering_kernel#
The scattering kernel, as a function of a pair of coordinates
(kx, ky, kz)and(kx', ky', kz')in units of angstrom, which returns values in units of angstrom^2 THz. All coordinates are given to the function in order, so the function signature would beC(kx, ky, kz, kx', ky', kz'). If None, the scattering rate should be specified instead. The out-scattering rate will be calculated from the scattering kernel if the scattering rate is not provided.- Type:
Callable or None
- scattering_params#
Extra parameters passed to the scattering kernel or the scattering rate function.
- Type:
dict[str, float or Sequence[float]], optional
- frequency#
The frequency of the applied field in units of THz. If non-zero, the conductivity output will be complex.
- Type:
float
- sigma#
The conductivity tensor, which is a 3 by 3 matrix. Can be calculated using the
solvemethod. Elements that are not calculated yet are set to zero.- Type:
numpy.ndarray
- correct_curvature#
Whether to correct for the curvature of the Fermi surface.
- Type:
bool
- solver#
The solver used to solve the linear system.
- Type:
Callable
- calculate(i: Sequence[int] | int | None = None, j: Sequence[int] | int | None = None) ndarray | float#
Calculate the conductivity tensor.
- Parameters:
i (Sequence[int] or int or None, optional) – The index of the first component (row) of the conductivity tensor. If None (default), all components are calculated.
j (Sequence[int] or int or None, optional) – The index of the second component (column) of the conductivity tensor. If None (default), all components are calculated.
- Returns:
The conductivity tensor component(s) as an i by j matrix.
- Return type:
numpy.ndarray or float
- erase_memory(elements: bool = True, scattering: bool = True, derivative: bool = True)#
Erase saved calculations to free memory.
This class saves already calculated values for the FEM elements and matrices to avoid recalculating them every time a new element of the conductivity tensor is calculated or a new field is applied. This method is provided to erase those values when no new calculations are needed and the memory can be freed.
- Parameters:
elements (bool, optional) – If True, erase the quantities for each element, like the lengths and velocities.
scattering (bool, optional) – If True, erase the out-scattering and in-scattering terms.
derivative (bool, optional) – If True, erase the derivative term.