Guided Modes API¶
modes
¶
Guided modes of planar stacks of anisotropic layers.
Full-vector: any 3×3 ε and μ in any layer, so the modes of a rotated crystal film are hybrid (neither TE nor TM), and absorbing layers give complex effective indices.
A mode is a field that exists with nothing incident. At a plane inside the
stack, let A be the scattering matrix of everything above it and B of
everything below. Then an eigenvalue of A₀₁·B₁₀ equals 1 at a mode. The
claddings' waves are continued analytically to their outgoing branch, so the
round trip is analytic in n_eff. The roots are found by Beyn's contour
method and refined by the secant method.
Classes:
-
GuidedMode–A guided, possibly lossy mode of a planar stack, propagating along x.
Functions:
-
slab_modes–Guided modes of a planar stack of anisotropic layers, propagating along x.
-
slab_mode_fields–The field profile of a guided mode, normalised to unit power along x.
GuidedMode
¶
Bases: NamedTuple
A guided, possibly lossy mode of a planar stack, propagating along x.
Attributes:
-
effective_index(complex) –Complex
n_eff = β/k₀;Im > 0for a mode that decays as it propagates through an absorbing stack. -
loss_db_per_cm(float) –Power attenuation,
20·log₁₀(e)·k₀·Im(n_eff)per cm. -
multiplicity(int) –How many eigenvalues of the round trip reach 1 (2 for a degenerate pair).
-
residual(float) –|1 − μ|at the root.
slab_modes
¶
slab_modes(
eps,
thickness_um,
wavelength_um,
eps_top,
eps_bottom,
index_range=None,
max_loss=None,
mu=None,
)
Guided modes of a planar stack of anisotropic layers, propagating along x.
Full-vector: any 3×3 ε and μ in any layer, so the modes of a rotated crystal film are hybrid (neither TE nor TM), and absorbing layers give complex effective indices. Rotate the tensors to change the propagation direction in the plane.
Parameters:
-
eps–Layer tensors
[L, 3, 3]from the top down (lab frame, x the propagation direction). -
thickness_um–[L]. -
wavelength_um–Vacuum wavelength (real).
-
eps_top, eps_bottom–Cladding permittivities (isotropic, real).
-
index_range(tuple[float, float] | None, default:None) –Real
n_effto search; by default from just above the higher cladding index to a bound from ε and μ in the core. Indefinite tensors require an explicit range. Keep it above the claddings' indices: the branch point at each is where a mode stops being guided. -
max_loss(float | None, default:None) –Largest
Im n_effsearched; by default 5 % of the range. -
mu–Layer permeabilities; identity if omitted.
Returns:
:class:GuidedMode s, highest effective index first (fundamental first).
Source code in hyperbolic_optics/modes.py
slab_mode_fields
¶
slab_mode_fields(
eps,
thickness_um,
wavelength_um,
eps_top,
eps_bottom,
effective_index,
mu=None,
samples_per_layer=50,
cladding_um=(1.0, 1.0),
cladding_samples=50,
)
The field profile of a guided mode, normalised to unit power along x.
Parameters:
-
effective_index–A root from :func:
slab_modes. -
samples_per_layer(int, default:50) –Samples through each layer, both faces included.
-
cladding_um(tuple[float, float], default:(1.0, 1.0)) –How far into the top and bottom claddings to sample.
-
cladding_samples(int, default:50) –Samples in each cladding.
-
Others–As in :func:
slab_modes.
Returns:
-
–
(z_um, fields): depth below the top of the first layer[Z]and -
–
(Ex, Ey, Ez, Hx, Hy, Hz)there[Z, 6](H scaled by the free-space -
–
impedance), with
½ Re ∫ (Ey·Hz* − Ez·Hy*) dz = 1: unit power along x.
The fields are marched from the internal plane with bounded scattering matrices, so thick claddings or strongly evanescent layers stay stable.
Source code in hyperbolic_optics/modes.py
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 | |