View on GitHub

EMpy

ElectroMagnetic Python — Computational Electromagnetics & Photonics Suite

Optical Waveguide Mode Solvers (FD, PML & FMM) in Python

EMpy.modesolvers provides both finite-difference (FD) and semi-analytical Film Mode Matching (FMM) eigenmode solvers for 1D slab and 2D channel/rib optical waveguides.


Solvers & Capabilities


Quick Python Example: Leaky Waveguide Tunneling Loss with stretchmesh PML

import numpy as np
import EMpy

wl = 1.55e-6
x_raw = np.linspace(-6.0e-6, 6.0e-6, 121)
y_raw = np.linspace(-6.0e-6, 6.0e-6, 121)

# Apply complex-coordinate-stretching PML (passive Im(factor) < 0) on outer boundaries
xx, yy, _, _, _, _ = EMpy.modesolvers.FD.stretchmesh(
    x_raw, y_raw, [0, 0, 28, 28], 1.0 - 1.8j, method="PPPP"
)

def eps_w(x, y):
    # W-type depressed-cladding leaky waveguide permittivity profile
    ...

sol = EMpy.modesolvers.FD.VFDModeSolver(wl, xx, yy, eps_w, "SS00").solve(2, 1e-11, guess=1.45)
loss_db_cm = EMpy.utils.rix2losses(sol.modes[0].neff, wl)[4]

Leaky waveguide tunneling loss with stretchmesh PML compared to exact 5-layer theory

Asymmetric SOI rib waveguide TM0-TE1 avoided crossing and Stokes S2 map


Benchmark Scripts & References

See also: Methodology & References · All Examples