# E05 · Holography and the phase problem

Turn a phase difference into measurable fringes, recover a complex field from a sideband, and learn what iterative constraints can—and cannot—determine.

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

**How can you recover what an intensity image hides?**

A transparent sample can change optical thickness while barely changing in-focus brightness. Yet measuring that thickness or numerically refocusing the recorded light requires phase. A single intensity image generally leaves several possible fields consistent with the measurement.

**What you gain:** Use a reference wave to encode phase in measurable fringes, and identify the extra constraints needed for retrieval when no reference is available. Assess what a successful reconstruction actually establishes.
<!-- 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:** Expand interference between a signal and a known reference field. Used here: The cross terms carry relative phase into a measured intensity. [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:** Recognize that a linear phase ramp shifts a Fourier spectrum. Used here: An off-axis reference separates the hologram's sidebands. [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.

**Python preparation:** Select a Fourier sideband and alternate between complex amplitude and phase arrays.
- [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:** Recover a field with a reference and compare that route with reconstruction from intensity constraints.

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

## Learning outcomes

- Expand a hologram into its background and interference terms.
- Choose a carrier and Fourier crop that isolate the desired field.
- Distinguish reference-based recovery from iterative phase retrieval and its ambiguities.

## Use the lesson

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

Coherent, stable, monochromatic scalar fields and a known plane-wave reference. The browser uses a periodic, noiseless, explicitly band-limited object and integer-bin carriers. Real detectors add noise, finite pixels, nonuniform reference amplitude, and calibration errors.

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

- [Latychevskaia · Iterative phase retrieval for digital holography](https://arxiv.org/abs/1911.07214)
- [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)
