Benchmark#
A Gaussian beam of radius \(w\) with a flat wavefront on the SLM gives in the back focal plane, by the FT formula, a Gaussian of radius \(w_0 = \lambda f/(\pi w)\) with the curvature \((1 - L/f)/f\). Free space adds \(z\) to its complex radius
so that at the distance \(z\) from the back focal plane
with \(E_0 = -i\sqrt{I_0}\) the on-axis field in the back focal plane and \(I_0 = 2P/(\pi w_0^2)\).
focus is compared with this field in the back focal plane, and focus followed by free over the scan, with the SLM
in the front focal plane and 20 cm closer to the lens.
Summary#
focusgives the analytic field in the back focal plane to 3·10⁻⁸ in complex128, the part of the beam cut by the edge of the SLM, and to 2·10⁻⁷ in complex64.focusfollowed byfreeagrees to 10⁻⁶ over ±4 Rayleigh ranges.freeis exact beyond the paraxial approximation, and this is the size of the correction.
Figure#
Left, the intensity through the focus by focus and free, with the analytic radius \(w(z)\). Middle and right, the intensity and the phase
on the axis, for both distances from the SLM to the lens. The on-axis phase is the Gouy phase, shifted by the
curvature when \(L \neq f\).
Running the benchmark#
From the root of the repository,
uv run --with matplotlib python benchmarks/analytic/run.py
Table#
Accuracy#
Gaussian beam of radius 1.2 mm on a 1200 × 1200 grid of 8 µm pixels, 1030 nm, f = 50 cm, so w₀ = 137 µm and z_R = 5.7 cm. Largest difference over a window of ±3w₀, relative to the peak.
SLM–lens distance |
method |
precision |
planes |
error |
|---|---|---|---|---|
50 cm |
|
complex128 |
back focal plane |
3.1e-08 |
50 cm |
|
complex64 |
back focal plane |
1.5e-07 |
50 cm |
|
complex128 |
z from −4 z_R to 4 z_R |
1.1e-06 |
30 cm |
|
complex128 |
back focal plane |
3.1e-08 |
30 cm |
|
complex64 |
back focal plane |
1.7e-07 |
30 cm |
|
complex128 |
z from −4 z_R to 4 z_R |
1.2e-06 |