MOTH:

Mode-Matching Optimization THing

Moth is an interactive Gaussian beam mode‑matching tool. You set the initial beam (waist size $w_0$, waist location $z_0$, wavelength $\lambda$) at a reference plane, then place thin lenses and analyzers along the path. A canvas shows the beam envelope with components, and a plot displays the spot size $w$($z$) over distance.

 

You can specify a target waist and location with tolerances. A solver searches combinations from your lens library over a chosen z‑range (respecting analyzer exclusion zones) to maximize mode match. Results list lens trains with mode‑match %, error in waist and position, and can be applied to the layout. Full configurations can be exported/imported as JSON.

MaMMoth Mode-Matching Tool
Beam Setup

Initial Beam

Target Beam

Beamline Layout
Drag to reposition

Drag lenses (blue) and analyzers (gold) along the axis to explore manual mode-matching. A Gaussian trace of the current beam envelope is sketched in the canvas.

Component Management

Active Lenses

No lenses yet. Add one to begin.

Beam Analyzers

Add analyzers to probe the beam along the optical path.

Lens Library

Manage the focal lengths available to the solver. The list starts with a common set, and you can edit it freely.

No catalog lenses yet.
Solver & Solutions

Search Settings

Idle

Solution Picks

Run the solver to populate candidate optical trains.
Beam Metrics
w(z):
R(z):
ζ(z):
Export & Import

Export the entire MaMMoth configuration (beam parameters, components, library, solver settings) as a JSON file for later reuse or sharing.