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

\[ \frac{1}{q_0} = \frac{1}{f}\left(1 - \frac{L}{f}\right) + \frac{2i}{kw_0^2}, \]

so that at the distance \(z\) from the back focal plane

\[ E(r, z) = E_0\, \frac{q_0}{q_0 + z}\, e^{ikr^2/[2(q_0 + z)]}, \]

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#

  • focus gives 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.

  • focus followed by free agrees to 10⁻⁶ over ±4 Rayleigh ranges. free is 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\).

Intensity map through the focus, on-axis intensity and on-axis phase, fourierslm against the analytic beam

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

focus

complex128

back focal plane

3.1e-08

50 cm

focus

complex64

back focal plane

1.5e-07

50 cm

focus, then free on ±2.5 mm

complex128

z from −4 z_R to 4 z_R

1.1e-06

30 cm

focus

complex128

back focal plane

3.1e-08

30 cm

focus

complex64

back focal plane

1.7e-07

30 cm

focus, then free on ±2.5 mm

complex128

z from −4 z_R to 4 z_R

1.2e-06