Modes and fundamentals#
Mode-family definitions and immutable mode identifiers.
- class Family(value)[source]#
Bases:
str,EnumSupported scalar and vector mode families.
- LP = 'LP'#
- HE = 'HE'#
- EH = 'EH'#
- TE = 'TE'#
- TM = 'TM'#
- class Mode(family, nu, m)[source]#
Bases:
objectIdentify one circular-fiber propagation mode.
- Parameters:
family ({'LP', 'HE', 'EH', 'TE', 'TM'}) – Electromagnetic mode family.
nu (int) – Non-negative azimuthal order.
m (int) – Non-negative radial order.
- nu: int#
Parameter of the mode. It often corresponds to the parameter of the radial Bessel functions.
- m: int#
Radial order of the mode (positive integer). It corresponds to the number of concentric rings in the mode fields.
Fundamental normalized-frequency and propagation relations.
- get_delta_from_fiber(fiber)[source]#
Calculate the relative index difference, (Delta), of the fiber.
\[\Delta = \frac{1}{2} \left( 1 - \frac{n_{\text{clad}}^2}{n_{\text{core}}^2} \right)\]- Parameters:
fiber (Fiber) – The fiber object containing core and cladding properties.
- Returns:
The relative index difference, (Delta).
- Return type:
float
- get_wavelength_from_V0(fiber, normalized_frequency)[source]#
Compute the wavelength corresponding to a given V-number, (V_0).
\[\lambda = \frac{2 \pi a \cdot \text{NA}}{V_0}\]where: - (a) is the core radius. - (text{NA}) is the numerical aperture.
- Parameters:
fiber (Fiber) – The fiber object.
normalized_frequency (float) – The V-number.
- Returns:
The wavelength corresponding to V$_0$.
- Return type:
float
- get_propagation_constant_from_omega(omega, fiber, mode, delta_neff=1e-06)[source]#
Calculate the propagation constant, (beta), for a given angular frequency, fiber, and mode.
\[\beta = k_0 n_{\text{eff}}\]where: - (k_0 = frac{2 pi}{lambda}) is the free-space wave number. - (n_{text{eff}}) is the effective refractive index.
- get_U_parameter(fiber, wavelength, mode, delta_neff=1e-06)[source]#
Calculate the (U) parameter for a given fiber and mode.
\[U = k_0 a \sqrt{n_{\text{core}}^2 - n_{\text{eff}}^2}\]
- get_effective_index(fiber, wavelength, mode, delta_neff=1e-06)[source]#
Compute the effective refractive index, (n_{text{eff}}), for a given mode.
- Parameters:
- Returns:
The effective refractive index, (n_{text{eff}}).
- Return type:
float
- get_effective_index_result(fiber, wavelength, mode, delta_neff=1e-06)[source]#
Compute an effective index with structured convergence diagnostics.
- Parameters:
- Returns:
Effective index, residual, bracket, iteration count, and explanation.
- Return type:
SolverResult[float]
- get_mode_cutoff_v0(fiber, wavelength, mode)[source]#
Compute the cutoff V-number, (V_0), for a mode.
- get_radial_field(fiber, mode, wavelength, radius)[source]#
Compute the radial field components of a mode in cylindrical coordinates.
The returned pair contains the cylindrical electric components \((E_r, E_\phi, E_z)\) and magnetic components \((H_r, H_\phi, H_z)\).
Optical-source wavelength and frequency conversions.
- class Source(wavelength)[source]#
Bases:
objectRepresent a monochromatic optical source.
- Parameters:
wavelength (TypedUnit.Length) – Vacuum wavelength in meters.
- property wavelength: Length#
Validated vacuum wavelength.
- property wavenumber#
Wave number (2π/λ).
- Returns:
Wave number in radians per meter.
- Return type:
pint.Quantity
- property omega#
Angular frequency (in rad/s).
- Returns:
Angular frequency.
- Return type:
pint.Quantity
- property frequency#
Frequency (in Hertz).
- Returns:
Frequency in Hz.
- Return type:
pint.Quantity
Validated immutable configuration models for fibers and solvers.
- class LayerSpec(name, radius, refractive_index)[source]#
Bases:
objectDescribe one immutable concentric step-index layer.
- Parameters:
name (str) – Human-readable layer name.
radius (TypedUnit.Length) – Outer radius in meters. The outermost layer may use infinity.
refractive_index (TypedUnit.RefractiveIndex) – Positive finite refractive index.
- name: str#
- radius: Length#
- refractive_index: RefractiveIndex#
- class SolverSettings(tolerance=1e-08, max_iterations=100, effective_index_step=1e-06, raise_on_failure=False)[source]#
Bases:
objectConfigure root searches consistently across solver implementations.
- Parameters:
tolerance (float, optional) – Absolute root tolerance.
max_iterations (int, optional) – Maximum root-finding iterations.
effective_index_step (float, optional) – Maximum effective-index bracketing step.
raise_on_failure (bool, optional) – Raise
ConvergenceErrorinstead of returning a failed result.
- tolerance: float#
- max_iterations: int#
- effective_index_step: float#
- raise_on_failure: bool#
Domain-specific exceptions raised by PyFiberModes.
- exception ValidationError[source]#
Bases:
PyFiberModesError,ValueErrorIndicate invalid physical geometry or solver configuration.
- exception SolverError[source]#
Bases:
PyFiberModesError,RuntimeErrorIndicate that a modal solver could not complete normally.
- exception ConvergenceError[source]#
Bases:
SolverErrorIndicate that a numerical solver did not converge to a valid root.
- exception UnsupportedGeometryError[source]#
Bases:
SolverErrorIndicate that a requested calculation does not support the fiber geometry.