diff --git a/pyewjn/dielectric/__init__.py b/pyewjn/dielectric/__init__.py index 9739da3..23bac69 100644 --- a/pyewjn/dielectric/__init__.py +++ b/pyewjn/dielectric/__init__.py @@ -3,9 +3,13 @@ from pyewjn.dielectric.nam_dielectric_coefficient_approximator import ( get_unapproximated_nam_dielectric, ) from pyewjn.dielectric.lindhard_dielectric import get_lindhard_dielectric +from pyewjn.dielectric.lindhard_dielectric_transverse import ( + get_lindhard_dielectric_transverse, +) __all__ = [ "get_nam_dielectric", "get_lindhard_dielectric", + "get_lindhard_dielectric_transverse", "get_unapproximated_nam_dielectric", ] diff --git a/pyewjn/dielectric/lindhard_dielectric_transverse.py b/pyewjn/dielectric/lindhard_dielectric_transverse.py new file mode 100644 index 0000000..2d15a24 --- /dev/null +++ b/pyewjn/dielectric/lindhard_dielectric_transverse.py @@ -0,0 +1,69 @@ +import numpy as np +from pyewjn.baskets import CalculationConstants, CalculationParams + +TRANSVERSE_THRESHOLD = 1e4 + + +class LindhardDielectricTransverse(object): + def __init__( + self, + params: CalculationParams, + constants: CalculationConstants = CalculationConstants(), + thres=TRANSVERSE_THRESHOLD, + ): + + self.series_threshold = thres + self.omega = params.omega + self.v_f = params.v_f + self.omega_p = params.omega_p + self.tau = params.tau + self.c_light = constants.c_light + + self.s = 1 / (self.tau * self.omega) + self.prefactor = 3 * (self.omega_p**2) / (self.omega**2) + + def get_eps(self): + def eps_lindhard(u_inverse_wavelength: float) -> complex: + """the lindhard dielectric function + + :param u_inverse_wavelength: u is in units of the reciprocal vacuum wavelength (omega / c_light) + :return: returns the value of epsilon, dimensionless + """ + + # converts u from inverse vacuum wavelength to inverse mean free path + # want to convert to q = vf k, where k is wavevector in SI units + q = u_inverse_wavelength * (self.v_f * self.omega) / (self.c_light) + + if u_inverse_wavelength < self.series_threshold * self.v_f / self.omega: + return eps_series(q) + else: + return eps_full_lindhard(q) + + def eps_series(q: float) -> complex: + pass + + def eps_full_lindhard(q: float) -> complex: + + return internal_eps_t_full(q, 1 / self.tau, self.omega_p, self.omega) + + return eps_lindhard + + +def internal_eps_t_full( + q: float, + nu: float, + wp: float, + w: float, +): + s = nu / w + qtw = q / w + + log_val = np.log((1 + qtw + 1j * s) / (1 - qtw + 1j * s)) + parens = 1 + 1j * s - (((1 + 1j * s) ** 2 - qtw**2) / (2 * qtw)) * log_val + return 1 - (3 / 2) * ((wp) / (w)) ** 2 * (1 / (qtw**2)) * parens + + +def get_lindhard_dielectric_transverse( + params: CalculationParams, constants: CalculationConstants = CalculationConstants() +): + return LindhardDielectricTransverse(params, constants).get_eps()