Results

Computational Performance

Speed Benchmark

We benchmark the runtime to compute a single \(201 \times 201\) 2D PSF image against the size of the pupil. The image is captured at focus, and all input parameters take default values in our library. We compare the runtime of all four propagators on CPU and GPU and show the results in Fig. 59. The benchmarking was performed on a machine with an Intel i9-10900X CPU and an NVIDIA GeForce RTX 3090 GPU.

Image A
Image B

Fig. 59 Speed benchmark. Time to generate a \(201 \times 201\) PSF for different numerical sizes of the pupil, for the different four propagators, on CPU (a) and GPU (b). Each data point in the plots is averaged over 10 runs.

We observe that the runtime of all propagators increases with the size of the pupil on CPU. The Cartesian propagators (red) are faster than the spherical ones (blue) on smaller sizes (<512 pixels) but slower on large sizes. This illustrates the difference in the computational complexity of each method. Scalar propagators (dotted) are faster than their vectorial counterparts (solid), by roughly 1.5 times for Cartesian and 3 times for spherical cases. On GPU, Cartesian propagators are faster than on CPU at the same grid size and the curves (red) behave similarly. Spherical propagators, however, exhibit a flat curve (blue) which indicates that they efficiently benefit from the GPU parallelization. The speed improvement between scalar and vectorial propagators is small, especially for the Cartesian case. Hence, vectorial propagators should be preferred over the scalar ones as the accuracy gain does not come at a high computational cost. Moreover, Cartesian propagators are recommended if one works with images of small sizes for both scalar and vectorial cases; while spherical propagators should be preferred for large sizes, especially when GPU is available.

Accuracy Benchmark

We benchmark the accuracy of both Cartesian and spherical scalar propagators with the analytic Airy disk for asymptotic limit (the Fourier transform of a perfect circular aperture):

(170)\[ F_{\mathrm{AD}}(\rho) = \frac{2J_1(\rho)}{\rho},\]

where \(J_1\) is the Bessel function of the first order of the first kind. As the Airy disk is the Fourier transform of a perfect unit modulus circular aperture, an additional factor \(s_z = \cos\theta\) is introduced in Eq. (150) and Eq. (152). This corresponds to a paraxial approximation.

The spherical integral is computed using two numerical integration rules: the Riemann rule (a first-order method) and the Simpson’s rule (a fourth-order method). The error \(\delta\) is the \(L_2\)-norm of the difference between the output electric field \(E\) of the propagator and \(F_{\text{AD}}\), as in

(171)\[ \delta = \|E - F_{\text{AD}}\|_2.\]
../../../_images/benchmark_accuracy_plot.png

Fig. 60 Accuracy benchmark of the Cartesian propagator (red) and the spherical propagator using the Riemann rule (green) and Simpsons’ rule (blue). \(h\) is the step size of integration.

We observe in Fig. 60 that the error decreases as the number of points in the integration domain increases in all cases. The spherical propagator has a linear convergence rate using the Riemann rule (green) and fourth-order convergence rate using Simpsons’ rule (blue), which correlates well with their expected accuracy. The Cartesian propagator, which is based on our custom FFT, shows a convergence rate between first and second order.