# E01 · The angular spectrum method

Follow a slit field into space by changing the representation: separate its directions, advance their phases, and add them back.

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

**Where will the light go after this plane?**

You know the field just after a slit or a phase mask, but the detector sits farther away. Predicting its image means following diffraction and phase through space. The same problem appears when refocusing a hologram or checking whether a designed optic produces its intended pattern.

**What you gain:** Build a propagation tool that later lessons reuse, predict how aperture, wavelength, and distance change a field, and recognize when a surprising pattern comes from the numerical grid.
<!-- 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:** Read a wave as A exp(iφ) and intensity as |u|². Used here: The propagation factor changes each component's phase and, for evanescent components, its amplitude. [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.
- **Fourier transforms and convolution:** Interpret a Fourier transform as a change from position to spatial-frequency components. Used here: Each component represents one transverse wavevector. [Review: TU Delft · Fourier analysis](https://qiweb.tudelft.nl/aoi/fourieranalysis/fourieranalysis/). Use §4.1 for the transform pair, then §4.2.1–4.2.4 for linearity, scaling, shifts, and convolution. Consult §4.2.7 for two successive transforms.
- **Matrices, eigenvectors, and modes:** Recognize a basis expansion and Av = λv. Used here: The film describes plane waves as eigenfunctions of free-space propagation. [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.

**Python preparation:** Use complex arrays and FFT frequency bins; keep physical sample spacing separate from array indices.
- [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:** Build the angular-spectrum propagator and test its sampling and propagation limits.

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

## Learning outcomes

- Interpret a Fourier coefficient as a plane-wave amplitude.
- Predict how wavelength, aperture width, and distance change diffraction.
- Separate physical evanescent decay from numerical aliasing and wrap-around.

## Use the lesson

Watch the [E01 film](https://www.youtube.com/watch?v=y5bIpnGhecs) (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, monochromatic propagation in homogeneous free space. The slit is a 1D field invariant in the omitted direction. No vector polarization, material boundary scattering, detector averaging, or noise is modeled. FFT windows are periodic.

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

- [TU Delft · Wavefield propagation](https://qiweb.tudelft.nl/aoi/wavefieldpropagation/wavefieldpropagation/)
- [NumPy · Fourier transforms and normalization](https://numpy.org/doc/stable/reference/routines.fft.html)
