Examples¶
The example notebooks illustrate the modules with examples whose physics is easy to follow, and compare the numerics with analytic results wherever an analytic solution exists. They are shown here with their stored outputs; to run them yourself, see Running the notebooks.
Propagation and diffraction¶
Free-space propagation: Fresnel, Rayleigh-Sommerfeld, Fraunhofer
Vectorial diffraction: longitudinal fields, vector beams and high NA foci
Chirp-z transform: zoomed spectra, shifted and scaled propagation
Propagation in inhomogeneous media: the wave propagation method (WPM)
Propagation with analytic phase: semi-analytical and homeomorphic Fourier transforms
FDTD basics: pulses, absorbing boundaries, a Bragg mirror and a cylinder
Beams, modes and paraxial optics¶
Interfaces, thin films and polarization¶
Layer stacks as transfer functions: Goos-Hänchen shift, frustrated TIR and etalons
A coated laser mirror: thin film design, polarization ray trace and vectorial focus
Imaging, aberrations and ray tracing¶
Basis functions: Zernike, Legendre, Chebyshev and orthogonalized sets
From rays to waves: the focus of a lithography projection lens
Rays and waves: which way round does a plano-convex lens go?
Rays and waves in a laser processing head: a diffractive 5 × 5 spot splitter
Rays and waves in an eye aberrometer: a Shack-Hartmann sensor behind a schematic eye
Gaussian beam decomposition through a lens system: a spatial filter
Measurement, phase retrieval and beam shaping¶
Measuring the radius of curvature of lenses with a Fizeau interferometer
Measuring a lens two ways: Shack-Hartmann versus phase diversity
Digital holographic microscopy: holography, TIE and phase unwrapping
Phase retrieval with the transport-of-intensity equation (TIE)
Beam shaping with the iterative Fourier transform algorithm (IFTA)
Microscopy¶
Abbe image formation: diffraction orders, pupil cutoff and partial coherence
Confocal microscopy: pinhole, PSF product and optical sectioning
Fourier ptychography: a synthetic aperture from an LED array
Digital holographic microscopy: holography, TIE and phase unwrapping (in Measurement, phase retrieval and beam shaping)
Lithography¶
Vectorial imaging: lines and spaces with s, p and unpolarized light
The lithography toolbox: sources, masks, mask and wafer stacks, process windows
From lens design to the wafer: aberrations across the scanner slit
Mask models compared: Kirchhoff, film, boundary layer and RCWA
Seidel aberrations surface by surface: correction and tension in Caldwell’s KrF lens
Running the notebooks¶
You need an installation of pyoptics as described in the main README, plus
matplotlib, Jupyter and (for notebook 12) ipywidgets, all contained in the
notebooks extra:
pip install -e ".[notebooks]"
jupyter lab notebooks/
The widgets of notebook 12 only work with a running kernel; static viewers such as GitHub show the static figures stored below each interactive cell.
Run times on an ordinary laptop range from a few seconds to about a minute per notebook (longest: 01 and 05), with these exceptions:
about 5 minutes: 32 (lithography toolbox, many focus-exposure matrices and through-pitch series), 41 (telecentricity, some 200 polarization ray traces over the slit)
about 3 minutes: 21 (rays to waves, angular spectrum propagation to many planes), 28 (phase retrieval, many HIO runs), 47 (rays and waves, propagation to many planes and sums of 7 800 Gaussian beamlets)
about 2 minutes: 20 (polarization ray trace), 33 (lens aberrations, ray traces over the slit and Zernike sensitivities)
about 2.5 minutes: 52 (Abbe image formation, partially coherent images summed over thousands of source points)
about 3 minutes: 56 (Gaussian beam decomposition, sums of 9 000 beamlets over the pinhole plane)
about 1.5 minutes: 09 (mode analysis, basis fits and large LG expansions), 25 (Shack-Hartmann vs. phase diversity), 26 (holography, many refocusing runs on 1024² padded grids), 31 (vectorial imaging lithography), 37 (mask models, RCWA over a grid of pitches and duty cycles), 45 (Zernike gallery, fifteen lenses tuned, traced and propagated through focus), 53 (phase contrast and DIC), 55 (Fourier ptychography, many reconstructions)
Notebooks 14 (coated laser mirror), 24 (radius interferometer), 27 (holographic microscopy), 34 (Hopkins/SOCS), 35 (resist), 36 (rigorous mask), 38 (Jones pupils) and 54 (confocal microscopy) take 20 to 30 seconds, 39 (source optimization) and 40 (OPC) about 10 seconds; 57 (FDTD basics) takes about a minute.
The FFTs (pyoptics.fft) use all CPU cores; FFT-heavy notebooks such as 04
(chirp-z transform) and 26 (holography) run about 30 to 45 % faster than with
single threaded FFTs. Set pyoptics.fft.workers = 1 to use a single core.
To re-execute all notebooks and store their outputs:
jupyter nbconvert --to notebook --execute --inplace notebooks/*.ipynb