Skip to content

v0.20.0 — Wave optics: aberrated PSF, phase retrieval & cavity modes

Choose a tag to compare

@emircbngl emircbngl released this 29 Jun 06:10

v0.20.0 — Wave optics: aberrated PSF, phase retrieval & cavity modes

Three additions on the verified off-trace wave/FFT layer, plus a real bug fix. Everything here is opt-in and
on-demand: the live single-ray + Gaussian-q trace stays byte-identical.

aberrated_psf — any-mode Zernike aberration of the diffraction PSF (the forward problem)

The general form of wave_psf's defocus knob: aberrate the PSF with any Zernike mode (defocus, astigmatism,
coma, trefoil, spherical) at a chosen RMS, or a full Noll-indexed wavefront vector. The Strehl ratio collapses
the same way for every mode — it depends only on the RMS wavefront error (the Maréchal approximation
exp(−(two·pi·rms)²): 0.05 waves gives 0.906, 0.10 waves gives 0.674) — while the PSF morphology is the mode's
fingerprint: defocus blurs symmetrically, astigmatism elongates, coma flares one-sided, spherical haloes.

fienup_phase_retrieval — reconstruct a hidden object from its diffraction intensity (the inverse problem)

The genuine "phase problem" of coherent diffractive imaging: a detector records only |FFT(object)|² — the
phase is lost. Given that magnitude plus a real-space support mask, Fienup's Hybrid-Input-Output algorithm
reconstructs the unknown object (correlation 0.996, up to the inherent translation + twin ambiguity). Where
v0.19.0's Gerchberg-Saxton knows the amplitude in both planes (CGH design), here the object is unknown — only
its support is; the HIO feedback escapes the stagnation pure error-reduction falls into.

tem_mode — laser cavity transverse eigenmodes

The transverse mode patterns a real resonator emits. family="HG" builds the Hermite-Gaussian TEM_mn
(rectangular, (m+1)(n+1) bright lobes, an orthonormal set); family="LG" builds the Laguerre-Gaussian donut
LG_p,l with an on-axis null and an exp(i·l·phi) phase vortex carrying orbital angular momentum l·hbar.
Validated: HG orthonormality, second moment scaling as (2m+1), lobe count (m+1)(n+1), the LG on-axis null and
its two·pi·l azimuthal phase winding, and the Gouy order.

Fixed — off-trace optics_api wrappers crashed with NameError

gerchberg_saxton, spatial_filter (both v0.19.0) and propagate_chain (v0.18.0) referenced a bare,
un-imported field module. They ran fine when field.* was called directly (as the validation suite does) but
raised NameError when invoked through optics_api / the MCP tool — the path an AI agent actually takes.
The field submodule is imported lazily to keep numpy out of the add-on's startup path; these wrappers omitted
that import. Fixed in all of them, and a regression block now actually invokes every off-trace wrapper
end-to-end so a never-run wrapper can't ship broken again.


Verification: textbook validation 179 → 202 checks, byte-identical regression 375 → 383 checks, the
MCP-to-API parity meta-test green. New demos: aberrated-psf-demo.png, fienup-phase-retrieval-demo.png,
tem-modes-demo.png.

Install / update: the add-on self-updates through Blender's native extension channel. Or drag the attached
optical_alignment_sim-0.20.0.zip into Blender (Edit → Preferences → Get Extensions → Install from Disk).