fdtdx.Pole#
- class fdtdx.Pole[source]#
Bases:
TreeClass,ABCAbstract base class for a single 2nd-order ADE pole.
Concrete subclasses store physically-meaningful parameters (e.g.
delta_epsilonfor Lorentz,omega_pfor Drude) and expose the unified(omega_0, gamma, coupling_sq)triplet the FDTD loop needs via per-axis properties. New pole types can subclassPoleas long as they fit the 2nd-order ODE form.Every parameter may differ per grid axis (diagonally anisotropic dispersion); the canonical accessors are the
*_axesproperties returning(x, y, z)tuples. The scalar accessors (omega_0etc.) are a convenience for isotropic poles and raise for per-axis ones.
Quick Reference#
Attributes
Methods
Attributes#
- Pole.coupling_edot#
Coefficient
bof thedE/dtdriving term (rad/s).Raises
ValueErrorfor per-axis poles; usecoupling_edot_axes.
- Pole.coupling_edot_axes#
Per-axis coefficient
bof thedE/dtdriving term (rad/s).Zero for Lorentz and Drude poles (their susceptibility numerator has no
omegaterm). A non-zero value is what distinguishes a general complex-conjugate pole-residue (CCPR) pole — it corresponds to a non-zero real part of the residue and adds theb E'term to the ADE. Defaults to all-zero so existing pole types need not override it.
- Pole.coupling_sq#
Effective squared coupling frequency
K(rad^2/s^2).Raises
ValueErrorfor per-axis poles; usecoupling_sq_axes.
- Pole.coupling_sq_axes#
Per-axis effective squared coupling frequency
K(rad^2/s^2).delta_epsilon * omega_0**2for a Lorentz pole andomega_p**2for a Drude pole.This is the coefficient
aof theEdriving term in the unified 2nd-order ODEp'' + gamma p' + omega_0**2 p = a E + b E'.
- Pole.gamma#
Damping rate (rad/s).
Raises
ValueErrorfor per-axis poles; usegamma_axes.
- Pole.gamma_axes#
Per-axis damping rate (rad/s).
- Pole.is_isotropic#
Whether all pole parameters are identical on the three axes.
- Pole.omega_0#
Resonance angular frequency (rad/s). Zero for pure Drude poles.
Raises
ValueErrorfor per-axis poles; useomega_0_axes.
- Pole.omega_0_axes#
Per-axis resonance angular frequency (rad/s). Zero for pure Drude poles.
Methods#
- Pole.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
- Pole.get_class_fields()#
- Return type:
list[TreeClassField]
- Pole.get_public_fields()#
- Return type:
list[TreeClassField]
If you find any errors in the documentation, please report them in the Github Issues!