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.