Source code for qolossal.transport_properties

"""Methods for the calculation of transport properties.

Provided functions:

* getMobility: for the calculation of the carrier mobility.
* getDiffusion: for the calculation of the diffusion coefficient.

Copyright © 2019-2023 HQS Quantum Simulations GmbH. All Rights Reserved.
"""

import numpy as np
from typing import TypeVar

from .qolossal_tools import _HBAR_in_EV_S

float_or_ndarray = TypeVar("float_or_ndarray", float, np.ndarray)


[docs] def getMobility( conductivity: float, carrier_density: float, ) -> float: r"""Calculate electron mobility. The electron (or hole) mobility :math:`\mu_{e,h}` is defined from .. math:: \sigma = e n_{e,h} \mu_{e,h} where :math:`\sigma` is the conductivity, :math:`e` is the electron charge and :math:`n_{e,h}` is the carrier density. The units of the results depend on the input units. For the moment it is assumed the input units are Angstroms for lengths and electronvolts for energies. NOTE: this routine is sensible to the value of the inputs. Especially for cases where sharp spectral features are present around the chemical potential, the calculation of the conductivity (especially at low temperatures) might be hard to converge. Args: conductivity (float): Conductivity evaluated at the chemical potential. carrier_density (float): Carrier density at the given chemical potential. Returns: float: electron mobility in cm^2/Vs. """ # normalization factor. First factor is angstroms to cm (squared), second is simply h in ev s. # This works in all dimensions since conductivity is in e^2/h / Å^(D - 2) where D is the # dimensionality of the system and the carrier density is in units of Å^-D.. return (1e-8**2) / (_HBAR_in_EV_S * 2 * np.pi) * conductivity.real / carrier_density
[docs] def getDiffusion( dos: float_or_ndarray, conductivity: float_or_ndarray, total_volume: float, system_linear_size: int, ) -> float_or_ndarray: r"""Calculate the diffusion coefficient. The diffusion coefficient D is defined from .. math:: \sigma(E) = e^2 \rho(E) D(E) :math:`\sigma` is the conductivity, :math:`e` is the electron charge and :math:`\rho` is the density of states. The units of the results depend on the input units. For the moment it is assumed the input units are angstroms for lengths and electronvolts for energies. NOTE: this routine is sensible to the value of the inputs. Especially for cases where sharp spectral features are present around the chemical potential, the calculation of the conductivity (especially at low temperatures) might be hard to converge. Args: dos (float_or_ndarray): Density of states (integrating to 1) evalauted at a single energy or at multiple energies. conductivity (float_or_ndarray): Conductivity evaluated at the same energy(ies) as the dos. total_volume (float): total volume of the system. system_linear_size (int): total linear size of the system. Returns: float_or_ndarray: diffusion coefficients at the same energy(ies) of the provided input in units of Å^D/s. """ # FIXME: these units have to be checked! eV should cancel between conductivity and dos and # we're left with "volume" / seconds return conductivity / (_HBAR_in_EV_S * 2 * np.pi) / (dos * system_linear_size / total_volume)