# E08 · Waveguides, modes, and resonators

Find the field shapes that can travel unchanged, combine them to transfer power between guides, and sum repeated round trips to build a resonance.

<!-- course-motivation:start -->
## Why learn this?

**How do you route and store light on a chip?**

An optical circuit must keep light inside a guide, transfer it to a neighbouring path, or build it up in a resonator. Drawing the paths is not enough to predict the power: the supported field shapes and their relative phases determine what the device does.

**What you gain:** Connect confinement to guided modes, choose a coupling length from mode beating, and explain how round-trip phase, coupling, and loss set a ring's spectral response.
<!-- course-motivation:end -->

<!-- course-preparation:start -->
## Before this lesson

Use these focused refreshers if an idea is unfamiliar; you do not need to complete each linked course.

- **Matrices, eigenvectors, and modes:** Recognize an eigenfunction as a shape preserved by a linear operator. Used here: A guided mode retains its transverse profile as it propagates. [Review: MIT OCW · Eigenvalues and Eigenvectors](https://ocw.mit.edu/courses/18-06sc-linear-algebra-fall-2011/pages/least-squares-determinants-and-eigenvalues/eigenvalues-and-eigenvectors/). Start with the lecture summary and one 2 × 2 worked problem. Focus on Av = λv and what changes when a matrix is applied repeatedly.
- **Complex amplitudes and phase:** Add complex amplitudes with different accumulated phases. Used here: Interference between modes controls power transfer in a coupler. [Review: MIT OCW · Complex Arithmetic and Exponentials](https://ocw.mit.edu/courses/18-03sc-differential-equations-fall-2011/pages/unit-i-first-order-differential-equations/complex-arithmetic-and-exponentials/). Read the notes on Euler's formula, polar form, multiplication, and complex conjugation. The differential-equation applications can wait.
- **Geometric series:** Sum a geometric series and check its convergence condition. Used here: Repeated round trips build the ring's resonant response. [Review: OpenStax · Calculus Volume 2, §5.2](https://openstax.org/books/calculus-volume-2/pages/5-2-infinite-series). Read the Geometric Series subsection: partial sums, the sum 1/(1−r), and the condition |r| < 1. Other series tests are not needed.

**Python preparation:** Read eigenvalues and eigenvectors returned by a matrix solver, and plot parameter sweeps.
- [NumPy · The absolute basics for beginners](https://numpy.org/doc/stable/user/absolute_beginners.html) — Use the sections on array shape, indexing and slicing, basic operations, and broadcasting. Practice changing one parameter and rerunning a cell.

**Developed here:** Calculate slab modes, directional coupling, and ring resonances as three related experiments.

[All prerequisites and learning resources](https://vandermode.github.io/optics-in-5-minutes-course/preparation/)
<!-- course-preparation:end -->

## Learning outcomes

- Recognize a guided mode as an eigenfunction with decaying cladding tails.
- Explain directional coupling through relative supermode phase.
- Relate ring resonance, storage, and critical coupling without confusing amplitude and power.

## Use the lesson

Watch the [E08 film](https://www.youtube.com/watch?v=rPNYODeWrJs) (5:07), embedded near the top of the lesson.

Serve the complete teaching/ directory over HTTP. The lesson uses shared local assets and native JavaScript modules. Open this episode's folder in the browser. Its standalone notebook also works directly in Colab or Jupyter; it does not import repository code or require a GPU.

The notebook's core takes about 25–30 minutes to work through, with a separate optional extension. The first code cell installs numerical packages only when missing. Saved outputs, figures/, and figures.zip provide static figure access if a notebook frontend blocks rich output.

## Model and normalization

Scalar TE symmetric slab, ncore = 1.50, ncladding = 1.45, λ₀ = 1.55 μm. The coupler and ring are separate reduced models. The ring is an ideal single-bus all-pass resonator with amplitude parameters r and a. No bend radiation, vector effects, or fabrication disorder is included.

Computed quantities are generated by model.js in the browser and the explicitly written NumPy/SciPy models in lab.py. Model-specific assertions and independent references are in the lab and the course checks. The browser and notebook use documented but not necessarily identical grid sizes. Synthetic randomness is seeded.

## Rebuild

From the repository root, run: python teaching/tools/build_course.py, then python teaching/tools/validate_notebooks.py. The authored page content and controls are in teaching/tools/curriculum.py; opening motivations are in teaching/tools/motivation.py; preparation is in teaching/tools/preparation.py; notebook source is this folder's percent-format lab.py. Building preserves saved outputs when code cells are unchanged. Run npm test --prefix teaching for numerical browser-model tests.

## References

- [MIT OpenCourseWare · Dielectric waveguides](https://ocw.mit.edu/courses/6-974-fundamentals-of-photonics-quantum-electronics-spring-2006/pages/lecture-notes/)
- [SciPy · Hermitian eigenproblems](https://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.eigh.html)
