fdtdx.DispersionModel#
- class fdtdx.DispersionModel(*, poles=())[source]#
Bases:
TreeClassLinear susceptibility built from a sum of 2nd-order ADE poles.
The high-frequency permittivity \(\varepsilon_\infty\) is NOT stored here - it lives in the parent
Materialas the existingpermittivityfield. This keeps a single source of truth for theinv_permittivitiesarray.
Quick Reference#
Attributes
Methods
Attributes#
- DispersionModel.is_isotropic#
Whether every pole applies the same parameters to all three axes.
- DispersionModel.num_poles#
Number of poles in this model.
Methods#
- DispersionModel.aset(attr_name, val, create_new_ok=False)#
Sets an attribute of this class. In contrast to the classical .at[].set(), this method updates the class attribute directly and does not only operate on jax pytree leaf nodes. Instead, replaces the full attribute with the new value.
The attribute can either be the attribute name of this class, or for nested classes it can also be the attribute name of a class, which itself is an attribute of this class. The syntax for this operation could look like this: “a->b->[0]->[‘name’]”. Here, the current class has an attribute a, which has an attribute b, which is a list, which we index at index 0, which is an element of type dictionary, which we index using the dictionary key ‘name’.
Note that dictionary keys cannot contain square brackets or single quotes (even if they are escaped).
- Parameters:
attr_name (str) – Name of attribute to set
val (Any) – Value to set the attribute to
create_new_ok (bool, optional) – If false (default), throw an error if the attribute does not exist. If true, creates a new attribute if the attribute name does not exist yet.
- Returns:
Updated instance with new attribute value
- Return type:
Self
- DispersionModel.get_class_fields()#
- Return type:
list[TreeClassField]
- DispersionModel.get_public_fields()#
- Return type:
list[TreeClassField]
- DispersionModel.permittivity(omega, eps_inf=1.0)[source]#
Complex relative permittivity \(\varepsilon(\omega) = \varepsilon_\infty + \chi(\omega)\).
Raises
ValueErrorfor models with per-axis poles; usepermittivity_axes()for those.- Parameters:
omega (
complex|float) – Angular frequency (rad/s).eps_inf (
float) – High-frequency permittivity. Defaults to 1.0 (vacuum).
- Returns:
Relative permittivity at
omega.- Return type:
complex
- DispersionModel.permittivity_axes(omega, eps_inf=1.0)[source]#
Per-axis complex relative permittivity \(\varepsilon_a(\omega) = \varepsilon_{\infty,a} + \chi_a(\omega)\).
- Parameters:
omega (
complex|float) – Angular frequency (rad/s).eps_inf (
float|tuple[float,float,float]) – High-frequency permittivity — scalar or per-axis 3-tuple (the diagonal of the ε∞ tensor). Defaults to 1.0.
- Returns:
Relative permittivity at
omegaper axis(x, y, z).- Return type:
tuple
- DispersionModel.susceptibility(omega)[source]#
Evaluate the complex susceptibility \(\chi(\omega)\).
Uses the
exp(-i omega t)Fourier convention (damping appears with a-i gamma omegaterm in the Lorentz denominator).Raises
ValueErrorfor models with per-axis poles; usesusceptibility_axes()for those.- Parameters:
omega (
complex|float) – Angular frequency (rad/s).- Returns:
\(\chi(\omega) = \sum_p \chi_p(\omega)\).
- Return type:
complex
- DispersionModel.susceptibility_axes(omega)[source]#
Evaluate the per-axis complex susceptibility \((\chi_x, \chi_y, \chi_z)\).
Uses the
exp(-i omega t)Fourier convention (damping appears with a-i gamma omegaterm in the Lorentz denominator). For an isotropic model all three entries are equal.- Parameters:
omega (
complex|float) – Angular frequency (rad/s).- Returns:
\(\chi_a(\omega) = \sum_p \chi_{p,a}(\omega)\) for each axis
ain(x, y, z).- Return type:
tuple
If you find any errors in the documentation, please report them in the Github Issues!