optmat.solid.models.base#

The solid model interface: the complex dielectric function against vacuum wavelength.

A solid’s model gives its complex relative permittivity epsilon = (n + ik)^2, with k >= 0 for absorption, and its exact derivative with respect to angular frequency. The refractive index, the group index and the group-velocity dispersion follow. The interface matches what a propagation code needs of a cladding or a bulk medium: n(omega) and epsilon(omega) with their omega derivatives, a name, a citation and a stated range.

Functions

complex_index(permittivity)

Return n + ik = sqrt(epsilon) with k >= 0, to full relative precision.

Classes

Model(material, name, citation, ...[, axis, ...])

A model of a solid's complex dielectric function.

class optmat.solid.models.base.Model(material, name, citation, wavelength_range, kind, axis='', *, status='user', status_reason='', modified=(), base='', intervals=())[source]#

Bases: Identified

A model of a solid’s complex dielectric function.

Attributes:
materialstr

The material’s id (optmat.materials).

namestr

A unique name, <source>/<formula> for a published formula.

citationstr

Where the model comes from.

wavelength_rangetuple of float

The vacuum-wavelength range over which the source supports the model, m: the envelope of intervals.

kindstr

The model’s provenance: “published” (a formula or model as its authors give it), “fitted” (fitted here), “tabulated” (curated tables joined by range and interpolated) or “comparison” (a database entry, compared only). It is not identity.kind, which names the quantity ("solid").

axisstr

For an anisotropic crystal, the axis the model describes; empty otherwise.

intervalstuple of tuple of float

The qualified intervals, vacuum wavelength, m; one, the range, unless the source qualifies several.

statusstr

validated for a material’s recommended model, comparison for the other curated models, user for a model a caller built.

DERIVED: ClassVar[tuple[str, ...]] = ('wavelength_range',)#

Fields derived from the inputs, which an override may not name.

EVALUATION_VERSION: ClassVar[int] = 1#
IDENTITY_KIND: ClassVar[str] = 'solid'#
INPUTS: ClassVar[tuple[str, ...]] = ('intervals',)#

The parameters with_parameters() may change.

axis: str = ''#
citation: str#
dindex_domega(wavelength, *, warn=True)[source]#

Return d(n + ik) / d omega at vacuum wavelengths.

Parameters:
wavelengtharray_like or float

Vacuum wavelength, m.

warnbool, optional

Warn outside wavelength_range; True by default.

Returns:
numpy.ndarray

The derivative, s/rad.

Raises:
ArgumentError

If a wavelength is not positive and finite.

dpermittivity_domega(wavelength, *, warn=True)[source]#

Return d epsilon / d omega at vacuum wavelengths.

Parameters:
wavelengtharray_like or float

Vacuum wavelength, m.

warnbool, optional

Warn outside wavelength_range; True by default.

Returns:
numpy.ndarray

The derivative with respect to angular frequency, s/rad.

Raises:
ArgumentError

If a wavelength is not positive and finite.

group_index(wavelength, *, warn=True)[source]#

Return the group index n + omega dn/domega (its real part).

Parameters:
wavelengtharray_like or float

Vacuum wavelength, m.

warnbool, optional

Warn outside wavelength_range; True by default.

Returns:
numpy.ndarray

The group index.

Raises:
ArgumentError

If a wavelength is not positive and finite.

gvd(wavelength, *, warn=True)[source]#

Return the group-velocity dispersion beta_2 of the bulk medium.

beta_2 = (2 dn/domega + omega d^2n/domega^2) / c, with the second derivative from a fourth-order central difference of the exact first derivative (step 1e-3 omega: truncation below 1e-11 relative where the model is smooth).

Parameters:
wavelengtharray_like or float

Vacuum wavelength, m.

warnbool, optional

Warn outside wavelength_range; True by default.

Returns:
numpy.ndarray

Re beta_2, s^2/m.

Raises:
ArgumentError

If a wavelength is not positive and finite.

intervals: tuple[tuple[float, float], ...] = ()#
kind: str#
material: str#
name: str#
permittivity(wavelength, *, warn=True)[source]#

Return the complex relative permittivity at vacuum wavelengths.

Parameters:
wavelengtharray_like or float

Vacuum wavelength, m.

warnbool, optional

Warn (ModelRangeWarning) outside wavelength_range; True by default.

Returns:
numpy.ndarray

The permittivity epsilon = (n + ik)^2, with Im epsilon >= 0 for absorption.

Raises:
ArgumentError

If a wavelength is not positive and finite.

refractive_index(wavelength, *, warn=True)[source]#

Return the complex refractive index n + ik at vacuum wavelengths.

Parameters:
wavelengtharray_like or float

Vacuum wavelength, m.

warnbool, optional

Warn outside wavelength_range; True by default.

Returns:
numpy.ndarray

The index n + ik, with k >= 0 for absorption (the intensity falls as exp(-4 pi k z / lambda)).

Raises:
ArgumentError

If a wavelength is not positive and finite.

wavelength_range: tuple[float, float]#
optmat.solid.models.base.complex_index(permittivity)[source]#

Return n + ik = sqrt(epsilon) with k >= 0, to full relative precision.

numpy’s complex square root returns k = 0 when k is below about 1e-16 n, which loses the weak absorption of a transparent window (TC-321); here the smaller of the two parts is formed from the larger as epsilon_i / (2 x).

Parameters:
permittivitynumpy.ndarray

Complex relative permittivity, epsilon_i >= 0.

Returns:
numpy.ndarray

The complex index with Re n >= 0 and Im n >= 0.

Examples

>>> complex_index(np.array([2.25 + 3e-30j]))
array([1.5+1.e-30j])