Update Dec 2025: Check out the
juliabranch (link). Despite the name, it maintains the same Pythonic interface. Installation is slightly more involved and some functions are changed, but it's faster and has a basic web doc.
wavesolve is a lightweight Python code to solve for the eigenmodes of waveguides. It can solve for both scalar and vector modes.
It uses the finite element method, and generates waveguide meshes through the pygmsh package. More details on the math behind wavesolve are included here.
Use pip:
pip install git+https://github.com/jw-lin/wavesolve.git
To update the package:
pip install --force-reinstall git+https://github.com/jw-lin/wavesolve.git
Python dependencies: numpy,scipy,matplotlib,numexpr,pygmsh,jupyter,pypardiso (optional)
Other dependencies: Gmsh (required for pygmsh).
See getting-started.ipynb for an overview and some working examples.
NSF grants 2109231, 2109232, 2308360, 2308361