Conductivity Calculator#

class elecboltz.Conductivity(band: BandStructure, field: Sequence[float] = array([0., 0., 0.]), scattering_rate: Callable | float | None = None, scattering_kernel: ScatteringKernel | None = None, frequency: float = 0.0, correct_curvature: bool = True, quadrature_order: int = 2, 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, in units of THz, as a function of any of the parameters (wavevectors) kx, ky, kz, in units of 1/angstrom, (velocities) vx, vy, vz, in units of m/s, temperature in units of K, and energy (difference with the Fermi level) in units of meV. The function signature should have matching names for these parameters, and also collect any extra keyword arguments in **kwargs to keep the function signature consistent. Note that with this type of function signature, the function doesn’t need to explicitly specify parameters that is does not use, and the order of the parameters also doesn’t matter. Can also be a constant value instead of a function. If None, it will be calculated from the scattering kernel.

  • scattering_kernel (ScatteringKernel) – The scattering kernel. This object must contain the matrix coeffs, which stores the coefficients for each pair of basis functions in the expansion, in units of angstrom**2 THz. It must also implement the method eval_basis(index, kx, ky, kz) as input and returns the values of the basis functions at the given wavevector, at the given index in the expansion.

  • 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.

  • quadrature_order (int, optional) – The order of the quadrature used to integrate the scattering kernel. 2 should be sufficient for most cases.

  • 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.

sigma#

The conductivity tensor, which is a 3 by 3 matrix. Can be calculated using the solve method. Elements that are not calculated yet are set to zero.

Type:

numpy.ndarray

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.