🌊 Tool 11 · Wavefront & Aberration Viewer

Wavefront & Aberration Viewer

The orthonormal basis for optical wavefront aberrations over a circular pupil. Visualise Zernike modes, build arbitrary wavefronts, and explore SLM phase-to-far-field Fourier optics, LG beams, OAM, PSF.

Zernike polynomials Z_n^m(ρ,θ) are the standard orthonormal basis for wavefront aberrations on a circular aperture. In AMO experiments they matter for: spatial light modulators (SLMs) that generate arbitrary tweezer arrays and structured light (the SLM's phase pattern is a sum of Zernike modes), high-NA objectives where residual spherical aberration and coma degrade the PSF and increase the tweezer waist, and aberration-corrected imaging paths for single-atom detection. This visualizer lets you decompose any wavefront into Zernike modes, visualize the resulting phase map, and compute the Strehl ratio, a single number summarizing how close your optics are to diffraction-limited performance.

Zernike Polynomial Definition (OSA/ANSI)

Orthonormal over the unit disk ρ ≤ 1 in polar coordinates (ρ, θ):

$$Z_n^m(\rho,\theta) = \begin{cases} \sqrt{2(n+1)}\,R_n^{|m|}(\rho)\cos(m\theta) & m > 0 \\ \sqrt{2(n+1)}\,R_n^{|m|}(\rho)\sin(|m|\theta) & m < 0 \\ \sqrt{n+1}\,R_n^0(\rho) & m = 0 \end{cases}$$ $$R_n^{|m|}(\rho) = \sum_{s=0}^{(n-|m|)/2} \frac{(-1)^s\,(n-s)!\;\rho^{n-2s}}{s!\;\left(\frac{n+|m|}{2}-s\right)!\;\left(\frac{n-|m|}{2}-s\right)!}$$

Orthonormality: ∫|Z_n^m|² ρ dρ dθ / π = 1. Any wavefront W(ρ,θ) = Σ c_n^m Z_n^m; RMS WFE = √(Σ c²).

Standard mode names
Mode selector
Defocus
RMS (unit disk)
Peak-to-valley
Z_n^m (OSA, units λ)
RdBu: blue=min, white=0, red=max
Radial cross-section at θ=0

Wavefront from Zernike Expansion

Any wavefront over a circular aperture: W(ρ,θ) = Σ c_n^m · Z_n^m(ρ,θ), coefficients in waves (λ). RMS WFE = √(Σ c²). Strehl ratio (Maréchal approximation):

S ≈ exp[−(2π · σ_W)²]

Strehl > 0.8 → diffraction-limited (Rayleigh criterion). The PSF is computed via 2D FFT of the pupil function: P(ρ,θ) = A(ρ) · exp[i·2π·W(ρ,θ)].

Zernike expansion coefficients
auto-updating
Wavefront W(ρ,θ) (λ)
RdBu colormap
PSF = |FT{P}|²
Inferno colormap

SLM Phase → Far-Field Intensity

A spatial light modulator (SLM) imprints a programmable phase φ(x,y) on an input Gaussian beam. In the focal plane of a lens, the field is the Fourier transform of the modulated input:

E_ff(u,v) = FT{ E_in(x,y) · exp[iφ(x,y)] } → I_ff = |E_ff|²

Helical phase φ = l·θ converts a Gaussian to a Laguerre–Gaussian LG₀ˡ donut (for l ≠ 0), carrying orbital angular momentum l·ℏ per photon.

SLM Parameters
Configure and press Compute.
Input intensity |E_in|²
Inferno colormap
SLM phase φ (mod 2π)
HSV cyclic: 0→2π = red→red
Far-field intensity |FT{E}|²
Inferno colormap

Laguerre–Gaussian LG₀ˡ beams

Carry OAM l·ℏ per photon. At the beam waist (p=0): |LG₀ˡ| ∝ (r√2/w)^|l| · exp(−r²/w²) Intensity ring at r = w√(|l|/2). Larger ring for larger |l|.

SLM recipe for LG$_0^l$:
1. Input: Gaussian beam
2. Phase: $\varphi = l\cdot\theta$ (helical/vortex phase)
3. Far field $\approx$ LG$_0^l$ (donut for $l\neq0$)

Blazed grating $l\cdot\theta + k\cdot x$: shifts donut off-axis, separates OAM orders spatially
lNameFar-field shape
0Gaussian (LG₀⁰)Central Airy peak
±1First-order vortexSingle donut ring
±2Second-order vortexLarger donut ring
±3Third-order vortexEven larger ring
0 + defocusDefocused GaussianBroadened central peak
0 + astigmatismAstigmatic GaussianElongated / elliptical
0 + gratingBlazed diffractionOff-axis Gaussian spot

Zernike Pyramid, all modes at a glance

Every Zernike polynomial Z_n^m arranged in the standard pyramid (OSA/ANSI order). Columns index the azimuthal frequency m, rows the radial order n. Cosine modes (m > 0) on the right, sine modes (m < 0) on the left. Blue = negative wavefront, white = zero, red = positive (RdBu colormap).

Gerchberg-Saxton (GS) Algorithm — iterative phase retrieval

Given a desired far-field intensity |T(u,v)|² (e.g. a reconfigurable tweezer array), GS finds the SLM phase pattern φ(x,y) that produces it. The algorithm alternates between the SLM plane and the target plane, enforcing known amplitude constraints in each:

GS Parameters
Choose a target and run the algorithm.
Target intensity
Desired tweezer pattern
SLM phase φ (mod 2π)
Computed phase hologram
Reconstructed far-field
|FT{e^{iφ}}|² at each iteration
Convergence: normalised RMSE vs iteration

Algorithm details

Step 1 (SLM plane): Combine input Gaussian amplitude A(x,y) with current phase estimate φₖ(x,y).
Step 2 (FFT → target plane): Propagate the field to the focal plane using a 2D discrete Fourier transform.
Step 3 (target constraint): Replace the amplitude with √T(u,v) while keeping the retrieved phase arg(FT{E}).
Step 4 (IFFT → SLM plane): Propagate back; extract new phase φₖ₊₁.
Typically converges in 20–50 iterations. Efficiency (fraction of power in target spots) reaches 70–90% for typical arrays; adding a blazed grating shifts the 1st order off-axis to separate it from undiffracted light.

GS convergence criterion: RMSE = $\sqrt{\frac{1}{P}\sum_i \left(|E_i|^2 - T_i\right)^2}$ / mean($T$)

Sources