16  Projects, toolbox and connections

16.1 How Chapter 1 feeds the rest of the course

16.2 Mini-projects

For students who want to go further. Each reuses optolib.py and can be done in one to three weeks.

# project skills difficulty
1 Thin-film design tool: extend ol.tmm with a merit function and optimise a broadband AR coating or a band-pass filter for 1550 nm optimisation, TMM ★★
2 Measure \(M^2\) of a lab laser with a webcam and laserbeamsize; compare with the datasheet experiment, fitting ★
3 Grating coupler: find the phase-matching condition with the grating equation, then check it with grcwa or Meep diffraction, RCWA ★★★
4 Fabry–Perot laser-diode spectrum: combine facet reflectance (Fresnel), cavity modes and a Gaussian gain curve resonators ★★
5 OTDR event detection on the toy trace of Chapter 14, then on a real trace from the lab signal processing ★★
6 Swanepoel’s method: recover \(n(\lambda)\) and the thickness of a film from its transmission fringes thin films, inverse problems ★★
7 Kramers–Kronig from measured data: compute \(n(\lambda)\) of a semiconductor from its absorption spectrum and compare with the database causality, numerics ★★★
8 Talbot and Arago in the lab: photograph the Arago spot or Talbot self-images and compare with ol.asm_propagate diffraction, experiment ★★

16.3 Python toolbox

All worked examples run with the scientific core only. The packages below extend them; the “Sections” column points to where each one is most useful.

Table 16.2: Optional Python packages for Chapter 1.
Package Install What it is good for Sections
numpy, scipy, matplotlib, pandas pip install ... core numerics, FFTs, special functions (Bessel \(J_1\)), optimisation, tables all
sympy pip install sympy symbolic derivations: Fresnel coefficients, Brewster angle, Stokes relations, Lorentz model 7, 4
pint pip install pint unit-aware calculations (avoids nm/µm/m mistakes in exercises) all
refractiveindex pip install refractiveindex refractiveindex.info database (\(n\), \(K\) of Si, Ge, GaN, InP, SiO₂, …) 4, 8
tmm pip install tmm validated transfer-matrix code: oblique incidence, coherent + incoherent layers, absorption profiles 7, 8, 11
laserbeamsize pip install laserbeamsize ISO 11146 beam diameters from camera images, \(M^2\) fitting 2
miepython pip install miepython Mie scattering of spheres; Rayleigh limit 14
LightPipes pip install LightPipes scalar Fourier-optics propagation: apertures, lenses, Fresnel/Fraunhofer, Gaussian and higher-order beams 2, 13
diffractsim pip install diffractsim visual diffraction simulator (angular spectrum), polychromatic sources and colour rendering 13, 9
poppy, prysm pip install poppy prysm physical-optics propagation through imaging systems, PSFs, aberrations 13
finesse pip install finesse interferometers and optical cavities with Hermite–Gauss beams 2, 10, 12
rayoptics, optiland pip install rayoptics optiland sequential ray tracing, lens design, paraxial (ABCD) analysis 6, 2
grcwa pip install grcwa rigorous coupled-wave analysis of gratings and metasurfaces 13, 11
Meep / MPB conda install -c conda-forge pymeep FDTD (Meep) and photonic band structures (MPB) 7, 11, 12
legume-gme pip install legume-gme guided-mode expansion for photonic-crystal slabs 11
colour-science pip install colour-science spectrum → CIE colour; colours of thin films 1, 8
gdsfactory, femwell, sax pip install gdsfactory femwell sax photonic-IC layout, FEM mode solving, circuit simulation of MZIs, rings, gratings 10, 12

16.4 Improvements to the course

  1. Live figures instead of screenshots. Many slides show plots from the textbook (Fresnel coefficients, Bragg-mirror spectra, Airy functions, diffraction patterns). Every one is regenerated here by a few lines of code that students can change.
  2. “Predict, then compute.” Before moving a slider, ask the class to predict the outcome (“What happens to the Brewster angle for internal reflection?”, “Does a thicker slit give a wider or narrower pattern?”). It is quick, engaging and suited to peer instruction.
  3. One running example through the chapter. For instance, a silicon photonics chip: phase shifter (Chapter 1), fiber coupling (Chapter 2), Si/Ge absorption (Chapter 4), MZI (Chapter 10), grating coupler (Chapter 13).
  4. Lab connection. The three mandatory labs can reuse these notebooks to analyse their data: \(M^2\) fitting, Fabry–Perot spectra, grating dispersion.

16.5 Notes for the instructor: checks on the slides

While recomputing the examples, everything matched the slides except these points:

  • Slide 161 (CdTe): with \(n=4\), \(K=6\) the reflectance formula gives \(45/61=73.8\,\%\), not 72 %.
  • Slides 185–187 (Bragg mirror): the Ta₂O₅/SiO₂ values for \(N=4\) and 12 are not printed; the formula gives 40.0 % and 90.6 %. The TiO₂ values (94.0 % and ≈ 100 %), the interchanged stack (80.8 %) and the bandwidth (74.8 nm) match.
  • Slides 168–169: the sodium lamp appears with two different widths (5×10¹¹ Hz and 1 GHz). Both are legitimate, but students may find the difference confusing; see Chapter 9.
  • Slide numbering: this companion uses the slide numbers of Chapter1_2026.pptx. Some numbers in the first draft (ch1_companion.qmd) were off by one, probably from an older version of the deck.