# E06 · Flat optics and wrapped phase

A thin element controls phase through height. Wrapping that phase makes a shallow optic, while quantization and colour reveal the price of the simplification.

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

**How much of a lens's thickness is doing useful work?**

A compact optical system needs a shallow focusing element. Removing material changes the phase delay, but at one wavelength a full phase turn can be removed without changing the thin-element transmission. Fabrication steps and a change of colour then test how far that shortcut remains useful.

**What you gain:** Turn a desired phase into a height profile, estimate the cost of using only a few height levels, and judge the wavelength range and model assumptions behind a flat-optic design.
<!-- 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.

- **Complex amplitudes and phase:** Use exp(i(φ + 2π)) = exp(iφ) and distinguish phase from physical path length. Used here: A phase wrap preserves the complex transmission at the design wavelength. [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.
- **A lens as a phase element:** Read a thin optical element as multiplication by a spatially varying phase. Used here: The lesson converts a focusing phase profile into a physical height profile. [Review: TU Delft · Coherent optical imaging](https://qiweb.tudelft.nl/aoi/coherentimaging/coherentimaging/). In §7.1, find the thin-lens transmission t_lens and the field immediately after the lens. Focus on multiplication by a position-dependent phase.

**Python preparation:** Apply modulo and quantization to arrays, then compare wavelengths using consistent length units.
- [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.
- [NumPy · Discrete Fourier Transform](https://numpy.org/doc/stable/reference/routines.fft.html) — Read Implementation details and Normalization; look up fftfreq, fftshift, and ifftshift as they appear in the notebook.

**Developed here:** Test wrapped phase, fabrication levels, and chromatic mismatch in a flat optic.

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

## Learning outcomes

- Convert physical height into a phase delay.
- Explain why phase wrapping is equivalent at one design wavelength.
- Quantify staircase efficiency and identify when the thin-element model fails.

## Use the lesson

Watch the [E06 film](https://www.youtube.com/watch?v=0rMp3nl57Lg) (5:15), 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

1D scalar thin-element lens, fixed n = 1.5, design λ₀ = 550 nm, aperture radius 15 μm and paraxial focal length 120 μm. Propagation uses exact scalar ASM. Fresnel reflection, material dispersion, polarization, and sidewall coupling are omitted.

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

- [Levy, Mendlovic & Marom · Efficiency analysis of diffractive lenses](https://opg.optica.org/josaa/abstract.cfm?uri=josaa-18-1-86)
- [TU Delft · Wavefield propagation](https://qiweb.tudelft.nl/aoi/wavefieldpropagation/wavefieldpropagation/)
