elli package
Subpackages
Submodules
elli.experiment module
- class elli.experiment.Experiment(structure, lbda, theta_i, vector=[1, 0, 1, 0])[source]
Bases:
objectDescription of a virtual experiment to simulate the behavior of a structure.
Creates a virtual experiment to simulate the behavior of a structure.
- Parameters
- evaluate(solver=<class 'elli.solver4x4.Solver4x4'>, **solver_kwargs)[source]
Evaluates the experiment with the given solver.
- jones_vector = None
- lbda = None
- set_lbda(lbda)[source]
Set experiment wavelengths.
- Parameters
lbda (npt.ArrayLike) – single value or array of wavelengths (in nm).
- set_structure(structure)[source]
Defines the Structure to evaluate.
- Parameters
structure (Structure) – Structure object to evaluate.
- set_theta(theta_i)[source]
Set incident angle to evaluate.
- Parameters
theta_i (float) – Incident angle (in degrees).
- set_vector(vector)[source]
Defines the Jones or Stokes vector of the incident Light.
Jones: [1, 0]: horizontal polarized [0, 1]: vertical polarized [1/sqrt(2), 1/sqrt(2)]: diagonal polarized [1/sqrt(2),-1/sqrt(2)]: anti-diagonal polarized
Stokes: [1,0,0,0]: unpolarized light [1,1,0,0]: horizontal polarized [1,-1,0,0]: vertical polarized [1,0,1,0]: diagonal polarized [1,0,-1,0]: anti-diagonal polarized
- Parameters
vector (npt.ArrayLike) – Jones or Stokes vector of incident light.
- stokes_vector = None
- structure = None
- theta_i = None
elli.materials module
- class elli.materials.BiaxialMaterial(law_x, law_y, law_z)[source]
Bases:
elli.materials.SingleMaterialBiaxial material.
Creates a biaxial material with three dispersion laws.
- Parameters
law_x (DispersionLaw) – Dispersion relation for x crystal axes.
law_y (DispersionLaw) – Dispersion relation for y crystal axes.
law_z (DispersionLaw) – Dispersion relation for z crystal axes.
- class elli.materials.IsotropicMaterial(law)[source]
Bases:
elli.materials.SingleMaterialIsotropic material.
Creates isotropic material with a dispersion law.
- Parameters
law (DispersionLaw) – Dispersion relation of all three crystal directions.
- class elli.materials.LooyengaEMA(host_material, guest_material, fraction)[source]
Bases:
elli.materials.MixtureMaterialMixture Material approximated with Looyenga’s formula. Valid if materials have small contrast. Looyenga, H. (1965). Physica, 31(3), 401–406.
Creates a material mixture from two materials.
- Parameters
- class elli.materials.Material[source]
Bases:
abc.ABCBase class for materials (abstract).
- class elli.materials.MaxwellGarnetEMA(host_material, guest_material, fraction)[source]
Bases:
elli.materials.MixtureMaterialMixture Material approximated with the Maxwell Garnet formula. It is valid for spherical inclusions with small volume fraction.
Creates a material mixture from two materials.
- Parameters
- class elli.materials.MixtureMaterial(host_material, guest_material, fraction)[source]
Bases:
elli.materials.MaterialAbstract Class for mixed materials.
Creates a material mixture from two materials.
- Parameters
- fraction = None
- abstract get_tensor(lbda)[source]
Gets the permittivity tensor of the marterial for wavelength ‘lbda’.
- Parameters
lbda (npt.ArrayLike) – Single value or array of wavelengths (in nm).
- Returns
Permittivity tensor.
- Return type
npt.NDArray
- guest_material = None
- host_material = None
- class elli.materials.SingleMaterial[source]
Bases:
elli.materials.MaterialBase class for non mixed materials (abstract).
- get_tensor(lbda)[source]
Gets the permittivity tensor of the marterial for wavelength ‘lbda’.
- Parameters
lbda (npt.ArrayLike) – Single value or array of wavelengths (in nm).
- Returns
Permittivity tensor.
- Return type
npt.NDArray
- law_x = None
- law_y = None
- law_z = None
- rotated = False
- rotation_matrix = None
- class elli.materials.UniaxialMaterial(law_o, law_e)[source]
Bases:
elli.materials.SingleMaterialUniaxial material.
Creates a uniaxial material with two dispersion laws.
- Parameters
law_o (DispersionLaw) – Dispersion relation for ordinary crystal axes (x and y direction).
law_e (DispersionLaw) – Dispersion relation for extraordinary crystal axis (z direction).
- class elli.materials.VCAMaterial(host_material, guest_material, fraction)[source]
Bases:
elli.materials.MixtureMaterialMixture Material approximated with a simple virtual crystal like average.
Creates a material mixture from two materials.
- Parameters
elli.materials_db module
elli.math module
- elli.math.lambda2E(lbda)[source]
Converts wavelength values to energy values. E = c * h_bar / lambda
- Parameters
lbda (npt.ArrayLike) – Single value or array of wavelengths in ‘nm’
- Returns
Energy in eV
- Return type
npt.ArrayLike
- elli.math.rotation_euler(p, n, r)[source]
Returns rotation matrix defined by Euler angles p, n, r.
Successive rotations : z,x’,z’ Note : The inverse rotation is -r, -n, -p
- elli.math.rotation_v(v)[source]
Returns rotation matrix defined by a rotation vector v.
The calculation is made with the matrix exponential M_R = exp(W), with W_{ij} = - ε_{ijk} V_{k}, where ε_{ijk} is the Levi-Civita antisymmetric tensor. If V is separated in a unit vector v and a magnitude θ, V = θ·v, with θ = ∥V∥, the calculation of the matrix exponential is avoided, and only sin(θ) and cos(θ) are needed instead.
Note : The inverse rotation is -v
- Parameters
v (npt.ArrayLike) – rotation vector (list or array)
- Returns
rotation matrix M_R
- Return type
npt.NDArray
- elli.math.rotation_v_theta(v, theta)[source]
Returns rotation matrix defined by a unit rotation vector and an angle.
Notes : The inverse rotation is (v,-theta)
- Parameters
v (npt.ArrayLike) – unit vector orienting the rotation (list or array)
theta (float) – rotation angle around v in degrees
- Returns
rotation matrix M_R
- Return type
npt.NDArray
elli.result module
- class elli.result.Result(experiment, jones_matrix_r, jones_matrix_t, power_correction=None)[source]
Bases:
objectRecord of a simulation result.
Creates result object, to store simulation data. Gets called by solvers.
- Parameters
experiment (Experiment) – Evalatued experiment, with structure and experimental parameters.
jones_matrix_r (npt.NDArray) – Jones matrix for the reflection direction.
jones_matrix_t (npt.NDArray) – Jones matrix for the transmission direction.
power_correction (npt.NDArray) – Correction factors, to get the power transmission values.
- property R
- property Rc
- property T
- property Tc
- property delta
- property delta_matrix
- get(name)[source]
Return the data for the requested variable ‘name’.
- Parameters
name (str) – Variable name to return. Examples for ‘name’: ‘r_sp’ : Amplitude reflection coefficient from ‘s’ to ‘p’ polarization. ‘r_LR’ : Reflection from circular right to circular left polarization. ‘T_pp’ : Power transmission coefficient from ‘p’ to ‘p’ polarization. ‘Ψ_ps’, ‘Δ_pp’ : Ellipsometry parameters. ‘psi’, ‘delta’, ‘rho’: Reduced ellipsometry parameters, the whole matricies are returned by ‘psi_matrix’.
- Returns
Array of data.
- Return type
npt.NDArray
- property jones_matrix_r
- property jones_matrix_rc
- property jones_matrix_t
- property jones_matrix_tc
- property mueller_matrix
- property psi
- property psi_matrix
- property rho
- property rho_matrix
elli.solver module
- class elli.solver.Solver(experiment)[source]
Bases:
abc.ABCSolver base class to evaluate Experiment objects. Here the experiment and structure get unpacked and the simulation results get returned.
The actual simulation is handled by subclasses. Because of this, this class should never be called.
- experiment = None
- jones_vector = None
- lbda = None
- permittivity_profile = None
- structure = None
- theta_i = None
elli.solver2x2 module
- class elli.solver2x2.Solver2x2(experiment)[source]
Bases:
elli.solver.SolverSolver class to evaluate Experiment objects. Simple but fast 2x2 transfer matrix method. Cannot handle anisotropy or anything fancy, thus Jonas and Mueller matrices cannot be calculated (respective functions return None).
- static fresnel(n_i, n_t, th_i, th_t)[source]
Calculate fresnel coefficients at the interface of two materials
n_i: Refractive index of the material of the incident wave n_t: Refractive index of the material of the transmitted wave thi_i: Incident angle of the incident wave thi_t: Refracted angle of the transmitted wave
- Returns
s-polarized reflection coefficient r_p: p-polarized reflection coefficient t_s: s-polarized transmission coefficient t_p: p-polarized transmission coefficient
- Return type
r_s
elli.solver4x4 module
- class elli.solver4x4.Propagator[source]
Bases:
abc.ABCPropagator abstract base class.
- abstract calculate_propagation(delta, h, lbda)[source]
Calculates propagation for a given Delta matrix and layer thickness.
- Parameters
delta (npt.NDArray) – Delta Matrix
h (float) – Thickness of layer (nm)
lbda (npt.ArrayLike) – Wavelengths to evaluate (nm)
- Returns
Propagator for the given layer
- Return type
npt.NDArray
- class elli.solver4x4.PropagatorEig[source]
Bases:
elli.solver4x4.PropagatorPropagator class using the eigenvalue decomposition method.
- calculate_propagation(delta, h, lbda)[source]
Calculates propagation for a given Delta matrix and layer thickness with eigenvalue decomposition.
- Parameters
delta (npt.NDArray) – Delta Matrix
h (float) – Thickness of layer (nm)
lbda (npt.ArrayLike) – Wavelengths to evaluate (nm)
- Returns
Propagator for the given layer
- Return type
npt.NDArray
- class elli.solver4x4.PropagatorExpmScipy[source]
Bases:
elli.solver4x4.PropagatorPropagator class using the Padé approximation of the matrix exponential.
- calculate_propagation(delta, h, lbda)[source]
Calculates propagation for a given Delta matrix and layer thickness with the Padé approximation of the matrix exponential.
- Parameters
delta (npt.NDArray) – Delta Matrix
h (float) – Thickness of layer (nm)
lbda (npt.ArrayLike) – Wavelengths to evaluate (nm)
- Returns
Propagator for the given layer
- Return type
npt.NDArray
- class elli.solver4x4.PropagatorExpmTF[source]
Bases:
elli.solver4x4.PropagatorPropagator class using a vectorized Padé approximation of the matrix exponential
- calculate_propagation(delta, h, lbda)[source]
Calculates propagation for a given Delta matrix and layer thickness with the Padé approximation of the matrix exponential.
- Parameters
delta (npt.NDArray) – Delta Matrix
h (float) – Thickness of layer (nm)
lbda (npt.ArrayLike) – Wavelengths to evaluate (nm)
- Returns
Propagator for the given layer
- Return type
npt.NDArray
- class elli.solver4x4.PropagatorExpmTorch[source]
Bases:
elli.solver4x4.PropagatorPropagator class using a vectorized polynomial approximation of the matrix exponential.
- calculate_propagation(delta, h, lbda)[source]
Calculates propagation for a given Delta matrix and layer thickness with the polynomial approximation of the matrix exponential.
- Parameters
delta (npt.NDArray) – Delta Matrix
h (float) – Thickness of layer (nm)
lbda (npt.ArrayLike) – Wavelengths to evaluate (nm)
- Returns
Propagator for the given layer
- Return type
npt.NDArray
- class elli.solver4x4.PropagatorLinear[source]
Bases:
elli.solver4x4.PropagatorPropagator class using a simple linear approximation of the matrix exponential.
- calculate_propagation(delta, h, lbda)[source]
Calculates propagation for a given Delta matrix and layer thickness with a linear approximation of the matrix exponential.
- Parameters
delta (npt.NDArray) – Delta Matrix
h (float) – Thickness of layer (nm)
lbda (npt.ArrayLike) – Wavelengths to evaluate (nm)
- Returns
Propagator for the given layer
- Return type
npt.NDArray
- class elli.solver4x4.Solver4x4(experiment, propagator=<elli.solver4x4.PropagatorExpmScipy object>)[source]
Bases:
elli.solver.SolverSolver class to evaluate Experiment objects. Based on Berreman’s 4x4 method.
- static build_delta_matrix(k_x, eps)[source]
Calculates Delta matrix for given permittivity and reduced wave number.
- Parameters
k_x (npt.ArrayLike) – reduce wave number, Kx = kx/k0
eps (npt.NDArray) – permittivity tensor
- Returns
Delta 4x4 matrix: infinitesimal propagation matrix
- Return type
npt.NDArray
- calculate()[source]
Calculates transition matrices for every element in the structure and resulting Jones matrices.
- Returns
Result object with calculation results
- Return type
- static get_k_z(material, lbda, k_x)[source]
Calculates Kz in a material
- Parameters
material (Material) – Material of the half-space
lbda (npt.ArrayLike) – Wavelengths to evaluate (nm)
k_x (npt.ArrayLike) – Reduced wavenumber, Kx = kx/k0
- Returns
value of Kz in the material
- Return type
npt.NDArray
- static transition_matrix_halfspace(delta)[source]
Returns transition exit matrix L for any half-space.
Sort eigenvectors of the Delta matrix according to propagation direction first, then according to $y$ component.
Returns eigenvectors ordered like (s+,s-,p+,p-)
- Parameters
delta (npt.NDArray) – Delta 4x4 matrix: infinitesimal propagation matrix
- Returns
Translation matrix for semi-infinite half-spaces
- Return type
npt.NDArray
- static transition_matrix_iso_halfspace(k_x, epsilon, inv=False)[source]
Returns transition incident or exit matrix L for isotropic half-spaces.
- Parameters
k_x (npt.ArrayLike) – Reduced wavenumber, Kx = kx/k0
epsilon (npt.ArrayLike) – dielectric tensor
inv (bool, optional) – If True, returns inverse transition matrix L^-1, used for the incident Matrix Li. Defaults to False.
- Returns
transition matrix L
- Return type
npt.NDArray
elli.spectraray module
A helper class to load data from SpectraRay ASCII Files
elli.structure module
- class elli.structure.AbstractLayer[source]
Bases:
abc.ABCAbstract class for a layer.
- d = None
- abstract get_permittivity_profile(lbda)[source]
Returns the permittivity profile of the layer for the given wavelengths.
- Parameters
lbda (npt.ArrayLike) – Single value or array of wavelengths (in nm).
- Returns
Returns list of tuples [(thickness, dielectric tensor), …]
- Return type
List[Tuple[float, npt.NDArray]]
- class elli.structure.InhomogeneousLayer(material, d)[source]
Bases:
elli.structure.LayerAbstract base class for inhomogeneous layers with varying properties in z-direction.
New layer of material ‘material’, with thickness ‘d’
- div = None
- get_permittivity_profile(lbda)[source]
Returns the permittivity profile of the layer for the given wavelengths. The tensor is evaluated in the middle of each slice.
- Parameters
lbda (npt.ArrayLike) – Single value or array of wavelengths (in nm).
- Returns
Returns list of tuples [(d1, epsilon1), (d2, epsilon2), …]
- Return type
List[Tuple[float, npt.NDArray]]
- class elli.structure.Layer(material, d)[source]
Bases:
elli.structure.AbstractLayerHomogeneous layer of dielectric material.
New layer of material ‘material’, with thickness ‘d’
- get_permittivity_profile(lbda)[source]
Returns the permittivity profile of the layer for the given wavelengths.
- Parameters
lbda (npt.ArrayLike) – Single value or array of wavelengths (in nm).
- Returns
Returns a list containing one tuple [(thickness, dielectric tensor)]
- Return type
List[Tuple[float, npt.NDArray]]
- class elli.structure.RepeatedLayers(layers, repetitions, before=0, after=0)[source]
Bases:
elli.structure.AbstractLayerRepeated structure of layers.
Create a repeated structure of layers.
Example : For layers [1,2,3] with n=2, before=1 and after=0, the structure will be 3123123.
- Parameters
layers (List[AbstractLayer]) – List of the repeated layers, starting from z=0
repetitions (int) – Number of repetitions
before (int, optional) – Number of additional layers before the first period. Defaults to 0.
after (int, optional) – Number of additional layers after the last period. Defaults to 0.
- after = None
- before = None
- get_permittivity_profile(lbda)[source]
Returns the permittivity profile of the layer for the given wavelengths.
- Parameters
lbda (npt.ArrayLike) – Single value or array of wavelengths (in nm).
- Returns
Returns list of tuples [(thickness, dielectric tensor), …]
- Return type
List[Tuple[float, npt.NDArray]]
- layers = None
- repetitions = None
- set_layers(layers)[source]
Set list of layers.
- Parameters
layers (List[AbstractLayer]) – List of the repeated layers, starting from z=0
- class elli.structure.Structure(front, layers, back)[source]
Bases:
objectDescription of the whole structure.
Consists of: - front half-space (incident) - back half-space (exit) - layer succession
Creates a structure.
- Parameters
front (IsotropicMaterial) – IsotropicMaterial used as front half space
layers (List[Layer]) – List of Layers, starting from z=0
back (Material) – Material used as back half space
- back_material = None
- evaluate(lbda, theta_i, solver=<class 'elli.solver4x4.Solver4x4'>, **solver_kwargs)[source]
Return the Evaluation of the structure for the given parameters with standard settings.
- Parameters
lbda (npt.ArrayLike) – Single value or array of wavelengths (in nm).
theta_i (float) – Incident angle of the experiment (in degrees).
solver (Solver, optional) – Choose which solver class is used. Defaults to Solver4x4.
solver_kwargs (optional) – Keyword arguments for the Solver can be appended as arguments.
- Returns
Result of the experiment.
- Return type
- front_material = None
- get_permittivity_profile(lbda)[source]
Returns the permittivity profile of the complete structure for the given wavelengths.
- Parameters
lbda (npt.ArrayLike) – Single value or array of wavelengths (in nm).
- Returns
Returns list of tuples [(thickness, dielectric tensor), …]
- Return type
List[Tuple[float, npt.NDArray]]
- layers = []
- set_back_material(material)[source]
Defines the back half-space material.
- Parameters
material (Material) – Material used as back half space
- set_front_material(material)[source]
Defines the front half-space material. Has to be isotropic.
- Parameters
material (IsotropicMaterial) – IsotropicMaterial used as front half space
- class elli.structure.TwistedLayer(material, d, div, angle)[source]
Bases:
elli.structure.InhomogeneousLayerTwisted layer. The material gets rotated around the z axis.
Creates a layer with a twisted material.
- Parameters
- get_tensor(z, lbda)[source]
Gets permittivity tensor matrix for position ‘z’ and wavelength ‘lbda’.
- Parameters
z (float) – Position in the layer (in nm)
lbda (npt.ArrayLike) – Single value or array of wavelengths (in nm).
- Returns
Permittivity tensor for position ‘z’ and wavelength ‘lbda’.
- Return type
npt.NDArray
- class elli.structure.VaryingMixtureLayer(material, d, div, fraction_modulation)[source]
Bases:
elli.structure.InhomogeneousLayerMixture layer, with varying fraction.
Creates a layer with a mixture material varying in z direction.
- Parameters
material (MixtureMaterial) – MixtureMaterial object
d (float) – Thickness of layer (in nm)
div (int) – Number of slices for the layer
fraction_modulation (Callable[[float], float]) – Function to modify the fraction amount, takes float from 0 to 1 (top to bottom of layer), should return fraction at that level
- fraction_modulation = None
- get_tensor(z, lbda)[source]
Gets permittivity tensor matrix for position ‘z’ and wavelength ‘lbda’.
- Parameters
z (float) – Position in the layer (in nm)
lbda (npt.ArrayLike) – Single value or array of wavelengths (in nm).
- Returns
Permittivity tensor for position ‘z’ and wavelength ‘lbda’.
- Return type
npt.NDArray
elli.utils module
- elli.utils.calc_pseudo_diel(rho, angle, output='eps')[source]
Calculates the pseudo dielectric function of a measurement from rho.
- Parameters
rho (pandas.DataFrame) – Measurement DataFrame containing rho as complex number as column and wavelength as index
angle (float) – Angle of measurement in degree
output (str, optional) – Output format for dielectric function. ‘n’: refractive index, ‘eps’: Dielectic function as two-column pandas.DataFrame, ‘epsi’: Dielectric function as imaginary number. Defaults to ‘eps’.
- Returns
Frame containing the pseudo dielectric function or refractive index.
- Return type
- elli.utils.calc_rho(psi_delta)[source]
- Calculate rho from a Psi-Delta DataFrame.
The Psi-Delta DataFrame should be structured as follows:
index: Wavelength column ‘Ψ’: Psi from measurement column ‘Δ’: Delta from measurement
This format is as returned from SpectraRay.read_psi_delta_file(…).
- Parameters
psi_delta (pandas.DataFrame) – DataFrame containing Psi+Delta Measurement data
- Returns
Frame containing rho as an imaginary number.
- Return type