betaFeedback

WorksPhysics and Astronomy

A Computational and Experimental Framework for Fourier Optics in Python

Abstract

Simulation of the propagation of light is useful for the design and dimensioning of optical systems. In this paper, we present the basics of propagation simulation using Fourier optics and practical implementation in Python, with a particular emphasis on dimensions. We first verify that our numerical wave-optics simulations maintain correct physical spatial scaling. Next, we benchmark numerical propagation against closed-form analytical formulas for Gaussian beams, lens focusing effects, and grating diffraction. We then show how those simulations can be used to generate diffractive optical elements such as Fresnel zone plates, and we bridge the gap between numerical simulations and experiments by collecting data and recovering phase information using a phase retrieval algorithm.

Introduction

Light propagates through space and time as an electromagnetic wave, whose behavior can in principle be described rigorously via Green’s function formalisms. In many scenarios relevant to optical imaging and laser systems, however, a complete vector wave treatment is unnecessary. Instead, the propagation is well described by Fourier optics—a frequency-based approximation that emerges naturally when propagation distances are large and the system remains relatively close to the optic axis (the paraxial regime).

At its core, this framework relies on the property of linearity, allowing us to regard optical propagation as a mapping between an object’s spatial distribution g(x,y)g(x,y) and its corresponding spatial frequency spectrum G(fx,fy)G(f_x,f_y), defined via the two-dimensional Fourier transform:

G(fx,fy)=∫−∞∞∫−∞∞g(x,y)e−j2π(fxx+fyy) dx dy(1)G(f_x,f_y) = \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} g(x,y)e^{-j2\pi(f_xx+f_yy)}\,dx\,dy \tag*{(1)}

In this representation, each frequency point physically corresponds to a plane wave traveling at a unique propagation angle, as illustrated in Figure 1. Where applicable, this Fourier approach drastically simplifies complex geometries and optical elements into manageable mathematical expressions that can be computed efficiently. Beyond computational convenience, it provides profound physical insight into the behavior of imaging systems, diffraction limits, and spatial frequency filtering.

Conceptual representation of spatial frequency decomposition in Fourier optics

Figure 1. Conceptual representation of spatial frequency decomposition in Fourier optics: (a) An image of pansies in physical spatial coordinates; (b) The corresponding 2-D spatial frequency magnitude spectrum (displayed on a logarithmic scale), where each frequency point physically represents a plane wave traveling at a unique propagation angle.

To bridge the gap between theoretical wave propagation and practical simulation, this paper presents the fundamentals of Fourier optics simulation implemented in Python, with a rigorous emphasis on spatial scaling. We begin by verifying that our numerical wave-optics framework maintains correct physical scaling, and we benchmark our propagation routines against closed-form analytical formulas for Gaussian beams, lens focusing effects, and grating diffraction. Building on these validated foundations, we demonstrate how these simulations can be used to generate diffractive optical elements such as Fresnel zone plates. Finally, we connect numerical models directly to experimental work by processing real data and recovering lost phase information via phase retrieval algorithms.

A working familiarity with this frequency-space description of real-space objects will serve as our primary mathematical language as we move forward. Keeping these tools in mind will take us a long way through the derivations and numerical implementations that follow in § 2.

Theoretical Background: Fourier Analysis in Optics

The Fourier Transform as a Mathematical Decomposition

The primary utility of the Fourier transform (FT) in optics is its ability to perform a mathematical decomposition. Building upon the general two-dimensional transform introduced in § 1, we specialize this relationship for optical fields. A complex scalar field distribution g(x,y)g(x,y) evaluated at an input plane can be broken down into a continuous linear combination of elementary plane waves via the forward and inverse Fourier transform pair:

G(fx,fy)=∫−∞∞∫−∞∞g(x,y)e−j2π(fxx+fyy) dx dy(2)G(f_x,f_y) = \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} g(x,y)e^{-j2\pi(f_xx+f_yy)}\,dx\,dy \tag*{(2)}
g(x,y)=∫−∞∞∫−∞∞G(fx,fy)ej2π(fxx+fyy) dfx dfy(3)g(x,y) = \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} G(f_x,f_y)e^{j2\pi(f_xx+f_yy)}\,df_x\,df_y \tag*{(3)}

where G(fx,fy)G(f_x,f_y) determines the relative complex amplitude of each specific frequency component.

Physically, each term in the inverse integral can be identified as an elementary function consisting of a plane wave traveling in a unique direction away from the input plane, as illustrated in Figure 2. The spatial frequencies (fx,fy)(f_x,f_y) define the transverse wavelength and propagation angles via the directional cosines:

Spatial frequency decomposition into propagating plane waves

Figure 2. Conceptual schematic of spatial frequency decomposition in Fourier optics. An arbitrary input field distribution g(x,y)g(x,y) at z=0z=0 is decomposed into a linear superposition of plane waves traveling at distinct propagation angles θ=arcsin⁡(λfx)\theta= \arcsin(\lambda f_x) determined by their spatial frequency components fxf_x.

fx=sin⁡θxλ,fy=sin⁡θyλ(4)f_x = \frac{\sin\theta_x}{\lambda}, \qquad f_y = \frac{\sin\theta_y}{\lambda} \tag*{(4)}

This decomposition allows us to calculate the response of an optical system to an arbitrary complex field by simply superimposing the independent contributions of these individual plane wave eigenmodes, as demonstrated schematically by the continuous plane-wave fanout in Figure 2.

To see how this continuous decomposition applies to periodic structures, consider what happens when an optical field interacts with a repeating grating. Rather than a continuous spectrum, periodic boundaries constrain the decomposition to a discrete set of spatial frequencies. This behavior is illustrated in Figure 3, where an incident beam interacting with a periodic transmission function is decomposed into discrete plane wave eigenmodes that fan out into distinct, angularly separated diffraction orders (0, ±1\pm1, . . .).

Physical interpretation of Fourier decomposition via a periodic diffraction grating

Figure 3. Physical interpretation of Fourier decomposition via a periodic diffraction grating: (a) A plane-wave optical beam at normal incidence interacts with a grating of period dd, acting as a spatial phase/amplitude filter; (b) The periodic structure decomposes the incident wavefront into a discrete superposition of plane wave eigenmodes, which physically fan out into discrete diffracted orders (0, ±1\pm1, . . .); (c) Propagation fanout into distinct, angularly separated diffracted orders along the zz-axis.

Computational Foundations: Numerical Grid and Frequency Analysis

The foundation of a wave-optics simulation is the translation of continuous physical coordinates into discrete numerical arrays defined in terms of physical quantities, such as meters. This environment is established using a uniformly spaced spatial coordinate array xx spanning [−L/2,L/2][-L/2,L/2], which follows the standard index arrangement where a finite side length LL is spanned by MM samples. The relationship between these parameters is defined by:

L=MΔx(5)L = M\Delta x \tag*{(5)}

where Δx\Delta x is the spatial sampling interval. In two dimensions, this is extended to a grid using np.meshgrid:

x=linspace⁡(−L2,L2,LΔx+1)(6)x = \operatorname{linspace}\left(-\frac{L}{2},\frac{L}{2},\frac{L}{\Delta x}+1\right) \tag*{(6)}

Transition to the Frequency Domain via the DFT

To move from continuous wave theory to numerical simulation, we utilize the Discrete Fourier Transform (DFT), which approximates the analytic Fourier integral through a Riemann sum. This Fourier framework is essential because it allows us to treat optical phenomena as linear spatial filters, decomposing complex field distributions into simpler ”elementary” plane waves.

By convention, the frequency domain is divided into MM and NN evenly spaced coordinate values. This is accomplished by the following substitutions for spatial frequencies fxf_x and fyf_y:

fx→pMΔx,andfy→qNΔy,f_x \to\frac{p}{M\Delta x}, \qquad\text{and} \qquad f_y \to\frac{q}{N\Delta y},

where

p=−M2,…,M2−1,andq=−N2,…,N2−1p=-\frac{M}{2},\ldots,\frac{M}{2}-1, \qquad\text{and} \qquad q=-\frac{N}{2},\ldots,\frac{N}{2}-1
Δfx=1MΔx=1Lx,andΔfy=1NΔy=1Ly(7)\Delta f_x=\frac{1}{M\Delta x}=\frac{1}{L_x}, \qquad\text{and} \qquad\Delta f_y=\frac{1}{N\Delta y}=\frac{1}{L_y} \tag*{(7)}

The parameters Δfx\Delta f_x and Δfy\Delta f_y represent the ”frequency sample intervals,” which dictate the spectral resolution of the simulation.

Fast Fourier Transform (FFT) and Array Centering

Because optical simulations frequently require cascading multiple propagation steps or performing repeated field transformations, we utilize the Fast Fourier Transform (FFT) algorithm.[1, 2] The FFT is a highly efficient implementation of the Discrete Fourier Transform (DFT) that reduces the computational complexity from O(N2)O(N^2) to O(Nlog⁡2N)O(N\log_2 N) complex multiplications and additions.[2]

To appreciate this computational gain, consider a 1-D spatial coordinate array of N=1000N=1000 grid points. A direct matrix evaluation of the DFT requires N2=1,000,000N^2=1{,}000{,}000 operations, whereas the FFT algorithm requires only Nlog⁡2N≈1000×10=10,000N\log_2 N\approx1000\times10=10{,}000 operations—achieving a 100×100\times speedup.[2] This advantage scales even more dramatically in two-dimensional simulations (N×NN\times N grids). For a modest 1000×10001000\times1000 spatial array (10610^6 total pixels), a naive 2-D DFT demands O(N4)O(N^4) or (106)2=1012(10^6)^2=10^{12} (one trillion) operations, rendering standard desktop evaluation completely unrealistic. In contrast, the 2-D FFT executes in O(N2log⁡2N)O(N^2\log_2N) or roughly 2×1072\times10^7 operations. This mathematical efficiency makes 2-D wave-optics simulations accessible on standard personal computers rather than requiring high-performance supercomputing clusters.[2]

Mathematically, the Fourier transform is essentially its own inverse (a near-involution property).[1] The forward Fourier transform F\mathcal{F} and the inverse Fourier transform F−1\mathcal{F}^{-1} share identical functional structures, differing only by a sign flip in the complex exponential kernel and an overall normalization factor 1/N1/N;[1, 2]

F{u(x)}=∫−∞∞u(x)exp⁡(−j2πfxx) dx,F−1{U(fx)}=∫−∞∞U(fx)exp⁡(+j2πfxx) dfx(8)\mathcal{F}\{u(x)\} = \int_{-\infty}^{\infty} u(x)\exp(-\mathrm{j}2\pi f_xx)\,\mathrm{d}x,\qquad\mathcal{F}^{-1}\{U(f_x)\} = \int_{-\infty}^{\infty} U(f_x)\exp(+\mathrm{j}2\pi f_xx)\,\mathrm{d}f_x \tag*{(8)}

Because of this fundamental symmetry, both forward spectrum decomposition and inverse field reconstruction utilize the exact same FFT computational engine.[2]

A practical issue in FFT implementation concerns the spatial indexing of array values. While continuous physical optics models are centered around the optical axis (x=0x=0), standard FFT libraries (such as numpy.fft) expect the zero-frequency coordinate to reside at the first index position (). To maintain physical consistency and prevent phase-wrapping artifacts during numerical propagation, np.fft.fftshift and np.fft.ifftshift are applied to re-center both the complex field arrays and the spatial-frequency coordinate bins (fxf_x).[2]

Free-space optical propagation is modeled in the spatial-frequency domain via the angular spectrum / transfer function approach (propTF). Given an input complex electric field Uin(x)U_{\mathrm{in}}(x) defined across a transverse window size LL, wavelength λ\lambda, and propagation distance zz, the propagated output field Uout(x)U_{\mathrm{out}}(x) is evaluated through the following three-step procedure:

  1. Complex Angular Spectrum Computation: Convert the input spatial field uin(x)u_{\mathrm{in}}(x) into the spatial-frequency domain using the forward Fast Fourier Transform:

Uin(fx)=F{uin(x)},(9)U_{\mathrm{in}}(f_x) = \mathcal{F}\{u_{\mathrm{in}}(x)\}, \tag*{(9)}

where fxf_x denotes the spatial frequency coordinate and F\mathcal{F} represents the 1-D Fourier transform operator.

  1. Transfer Function Modulation: Apply the paraxial (Fresnel) free-space transfer function H(fx)H(f_x) to introduce the distance-dependent quadratic phase shift across spatial frequencies.[1, 2]

H(fx)=exp⁡(−jπλzfx2),(10)H(f_x) = \exp\left(-\mathrm{j}\pi\lambda z f_x^2\right), \tag*{(10)}

where j=−1\mathrm{j}=\sqrt{-1} is the imaginary unit.

  1. Field Reconstruction: Transform the modulated spectrum back to the spatial domain via the inverse Fast Fourier Transform:

Uout(x)=F−1{Uin(fx)⋅H(fx)}.(11)U_{\mathrm{out}}(x) = \mathcal{F}^{-1}\{U_{\mathrm{in}}(f_x)\cdot H(f_x)\}. \tag*{(11)}

Intensity and the Optical Phase Problem

While the wave propagation operator propTF processes the full complex electric field Uout(x)=∣Uout(x)∣exp⁡[jϕ(x)]U_{\mathrm{out}}(x)=|U_{\mathrm{out}}(x)|\exp[\mathrm{j}\phi(x)], physical sensors cannot respond to the ultra-high oscillation frequencies of optical fields (∼1014 Hz\sim10^{14}\ \mathrm{Hz}).[1, 2] Consequently, real-world optical detectors measure only the time-averaged irradiance, or intensity I(x)I(x).[1]

I(x)=∣Uout(x)∣2=Uout(x)⋅Uout∗(x)(12)I(x) = |U_{\mathrm{out}}(x)|^2 = U_{\mathrm{out}}(x)\cdot U_{\mathrm{out}}^*(x) \tag*{(12)}

where Uout∗(x)U_{\mathrm{out}}^*(x) denotes the complex conjugate.

In this measurement process, the spatial phase distribution ϕ(x)=arg⁡(Uout(x))\phi(x)=\arg(U_{\mathrm{out}}(x)) is completely discarded. The loss of phase information constitutes the fundamental phase problem in optics.[1, 3] Because wavefront curvature, focus position, and spatial aberrations are encoded directly within the phase profile, intensity-only measurements make inverse optical problems—such as wavefront sensing and aberration correction—inherently challenging, necessitating specialized recovery techniques such as interferometry, holography, or iterative phase retrieval.[1, 3, 4]

Comparison between the spatial screen plane and the spatial frequency plane

Figure 4. Comparison between the spatial screen plane (x,y)(x,y) and the spatial frequency plane (fx,fy)(f_x,f_y) for an M×MM \times M grid. The spatial domain spans a physical window length L=M⋅ΔxL = M \cdot\Delta x, where Δx\Delta x represents the spatial sampling interval. Under the 2D Fast Fourier Transform (F\mathcal{F}), the corresponding frequency spectrum spans a bandwidth B=1/ΔxB = 1/\Delta x with a frequency sampling resolution of Δf=1/L\Delta f = 1/L.

The implementation accepts the complex input field distribution Uin(x)U_{\mathrm{in}}(x), optical wavelength λ\lambda, numerical window size LL, and displacement zz, returning the complex optical field Uout(x)U_{\mathrm{out}}(x) at the observation plane.

Listing 1: Defining the Foundational Fourier Transform Function

def propTF(uin_V_m, L_m, lambda_m, z_m):
    M = uin_V_m.size             # number of samples (grid points)
    dx_m = L_m/M                 # grid spacing
    k_1_m = 2*np.pi/lambda_m     # wavenumber

    # Frequency coordinates
    fx_1_m = np.linspace(-1/(2*dx_m), 1/(2*dx_m) - (1/L_m), M)

    # Transfer function for Fresnel propagation
    H = np.exp(-1j * np.pi * lambda_m * z_m * (fx_1_m**2))
    H = np.fft.fftshift(H)

    # Fourier transform input field
    Uin_V_m = np.fft.fft(np.fft.fftshift(uin_V_m))

    # Multiply in Fourier space
    Uout_V_m = H * Uin_V_m

    # Inverse FFT --> propagated field
    uout_V_m = np.fft.ifftshift(np.fft.ifft(Uout_V_m))
    return uout_V_m

Elementary Optical Fields

The transverse mode is simulated as a Gaussian intensity distribution:

g(x)=exp⁡(−x22σ2)(13)g(x) = \exp\left(-\frac{x^2}{2\sigma^2}\right) \tag*{(13)}

where σ\sigma represents the beam Root Mean Square (RMS) width. We note that the RMS spatial parameter is distinct from the standard deviation, as the latter pertains strictly to statistical probability distributions rather than physical spatial intensity distributions.

In optics, it is also common practice to characterize the beam width using the Full Width at Half Maximum (FWHM). For an ideal Gaussian intensity distribution, there exists a constant linear relationship between the RMS width σ\sigma and the FWHM:

FWHM=22ln⁡2 σ≈2.355σ(14)\mathrm{FWHM} = 2\sqrt{2\ln2}\,\sigma\approx2.355\sigma \tag*{(14)}

While both quantities can be experimentally measured, the FWHM is often simpler to measure directly from intensity profiles using standard beam profilers, whereas the RMS width provides a direct link to energy distribution and second-moment beam parameters.

Listing 2: Defining a 1D Gaussian Beam Intensity Profile

dx_m = 1e-6                                      # grid size, m: meter
Dx_m = 1                                         # screen size
x_m = np.linspace(-Dx_m/2, Dx_m/2, int(Dx_m/dx_m)+1) # spatial grid along x-axis

x_mean_m = 0.0                                   # centered on origin
x_std_m = 50e-6                                  # RMS beam width (sigma)
g = np.exp(-(x_m - x_mean_m)**2 / (2 * (x_std_m**2))) # Gaussian intensity distribution

# Calculate FWHM from RMS
fwhm_m = 2.355 * x_std_m

The complex optical field U0U_0 is defined as the square root of this intensity to maintain physical consistency during complex propagation. We next propagate the field by 0.1 m, compute the resulting intensity, and plot the initial and propagated profiles (Figure 5).

Initial and propagated Gaussian beam intensity plots

Figure 5. Gaussian beam comparison before and after propagation.

Listing 3: Propagating the Gaussian Optical Field

wavelength_m = 500e-9
zp_m = 100e-3                                   # propagation distance, m

E0 = np.sqrt(g)                                  # initial field amplitude (E0^2 = g)
Ep = propTF(E0, Dx_m, wavelength_m, zp_m)        # propTF propagates field by distance zp_m

Ip = np.abs(Ep)**2                               # propagated intensity

As predicted by classical optics principles, the beam diverges when propagated over a distance—demonstrated by the decreased peak intensity and increased width of the Gaussian in Figure 5b.

For a pure Gaussian beam, conservation of the optical étendue determines the angular spread of the beam. The RMS divergence angle θ\theta can be expressed directly in terms of the wavelength λ\lambda and initial RMS waist σ0\sigma_0:

θ=λ4πσ0(15)\theta= \frac{\lambda}{4\pi\sigma_0} \tag*{(15)}

Using this RMS divergence, a good approximation of the beam size at any axial distance zz is given by the quadratic sum of the waist size and the spread due to angular divergence:[2]

σ(z)=σ02+(θz)2(16)\sigma(z) = \sqrt{\sigma_0^2 + (\theta z)^2} \tag*{(16)}

We can generate the same 1-D Gaussian field used earlier and propagate it over a symmetric range of distances (−1.1-1.1 m to +1.1+1.1 m) using the Fresnel transfer function propTF. We then extract the RMS beam size from the simulated intensity (σsim(z)\sigma_{\mathrm{sim}}(z)) and compare it against the theoretical value.

Listing 4: Symmetric Gaussian Beam Propagation

x_m = np.linspace(-Dx_m/2, Dx_m/2, int(Dx_m/dx_m) + 1)

sigma0_m = 50e-6                         # 50 um RMS waist
I0 = np.exp(-(x_m**2) / (2 * sigma0_m**2)) # intensity profile
E0 = np.sqrt(I0)                         # field amplitude (real
                                         # valued)

Z_m = np.linspace(-1.1, 1.1, 100)

sim_beam_sizes_m = []
Ixz = np.zeros((len(Z_m), len(x_m)))     # normalized intensity vs (z
                                         # ,x)

for idx, z in enumerate(Z_m):
    Ez = propTF(E0, Dx_m, wavelength_m, z)
    Iz = np.abs(Ez)**2

    # Normalise each slice for visualisation (max = 1)
    Iz_norm = Iz / Iz.max()
    Ixz[idx, :] = Iz_norm

    # RMS beam size from intensity weighted second moment
    x_mean = np.sum(x_m * Iz) / np.sum(Iz)
    sigma_z = np.sqrt(np.sum((x_m - x_mean)**2 * Iz) / np.sum(Iz))
    sim_beam_sizes_m.append(sigma_z)

sim_beam_sizes_m = np.array(sim_beam_sizes_m)

# Analytical RMS beam size
theta_rad = wavelength_m / (4 * np.pi * sigma0_m) # RMS divergence (rad)
sigma_th_m = np.sqrt(sigma0_m**2 + (theta_rad * Z_m)**2)

To determine the numerical divergence angle θ\theta from our wave propagation simulation, we utilize the asymptotic behavior of the beam envelope. Far from the beam waist (where the propagation distance zz is large compared to the initial waist size), the hyperbolic expansion σ(z)=σ02+(θz)2\sigma(z) = \sqrt{\sigma_0^2 + (\theta z)^2} approaches a linear asymptote: σ(z)≈θz\sigma(z) \approx\theta z.

Rather than taking a single-point ratio σ/z\sigma/z, which leaves a residual error due to the initial waist offset σ0\sigma_0, we perform a least-squares linear regression (using a first-degree polynomial fit) on the simulated beam sizes across the far-field region (∣z∣>0.5|z| > 0.5 m). The resulting slope of this fit directly yields the measured numerical divergence angle θ\theta.

Listing 5: Extracting the Divergence Angle via Linear Regression

# Select far-field propagation distances where linear divergence dominates
valid_indices = np.abs(Z_m) > 0.5
z_far = Z_m[valid_indices]
sigma_far = sim_beam_sizes_m[valid_indices]

# Perform a 1st-degree polynomial (linear) least-squares fit:
# sigma(z) = slope * z + intercept
popt, cov = np.polyfit(z_far, sigma_far, 1, cov=True)

# The slope (first element) corresponds to the numerical divergence angle
theta_measured = popt[0]

We overlay the analytical curve on the simulated data (Figure 6). We can also plot the same beam propagation in 2D using the normalized intensity values of each axial slice (Figure 7).

Comparison of simulated beam size with the analytical RMS beam size

Figure 6. Comparison of simulated beam size with the analytical RMS beam size.

Beam propagation shown in two dimensions

Figure 7. Beam propagation shown in two dimensions.

Modeling Optical Components

A core application of computational Fourier optics is the numerical representation of physical optical elements. Following the linear systems framework, optical components are modeled as complex transmittance functions tA(x,y)t_A(x,y) that multiply the incident complex wavefront Uin(x,y)U_{\mathrm{in}}(x,y) to produce an exiting field Uout(x,y)=tA(x,y)Uin(x,y)U_{\mathrm{out}}(x,y) = t_A(x,y)U_{\mathrm{in}}(x,y) immediately after the component.[1, 2] This section focuses on modeling a positive thin lens and analyzing the diffraction-limited focal evolution of a Gaussian beam.

Theoretical Framework of the Thin Lens Transmittance

A lens is classified as “thin” if a ray entering at coordinates (x,y)(x,y) on the input plane exits at approximately the same coordinates on the output plane, meaning the transverse displacement of light inside the lens is negligible.[1] Under this paraxial approximation, the lens acts purely as a phase transformer that introduces a spatially varying phase delay proportional to the local thickness profile of the glass.[1, 2]

In general physical optical setups, a lens possesses a finite physical size that defines the pupil function P(x,y)P(x,y). This pupil clips the spatial extent of the beam, limiting the spatial frequency bandwidth and establishing the effective diffraction-limited beam size at the focal plane.[1, 2] Neglecting constant phase delays, the general complex amplitude transmittance tl(x,y)t_l(x,y) of a positive lens of focal length ff is given by:[1]

tl(x,y)=P(x,y)exp⁡(−jk2f(x2+y2))(17)t_l(x,y)=P(x,y)\exp\left(-\mathrm{j}\frac{k}{2f}(x^2+y^2)\right) \tag*{(17)}

where k=2π/λk=2\pi/\lambda is the wave number. Physically, the quadratic phase term converts an incident planar wavefront into a converging spherical wavefront that focuses at a distance z=fz=f downstream.

For our 1-D numerical simulations, we assume the incident beam is well contained within the lens boundary and is not clipped, allowing us to remove the pupil function (P(x)≈1P(x)\approx1). Consequently, the thin-lens phase mask simplifies to a function of the single transverse axis xx:[1]

L(x)=exp⁡(−jπλfx2)(18)L(x)=\exp\left(-\mathrm{j}\frac{\pi}{\lambda f}x^2\right) \tag*{(18)}

When explicit pupil clipping is included in broader physical models, we ensure that the physical aperture size is defined to be strictly smaller than the computational simulation window (DL<DxD_L<D_x) so that edge-diffracted light remains fully contained within the grid. While full multi-element imaging systems are beyond the scope of this single-lens focal study, aperture pupil clipping plays a central role in imaging systems and represents a natural direction for future considerations of multi-lens systems.[1]

The focal length ff of the system is governed by the thin lens equation (derived from the lensmaker’s formula), which relates ff to the object (source) plane distance pp and conjugate image plane distance qq via the classical lens law:[1, 2]

1f=1p+1q(19)\frac{1}{f}=\frac{1}{p}+\frac{1}{q} \tag*{(19)}

Numerical Implementation and Code Structure

The physical principles of thin-lens wavefront modulation are implemented numerically by applying the quadratic lens phase mask onto the discretized spatial coordinate array. To visualize the complete longitudinal propagation through a lens system, transverse field slices are evaluated at discrete axial steps zz from the source plane (z=−pmz=-p_m), through the lens plane (z=0z=0), to the conjugate image plane (z=qmz=q_m).

Because peak focal intensity increases by orders of magnitude at the waist compared to the unfocused wings, plotting raw unscaled intensity profiles directly can obscure the converging and diverging beam structure away from focus. To ensure the beam cone remains clearly visible across all axial positions, each transverse slice is normalized by its local peak intensity value:[2]

Inorm(x,z)=I(x,z)max⁡x{I(x,z)}(20)I_{\mathrm{norm}}(x,z)=\frac{I(x,z)}{\max_x\{I(x,z)\}} \tag*{(20)}

Listing 6 details the Python implementation for constructing the thin-lens phase mask, propagating the field to the conjugate focal plane, and accumulating the normalized X−ZX-Z longitudinal cross-sectional map shown in Figure 8.

Longitudinal intensity profile ($X-Z$ cross-section)

Figure 8. Longitudinal intensity cross-section (X−ZX-Z map) showing coherent beam convergence through a positive thin lens at z=0z = 0 mm. The beam originates at the source plane z=−pm=−150z = -p_m = -150 mm and focuses at the conjugate image plane z=qm=+250z = q_m = +250 mm. Each transverse slice is normalized to its local peak intensity to render the light cone clearly visible across all axial positions.[1, 2]

Listing 6: Numerical Implementation of Lens Propagation and Longitudinal Mapping

import numpy as np
import matplotlib.pyplot as plt

# Physical parameters
p_m = 0.15                 # Object/source distance to lens (m)
q_m = 0.25                 # Lens to conjugate image plane distance (m)
wavelength_m = 500e-9      # Source wavelength (m)

# Thin Lens Law calculation of focal length
f_m = 1.0 / (1.0 / p_m + 1.0 / q_m)

# Quadratic lens phase mask in 1-D
lens_mask = np.exp(-1j * (2 * np.pi / wavelength_m) / (2 * f_m) * x_m**2)

# Field immediately after the lens (Ep is the propagated source field from z =
# -p_m)
E_after_lens = Ep * lens_mask

# Propagate complex field from lens plane (z = 0) to image plane (z = q_m)
Ef = propTF(E_after_lens, Dx_m, wavelength_m, q_m)

# Longitudinal scan: accumulate normalized transverse slices across Z
z_scan = np.linspace(-p_m, q_m, 200)
I_zx = []

for z in z_scan:
    if z < 0:
        # Propagation before lens (from source plane at z = -p_m to z)
        Ez = propTF(E0, Dx_m, wavelength_m, z + p_m)
    else:
        # Propagation after lens (from lens plane at z = 0 to z)
        Ez = propTF(E_after_lens, Dx_m, wavelength_m, z)

    Iz = np.abs(Ez)**2
    I_zx.append(Iz / np.max(Iz))  # Normalize each slice so beam remains visible

I_zx = np.array(I_zx)

Sampling Constraints and Transverse Magnification Scaling

A major requirement in numerical wave-optics simulations is ensuring that both free-space propagations and thin-lens phase modulations are sampled without spatial phase aliasing.[2] For a propagation distance zz across a transverse grid or aperture window of size DD, the spatial sampling interval Δx\Delta x must satisfy the fundamental sampling criterion:[2]

Δx≤λzD(21)\Delta x \le\frac{\lambda z}{D} \tag*{(21)}

While general free-space propagation limits dictate the minimum grid resolution required to prevent boundary aliasing over distance zz, focusing through a lens specifically introduces constraints governed by transverse magnification MtM_t.[1, 2]

According to paraxial geometric and wave optics, the transverse magnification MtM_t for a single-lens system with object distance pp and conjugate image distance qq is defined by the distance ratio:[1]

Mt=−qp(22)M_t = -\frac{q}{p} \tag*{(22)}

When the input source distance pp and initial waist size σ0\sigma_0 are held constant, the focused RMS spot size σimage\sigma_{\mathrm{image}} at the conjugate plane z=qz=q scales linearly with the throw distance qq:

σimage(q)=σ0⋅∣Mt∣=σ0(qp)(23)\sigma_{\mathrm{image}}(q) = \sigma_0 \cdot|M_t| = \sigma_0 \left(\frac{q}{p}\right) \tag*{(23)}

This magnification scaling governs two complementary sampling considerations during numerical focal simulations:

  1. Focal Waist Resolution (Short qq): At short image distances qq (small magnification ∣Mt∣<1|M_t| < 1), the beam converges to a tight, highly localized focal waist. The spatial grid spacing Δx\Delta x must be sufficiently fine (Δx≪σimage\Delta x \ll\sigma_{\mathrm{image}}) to resolve the focal peak without under-sampling or corrupting numerical moment calculations.[2]

  1. Window Boundary Expansion (Large qq): At large image distances qq (large magnification ∣Mt∣>1|M_t| > 1), the expanding beam beyond focus requires a sufficiently wide spatial window Dx=MΔxD_x = M\Delta x to prevent light from spilling over array boundaries and producing periodic wrap-around artifacts.[2]

Focused Spot Size vs. Image Distance

To quantitatively verify this magnification model, we simulate focal spot convergence across a sweep of image distances qm∈[0.05 m,0.50 m]q_m \in[0.05\ \mathrm{m}, 0.50\ \mathrm{m}] for a fixed object distance pm=0.15 mp_m = 0.15\ \mathrm{m}. For each step, the focal length fmf_m is dynamically updated using the thin lens law (1/fm=1/pm+1/qm)(1/f_m = 1/p_m + 1/q_m) to maintain focus at the target observation plane.

Figure 9a plots the resulting focused RMS beam radius σimage\sigma_{\mathrm{image}} as a function of qmq_m, demonstrating an exact linear agreement with the analytical magnification scaling ∣Mt∣=qm/pm|M_t| = q_m/p_m.

Quantitative magnification analysis of thin-lens focusing

Figure 9. Quantitative magnification analysis of thin-lens focusing: (a) Focused RMS spot size σimage\sigma_{\mathrm{image}} as a function of conjugate image distance qmq_m for pm=0.15p_m = 0.15 m, verifying the linear relationship ∣Mt∣=qm/pm|M_t| = q_m/p_m; (b, c) Stacked 2-D transverse focal intensity distributions (I(x,y)I(x,y)) comparing the tight, high-contrast spot at short throw (qm=0.10q_m = 0.10 m) against the magnified profile at intermediate throw (qm=0.25q_m = 0.25 m).

To illustrate the spatial impact of magnification on the transverse profile, Figure 9b and Figure 9c present 2-D cross-sectional intensity distributions (I(x,y))(I(x,y)) evaluated at two distinct conjugate image planes:

  • Short Throw Distance (qm=0.10 mq_m = 0.10\ \mathrm{m}, ∣Mt∣≈0.67|M_t| \approx0.67): At short image distances, the beam undergoes strong convergence, concentrating the optical power into a tight, high-contrast focal spot with a compact spatial footprint (Figure 9b).

  • Intermediate Throw Distance (qm=0.25 mq_m = 0.25\ \mathrm{m}, ∣Mt∣≈1.67|M_t| \approx1.67): At larger throw distances, the increased transverse magnification spreads the optical power across a wider spatial area, yielding a broader spot profile (Figure 9c).

It is important to note that the linear magnification ratio holds strictly under ideal conditions where no pupil or aperture clipping occurs. When physical aperture limits or severe pupil clipping are introduced, truncated optical power redistribution causes the actual imaged spot to appear larger than predicted by simple geometric scaling. Throughout this analysis, we assume an idealized numerical aperture window without truncation artifacts—a constraint that warrants further investigation regarding finite lens apertures in future work.

Listing 7 provides the Python code used to execute the image-distance sweep, calculate the focal waist sizes, and generate the stacked 2-D intensity maps.

import numpy as np
import matplotlib.pyplot as plt

# Fixed simulation parameters
p_m = 0.15                    # Fixed object distance (150 mm)
wavelength_m = 500e-9         # Source wavelength (500 nm)

# Sweep of conjugate image distances q_m
q_sweep_m = np.linspace(0.05, 0.50, 10)
sigma_image_m = []

# Loop over q distances to compute focal spot sizes
for q_m in q_sweep_m:
    f_m = 1.0 / (1.0 / p_m + 1.0 / q_m) # Focal length via Thin Lens Law
    lens_mask = np.exp(-1j * (np.pi / (wavelength_m * f_m)) * x_m**2)

    E_after_lens = Ep * lens_mask
    Ef = propTF(E_after_lens, Dx_m, wavelength_m, q_m)
    If = np.abs(Ef)**2

    # Calculate numerical RMS waist size from second moment
x_mean = np.sum(x_m * If) / np.sum(If)
sig_z = np.sqrt(np.sum((x_m - x_mean)**2 * If) / np.sum(If))
sigma_image_m.append(sig_z * 1e6) # Convert to micrometers

Quantitative Verification of System Magnification

To validate the numerical accuracy of our wave-optics framework, we perform a statistical characterization of the beam size at both the source plane (z=−pmz=-p_m) and conjugate focal plane (z=qmz=q_m) using the Root Mean Square (RMS) width. The RMS width provides a robust measure of the spatial extent of the intensity distribution I(x)I(x) by calculating its second central moment:[2]

σrms=∑(x−xˉ)2I(x)∑I(x)(24)\sigma_{\mathrm{rms}} = \sqrt{\frac{\sum(x-\bar{x})^2 I(x)}{\sum I(x)}} \tag*{(24)}

where xˉ=∑xI(x)∑I(x)\bar{x}=\frac{\sum xI(x)}{\sum I(x)} is the centroid (intensity-weighted first moment) of the beam, and ∑I(x)\sum I(x) provides power normalization, ensuring that σrms\sigma_{\mathrm{rms}} is invariant to overall intensity scaling.[2] Listing 8 tracks the beam width from the initial object plane to the focused image plane for pm=0.15p_m=0.15 m and qm=0.25q_m=0.25 m.

Listing 8: Numerical Verification of Beam Magnification

# Compute field at conjugate focus (q_m = 0.25 m)
Ep_focus = propTF(E_after_lens, Dx_m, wavelength_m, q_m)
I_focus = np.abs(Ep_focus)**2

# RMS width of initial beam at object plane (source)
x_mean_init = np.sum(x_m * np.abs(E0)**2) / np.sum(np.abs(E0)**2)
x_std_init = np.sqrt(np.sum((x_m - x_mean_init)**2 * np.abs(E0)**2) / np.sum(np.abs(E0)**2))

# RMS width of focused beam at conjugate image plane (focus)
x_mean_focus = np.sum(x_m * I_focus) / np.sum(I_focus)
x_std_focus = np.sqrt(np.sum((x_m - x_mean_focus)**2 * I_focus) / np.sum(I_focus))

Executing this script yields:

Initial RMS beam size: 25.00 um
Focused RMS beam size: 41.67 um
Calculated Ratio (initial/focused): 0.60

Interpretation of Results

The transverse magnification MtM_t predicted by geometric optics for pm=0.15p_m=0.15 m and qm=0.25q_m=0.25 m is ∣Mt∣=qm/pm=0.25/0.15≈1.667|M_t|=q_m/p_m=0.25/0.15\approx1.667. Applying this scale factor to our initial Gaussian beam waist (σobject=25.00\sigma_{\mathrm{object}}=25.00 µm) predicts a focused spot size of exactly:

σimage=σobject⋅∣Mt∣=25.00 μm×1.667=41.67 μm(25)\sigma_{\mathrm{image}}=\sigma_{\mathrm{object}}\cdot|M_t|=25.00\ \mu\mathrm{m}\times1.667=41.67\ \mu\mathrm{m} \tag*{(25)}

Our wave-optics simulation—computed via the propTF function propagator—recovers this exact value of 41.67 µm. The calculated scaling ratio of 0.60 represents the inverse magnification (1/∣Mt∣=pm/qm1/|M_t|=p_m/q_m). This perfect numerical agreement verifies that our discrete Fourier framework preserves physical spatial scaling, energy conservation, and imaging magnification laws.[1, 2]

Simulation of Diffractive Elements and Gratings

A key area of wave-optics modeling is the simulation of diffractive optical elements, which manipulate wavefronts through localized diffraction rather than refraction.[1] In the linear systems framework, a diffracting screen is represented by its complex amplitude transmittance function tA(x,y)t_A(x,y), defined as the ratio of the exiting complex field to the incident complex field immediately behind the screen.[1, 2]

Eexiting(x,y)=Eincident(x,y)⋅tA(x,y)(26)E_{\mathrm{exiting}}(x,y)=E_{\mathrm{incident}}(x,y)\cdot t_A(x,y) \tag*{(26)}

Diffractive elements are generally categorized into amplitude gratings, which control the magnitude of the field, and phase gratings, which alter the local optical path length without weakening the field.[1, 2] This section focuses on modeling a binary amplitude grating and analyzing the resulting spatial frequency separation as the field propagates.

Binary Amplitude Grating Formulation and Sampling

A binary diffraction grating consists of a periodic array of opaque and transparent slits acting as a square-wave transmittance mask tA(x)t_A(x) with a period dd that alternates between 0 (absorption) and 1 (complete transmission).[1]

To model this square-wave profile directly, we take the signum function of a sine wave and scale/shift it to make the transmittance strictly positive, alternating cleanly between 0 and 1:

tA(x)=12[1+sgn⁡(sin⁡(2πdx))](27)t_A(x)=\frac{1}{2}\left[1+\operatorname{sgn}\left(\sin\left(\frac{2\pi}{d}x\right)\right)\right] \tag*{(27)}

We implement this periodic transmittance in a 1-D spatial grid. The number of discrete grid points MdM_d that span a single grating period dd must satisfy:[2]

Md=dΔx≥2(28)M_d=\frac{d}{\Delta x}\ge2 \tag*{(28)}

to avoid spatial aliasing. While a minimum of 2 samples satisfies Eq (28), a larger value of MdM_d is required in practice to represent the abrupt, step-like binary phase and amplitude boundaries without introducing numerical ringing artifacts.[1, 2]

With a grid spacing of Δx=1 μm\Delta x=1\ \mu\mathrm{m} and a grating period of d=10 μmd=10\ \mu\mathrm{m}, our grid allocates exactly Md=10M_d=10 samples per cycle, ensuring a highly resolved representation of the binary transition boundaries.

Listing 9: Generating a Binary Grating Mask

period_m = 10e-6 # Grating period (10 micrometers)

# Create a binary mask where transmission is 1 (True) or 0 (False)
grating = 0.5 * (1 + np.sign(np.sin(2 * np.pi * x_m / period_m)))

# Apply the transmittance function to the propagated beam
Eg = Ep * grating
Ig = np.abs(Eg)**2

When the propagated Gaussian field EpE_p interacts with this element, the exiting complex field EgE_g is the point-wise product of the wave and the mask. This results in an altered near-field intensity distribution where the smooth Gaussian envelope is masked by the periodic structure, as shown in Figure 10.

Transverse intensity distribution of a Gaussian beam after passing through a binary grating mask

Figure 10. Transverse intensity distribution (Ig=∣Eg∣2I_g = |E_g|^2) of a Gaussian beam immediately after passing through the binary grating mask, showing the modulation of the Gaussian envelope.

Tilt in Fourier Propagation

Beyond diffraction from periodic structures, wave-front manipulation can also be introduced via phase ramps, commonly referred to as tilt. Applying a linear phase modulation across the initial field tilts its direction of travel, causing the entire beam to steer off-axis during propagation.

An angular tilt θtilt\theta_{\mathrm{tilt}} modifies the optical field such that, under the paraxial approximation, it translates to a linear transverse displacement over propagation distance zz.1

Δx(z)≈ztan⁡θtilt≈zθtilt(29)\Delta x(z) \approx z \tan\theta_{\mathrm{tilt}} \approx z\theta_{\mathrm{tilt}} \tag*{(29)}

For a specified tilt angle of θtilt=10\theta_{\mathrm{tilt}} = 10 mrad (0.01 rad), the expected transverse displacement at a propagation distance of zp=100z_p = 100 mm is:

Δx(100 mm)≈100 mm×0.01 rad=1 mm(1000 μm)(30)\Delta x(100\ \mathrm{mm}) \approx100\ \mathrm{mm} \times0.01\ \mathrm{rad} = 1\ \mathrm{mm}\quad(1000\ \mu\mathrm{m}) \tag*{(30)}

To track this trajectory, we simulate the propagation loop by applying the tilt factor to the initial field E0E_0 and evaluating the transverse intensity profile across axial steps up to zp=100z_p = 100 mm.

Listing 10: Longitudinal Propagation of a Tilted Gaussian Beam

zp_m = 100e-3  # propagation distance, m

Et = E0 * tilt  # apply tilt to the initial field
Ept = propTF(Et, Dx_m, wavelength_m, zp_m)  # propagate
Ipt = np.abs(Ept)**2  # intensity

# Longitudinal grid setup
num_pts = 100
z_after = np.linspace(0, zp_m, num_pts)

# Propagation loop with per-slice peak normalization
I_zx = []
for z in z_after:
    Ep = propTF(Et, Dx_m, wavelength_m, z)
    I_slice = np.abs(Ep) ** 2

    # Normalize slice to its peak value
    max_val = np.max(I_slice)
``
if max_val > 0:
    I_slice = I_slice / max_val

I_zx.append(I_slice)

I_zx = np.array(I_zx)

The resulting longitudinal intensity profile, shown in Figure 11, clearly illustrates the steering effect. As the beam propagates from z=0z = 0 to z=100z = 100 mm, its center shifts continuously downward to approximately −1000-1000 μ\mum (1 mm). This exact agreement with analytical predictions confirms that the transfer function propagator correctly handles directional shifts associated with off-axis beam propagation.[1, 2]

Longitudinal intensity profile of beam with 10 mrad tilt

Figure 11. Longitudinal intensity profile (X−ZX - Z cross-section) of a Gaussian beam with a 10 mrad wavefront tilt, showing linear transverse steering over a 100 mm propagation range.

Longitudinal Propagation and Angular Separation

We can map the 2-D longitudinal evolution of the diffracted field across the X−ZX - Z plane by repeating the propagation calculations over a sequence of axial steps zz. As light travels away from the grating plane, the individual Fourier components (the diffracted orders) begin to separate.

According to classical grating diffraction theory, the diffracted orders exit the screen at angles θn\theta_n governed by the grating equation:[1]

sin⁡θn=nλd(31)\sin\theta_n = n \frac{\lambda}{d} \tag*{(31)}

Under the paraxial approximation, these angular deflections translate to a linear spatial separation Δxn\Delta x_n along the transverse axis as a function of propagation distance zz:[1]

Δxn(z)≈zsin⁡θn=nλzd(32)\Delta x_n(z) \approx z \sin\theta_n = n \frac{\lambda z}{d} \tag*{(32)}

For our simulation parameters (λ=500\lambda= 500 nm, d=10d = 10 μ\mum), the first-order deflection angle is:

θ±1≈±500×10−9 m10×10−6 m=±0.05 rad(±50 mrad)(33)\theta_{\pm1} \approx\pm\frac{500 \times10^{-9}\ \mathrm{m}}{10 \times10^{-6}\ \mathrm{m}} = \pm0.05\ \mathrm{rad}\quad(\pm50\ \mathrm{mrad}) \tag*{(33)}

At a propagation distance of z=100z = 100 mm (0.1 m), the expected transverse separation of the +1 and -1 diffracted orders from the central optical axis is:

Δx±1≈±0.1 m×0.05 rad=±5 mm(34)\Delta x_{\pm1} \approx\pm0.1\ \mathrm{m} \times0.05\ \mathrm{rad} = \pm5\ \mathrm{mm} \tag*{(34)}

In the scanning loop used to construct this longitudinal propagation map, for each step zz, we propagate the field EgE_g, normalize its intensity to maintain visual contrast, and calculate the evolving beam RMS width to monitor divergence.

Listing 11: Binary Grating Mask in Two Dimensions

# Define axial steps from z = 0 to z = 0.5 m
Z = np.linspace(0, 0.5, 500)
sim_beam_sizes = []

Ixz = np.zeros((len(Z), len(x_m)))
for i, z in enumerate(Z):
    Ed = propTF(Eg, Dx_m, wavelength_m, z)
    Id = np.abs(Ed)**2
    Ixz[i, :] = Id / np.max(Id)

    x_mean = np.sum(x_m * Id) / np.sum(Id)
    x_std = np.sqrt(np.sum((x_m - x_mean)**2 * Id) / np.sum(Id))
    sim_beam_sizes.append(x_std)

sim_beam_sizes = np.array(sim_beam_sizes)

The resulting cross-sectional intensity map, shown in Figure 12, visually illustrates this diffractive branching. Near the grating plane (z=0z = 0), the field remains confined. As zz increases, the wave-front splits into distinct fan-out cones. The central branch represents the 0-order beam containing 25% of the incident power, while the branching arms represent the +1 and −1 diffracted orders, each containing 6.25% of the incident power.

Longitudinal intensity profile of a Gaussian beam after passing through the grating

Figure 12. Longitudinal intensity profile (X−ZX - Z cross-section) of a Gaussian beam after passing through the grating, illustrating the spatial fan-out of the 0 and ±1\pm1 diffraction orders.

The spatial separation observed in Figure 12 matches our analytical paraxial calculation of ±5 mm at z=100z = 100 mm, demonstrating that the paraxial propagator propTF correctly preserves the wave scaling, angular dispersion, and physical scaling limits of Fourier optics.[1, 2]

Experimental Characterization of Diffractive Focusing Elements

While refractive optics dominate visible-light imaging, diffractive optical elements such as Fresnel zone plates are essential in regions of the electromagnetic spectrum—such as the extreme ultraviolet and X-ray regimes—where conventional optical glasses are highly absorbing.[3] FZPs manipulate wavefronts through localized diffraction rather than refraction, focusing light by constructive interference of waves emanating from concentric circular zones. This section details the experimental characterization of a Fresnel zone plate and compares the measured focal evolution against paraxial wave propagation theory.

Theoretical Framework of Fresnel Zone Plates and Digital Holography

A Fresnel zone plate (FZP) is a diffractive lens consisting of concentric alternating transparent and opaque zones. For a rigorous treatment of zone plate transmittance functions, multi-order focal positions (fn=±f/nf_n = \pm f/n), and diffractive efficiencies, the reader is referred to Atwood.5

To maximize diffraction efficiency in computational optics, we implement a phase-only binary holographic reconstruction workflow.

Numerical Implementation and Code Structure

The simulation isolates the phase components of the forward-propagated source field (Esource−propE_{\mathrm{source-prop}}) and back-propagated image field (Eimage−propE_{\mathrm{image-prop}}) to construct a stationary interference pattern without amplitude attenuation.1,2 Hard thresholding is then applied to generate a binary mask suitable for digital wavefront reconstruction.

Listing 12 consolidates this workflow: isolating the phase superposition, binarizing to form the mask, modulating with a reference plane wave, and back-propagating to the focal plane.

Listing 12: Numerical Recombination, Binarization, and Digital Holographic Reconstruction

# 1. Isolate phase and compute phase-only superposition
I_sum = np.abs(E_source_prop + E_image_prop)**2
phase_source = np.exp(1j * np.angle(E_source_prop))
phase_image = np.exp(1j * np.angle(E_image_prop))
I_sum2 = np.abs(phase_source + phase_image)

# 2. Threshold to generate binary hologram mask (0 or 1)
hologram = (I_sum2 / 2) >= 0.5

# 3. Wavefront Playback: Use a uniform incident reference beam (plane wave)
E_source_holo = np.ones(hologram.shape)

# 4. Modulate reference wave by the binary hologram
E_holo = E_source_holo * hologram

# 5. Propagate back to focal plane (-z_prop_m to focus down to a point)
E_image_holo = propTF(E_holo, Dx_m, 500e-9, -z_prop_m)

Physical Interpretation of the Reconstructed Field

As illustrated in Figure 13, the workflow progresses through four physical regimes:

Simulation and reconstruction of holographic interference patterns

Figure 13. Simulation and reconstruction of holographic interference patterns: (a) Total continuous intensity distribution IsumI_{\mathrm{sum}}, (b) Phase-only superposition Isum2I_{\mathrm{sum2}}, (c) Binarized digital hologram mask, and (d) Reconstructed focal intensity profile ∣Eimage−holo∣2\lvert E_{\mathrm{image-holo}}\rvert^2. Spatial dimensions are in micrometers (μm\mu\mathrm{m}).

  1. Continuous Interference (Figure 13a): Quadratic phase curvature mismatch between the source and image fields produces high-contrast concentric interference fringes with a central destructive intensity null.[1, 2]

  1. Phase-Only Superposition (Figure 13b): Setting local amplitudes to unity isolates the phase carrier, maintaining 100% modulation contrast and preventing high-frequency outer fringes from decaying into noise.

  1. Binary Hologram Mask (Figure 13c): Thresholding at 0.5 converts the continuous phase pattern into a binary transmission grating analogous to a binary FZP.

  1. Reconstructed Focus (Figure 13d): During wavefront playback, the binarized hologram is illuminated by a replica of the original source reference wave (Esource_holoE_{\mathrm{source\_holo}}) and propagated to the conjugate focal plane. Despite the complete loss of amplitude information and the severe non-linear binarization of the phase carrier, the reconstructed intensity distribution ∣Eimage_holo∣2\lvert E_{\mathrm{image\_holo}}\rvert^2 successfully focuses into a highly localized, diffraction-limited central spot.

Data Collection

Intro to Data Collection

To validate our numerical transfer-function propagator (propTF) against physical wave fields, we constructed an optical test bench to perform camera-based through-focus profiling. Before presenting the reconstructed longitudinal intensity distributions, it is essential to establish the physical geometry, component specifications, and data collection routine of the apparatus.

As illustrated in the schematic diagram of Figure 14, the experimental apparatus consists of three primary optical sections:

Photo and schematic diagram of the optical bench setup for through-focus spatial profiling

Figure 14. Photo and schematic diagram of the optical bench setup for through-focus spatial profiling: A spatially filtered, collimated laser beam (λ=633\lambda= 633 nm) illuminates the test optic (a Fresnel zone plate). A high-resolution camera profiler (3.45 μ\mum pixel pitch) is mounted on a linear translation stage and swept along the optical axis (zz-axis) across the focal volume, capturing a sequence of 2-D transverse intensity distributions I(x,y;z)I(x,y;z) at discrete axial positions.

  1. Coherent Illumination Source: A spatially filtered and collimated laser source (λ=633\lambda= 633 nm) delivers a uniform, clean planar wavefront across the clear aperture of the optical bench.

  1. Test Optical Element: The collimated beam interacts with the test optic—a Fresnel zone plate (FZP)—which impresses a converging quadratic phase delay onto the incident wavefront to form a diffraction-limited focus.

  1. Axial Camera Profiling Assembly (zz-Scan): A high-resolution camera profiler (pixel pitch Δxpixel=3.45 μm\Delta x_{\mathrm{pixel}} = 3.45\ \mu\mathrm{m}, 8-bit ADC, full well capacity 10,000 e−e^{-}) is mounted on an axial linear translation stage aligned along the optical axis (zz).

Radiometric Calibration to Physical Power Density

To convert raw camera digital numbers (ADU) into absolute physical irradiance (W/m2^2), we implement a multi-stage radiometric conversion pipeline.

First, raw 8-bit (sensor-specific) digital readings IADUI_{\mathrm{ADU}} are converted to photoelectron counts Ie−I_{e^{-}} using the sensor full well capacity (FWD = 10,000 e−e^{-}):

Ie−=IADU×(FWD2bit_depth−1)(35)I_{e^{-}} = I_{\mathrm{ADU}} \times\left(\frac{\mathrm{FWD}}{2^{\mathrm{bit\_depth}} - 1}\right) \tag*{(35)}

Accounting for the camera quantum efficiency (QE = 0.8), the photoelectron field is converted into incident photon counts Iphoton=Ie−/QEI_{\mathrm{photon}} = I_{e^{-}}/\mathrm{QE}. The optical energy EpixelE_{\mathrm{pixel}} deposited per pixel is calculated using Planck’s photon energy relation Eγ=hc/λE_{\gamma} = hc/\lambda at λ=633\lambda= 633 nm (source specific) (Eγ≈3.14×10−19E_{\gamma} \approx3.14 \times10^{-19} J):

Epixel=Iphoton⋅(hcλ)(36)E_{\mathrm{pixel}} = I_{\mathrm{photon}} \cdot\left(\frac{hc}{\lambda}\right) \tag*{(36)}

Dividing by the camera exposure time used (τ=75 μs\tau= 75\ \mu\mathrm{s}) converts energy to optical power Ppixel=Epixel/τP_{\mathrm{pixel}} = E_{\mathrm{pixel}}/\tau in Watts. Finally, dividing by the individual pixel area (Apixel=Δxpixel2A_{\mathrm{pixel}} = \Delta x_{\mathrm{pixel}}^{2}, with pixel pitch Δxpixel=3.45 μm\Delta x_{\mathrm{pixel}} = 3.45\ \mu\mathrm{m}) yields the absolute power density distribution Iphysical(x,y)I_{\mathrm{physical}}(x,y) in W/m2^2:

Iphysical(x,y)=PpixelΔxpixel2(37)I_{\mathrm{physical}}(x,y) = \frac{P_{\mathrm{pixel}}}{\Delta x_{\mathrm{pixel}}^{2}} \tag*{(37)}

Listing 13 details the implementation of this calibration routine.

Listing 13: Converting Detector ADU Readings to Physical Irradiance (W/m2^2)

# Sensor specifications
fwd = 10000              # Full well depth (electrons)
bit_depth = 8            # 8-bit ADC (0 to 255)
qe = 0.8                # Quantum efficiency
exposure_time_s = 75e-6 # Exposure time (75 microseconds)
pixel_size_m = 3.45e-6  # Pixel size (3.45 micrometers)
wavelength_m = 633e-9   # Laser wavelength (633 nm)

# Physical constants
h_Js = 6.62607015e-34   # Planck’s constant (J*s)
c_ms = 3e8              # Speed of light (m/s)

# 1. ADU -> Photoelectrons
electrons_per_adu = fwd / (2**bit_depth - 1)
img_electron = data * electrons_per_adu

# 2. Photoelectrons -> Incident Photons
img_photon = img_electron / qe

# 3. Photons -> Deposited Energy (Joules)
E_J = h_Js * c_ms / wavelength_m
img_J = img_photon * E_J
# 4. Energy -> Power (Watts)
img_power_W = img_J / exposure_time_s

# 5. Power -> Power Density (W/m^2)
img_power_density_W_m2 = img_power_W / (pixel_size_m**2)

# Spatial axes in millimeters
x_mm = np.linspace(0, img_power_density_W_m2.shape[5] * pixel_size_m * 1e3,
                   img_power_density_W_m2.shape[5])
y_mm = np.linspace(0, img_power_density_W_m2.shape * pixel_size_m * 1e3,
                   img_power_density_W_m2.shape)

Experimental Spatial Profiling and Data Extraction

To experimentally map the diffractive focusing behavior, a through-focus series is recorded by capturing the transverse spatial profile of the beam at discrete axial planes along the optical axis. The experimental run consists of a 21-step scan spanning a total range of 2.0 m around the nominal focal volume of an aberration-free test zone plate.

The captured 2-D images are integrated along the vertical axis to compress the spatial data into 1-D transverse cross-sections. These 1-D profile slices are normalized to prevent saturation and then concatenated sequentially to map the longitudinal intensity evolution I(x,z)I(x,z) across the focal volume.

Theoretical Comparison and Focal Verification

The reconstructed longitudinal profile (Figure 15) illustrates the formation of a highly symmetrical diffractive light cone on either side of the focal waist. This spatial evolution is compared directly with paraxial wave theory.

Experimentally reconstructed longitudinal intensity distribution

Figure 15. Experimentally reconstructed longitudinal intensity distribution (X−ZX-Z cross-section) of the laser beam passing through the Fresnel zone plate focal volume.

Under the paraxial approximation, the convergence and subsequent divergence of the diffractive light cone are governed by the numerical aperture of the outermost zone.1 In our experimental prototype, the zone plate focal length fexpf_{\mathrm{exp}} is identified by locating the plane of maximum axial intensity and optimal contrast, which corresponds to the narrowest transverse spot size in the through-focus profile:[3]

Cz=Imax⁡−Imin⁡Imax⁡+Imin⁡(38)C_z = \frac{I_{\max} - I_{\min}}{I_{\max} + I_{\min}} \tag*{(38)}

By fitting this contrast curve to a Gaussian model, the plane of best focus z∗z^* is determined with high sub-pixel precision.[3]

The successful mapping of this focal waist demonstrates that our paraxial propagation framework—based on the discrete transfer function propagator propTF—accurately models not only simple refractive elements but also complex diffractive optics. This quantitative validation confirms that the numerical scaling conventions are fully preserved when translating physical experimental data into the computational domain.[2]

Iterative Phase Retrieval: The Gerchberg-Saxton Algorithm

A fundamental limitation of physical optical sensors is that they are sensitive only to time-averaged irradiance (intensity) I(x,y)∝∣E(x,y)∣2I(x,y) \propto|E(x,y)|^2, completely discarding the phase of the complex amplitude field. However, the phase distribution contains vital information regarding wavefront aberrations, propagation direction, and spatial coherence.[3] While digital holography recombines a reference wave to record phase interferometrically, iterative phase retrieval represents a powerful, referenceless alternative that extracts the complex phase digitally from intensity measurements alone.[4]

The Gerchberg-Saxton (GS) algorithm, originally proposed by Gerchberg and Saxton in 1972 for electron microscopy, is an iterative optimization framework that reconstructs a complex field by cycling between two planes with known intensity constraints. While classical GS algorithms propagate between the spatial domain and its Fourier transform plane, modern wave-optics metrology frequently employs the algorithm in the Fresnel (or diffractive) domain.[4] Propagating between two axially separated diffractive planes (such as a focus and a defocused plane) significantly accelerates the convergence rate and reduces reconstruction error.[4]

Mathematical Formulation and Convergence Metrics

We define two measurement planes along the optical propagation axis: Plane A (located at position zAz_A, representing the focal plane) and Plane B (located at zBz_B, representing a defocused plane), separated by an axial distance Δz=zB−zA\Delta z = z_B - z_A. The known physical constraints are the measured intensities IA(x,y)I_A(x,y) and IB(x,y)I_B(x,y) captured at these planes.

The target amplitudes AA(x,y)A_A(x,y) and AB(x,y)A_B(x,y) are defined as the square roots of the corresponding irradiances:[4]

AA(x,y)=IA(x,y),AB(x,y)=IB(x,y)(39)A_A(x,y) = \sqrt{I_A(x,y)}, \qquad A_B(x,y) = \sqrt{I_B(x,y)} \tag*{(39)}

If an initial phase estimate is unavailable, the algorithm begins by assigning a random phase distribution ϕinit(x,y)∈[−π,π]\phi_{\mathrm{init}}(x,y) \in[-\pi,\pi] to the amplitude at Plane A.[4] Let gA(k)(x,y)g_A^{(k)}(x,y) represent the estimated complex field at Plane A during iteration kk. The iterative loop proceeds through the following sequential operations:

  1. Enforce Plane A Constraints: We construct the starting field estimate at Plane A by combining the known target amplitude AAA_A with the retrieved phase ϕA(k)\phi_A^{(k)}.[4]

gA(k)(x,y)=AA(x,y)exp⁡(iϕA(k)(x,y))(40)g_A^{(k)}(x,y) = A_A(x,y)\exp\left(i\phi_A^{(k)}(x,y)\right) \tag*{(40)}
  1. Forward Fresnel Propagation: The field is propagated forward by the distance Δz\Delta z to Plane B using the paraxial transfer function operator P\mathcal{P}.[2, 4]

GB(k)(x,y)=P{gA(k)(x,y);Δz}=F−1{F{gA(k)}⋅H(fx,fy,Δz)}(41)G_B^{(k)}(x,y) = \mathcal{P}\left\{g_A^{(k)}(x,y);\Delta z\right\} = \mathcal{F}^{-1}\left\{\mathcal{F}\left\{g_A^{(k)}\right\}\cdot H(f_x,f_y,\Delta z)\right\} \tag*{(41)}
  1. Enforce Plane B Constraints: The calculated amplitude is replaced by the target amplitude ABA_B, while preserving the phase ∠GB(k)\angle G_B^{(k)} resulting from propagation.2

gB(k)(x,y)=AB(x,y)exp⁡(j∠GB(k)(x,y))(42)g_B^{(k)}(x,y) = A_B(x,y)\exp\left(j\angle G_B^{(k)}(x,y)\right) \tag*{(42)}
  1. Backward Fresnel Propagation: The modified field is propagated backward by the distance −Δz-\Delta z to return to Plane A.2

GA(k+1)(x,y)=P{gB(k)(x,y);−Δz}=F−1{F{gB(k)}⋅H(fx,fy;−Δz)}(43)G_A^{(k+1)}(x,y) = \mathcal{P}\left\{g_B^{(k)}(x,y);-\Delta z\right\} = \mathcal{F}^{-1}\left\{\mathcal{F}\left\{g_B^{(k)}\right\}\cdot H(f_x,f_y;-\Delta z)\right\} \tag*{(43)}

The phase of this back-propagated field, ϕA(k+1)=∠GA(k+1)\phi_A^{(k+1)}=\angle G_A^{(k+1)}, is extracted to initialize the next iteration.2

To evaluate convergence, we define the root-mean-square (RMS) error of the intensity profile at each step.2 In our numerical model, this error is calculated as the normalized Euclidean norm of the difference between the propagated field’s intensity and the target Plane B measurement:

RMS(k)=∥∣GB(k)(x,y)∣2−IB(x,y)∥2∥IB(x,y)∥2(44)\mathrm{RMS}^{(k)} = \frac{\left\lVert\left|G_B^{(k)}(x,y)\right|^2-I_B(x,y)\right\rVert_2}{\left\lVert I_B(x,y)\right\rVert_2} \tag*{(44)}

Numerical Implementation and Code Structure

Listing 14 details the core Python loop of our Fresnel-domain Gerchberg-Saxton implementation. By utilizing our paraxial propagator propTF, the code simulates the propagation steps using Fourier domain filtering, tracking error convergence over 50 iterations.

# Indices for Plane A (best focus) and Plane B (defocused plane)
idx_A = 20  # Plane A index in the z_scan array
idx_B = 19  # Plane B index in the z_scan array

# Known target intensities and propagation distance
I_z = np.abs(E_z[:, idx_A])**2  # Intensity at Plane A (target)
I_z_p = np.abs(E_z[:, idx_B])**2  # Intensity at Plane B (target)
dz = z_scan[idx_B] - z_scan[idx_A]  # Propagation distance (Delta z)

# Target amplitudes derived from intensities
amp_A = np.sqrt(I_z)
amp_B = np.sqrt(I_z_p)

# Initial phase guess at plane A: use Ef phase if available, otherwise random
try:
    init_phase = np.angle(Ef)
    if init_phase.size != amp_A.size:
        raise Exception()
except Exception:
    init_phase = np.random.uniform(-np.pi, np.pi, size=amp_A.size)

u_A = amp_A * np.exp(1j * init_phase)

num_iterations = 50
errors = np.zeros(num_iterations)

for k in range(num_iterations):
    # 1. Forward propagate from Plane A to Plane B
    u_B = propTF(u_A, Dx_m, wavelength_m, dz)
# 2. Enforce amplitude constraint at Plane B
u_B = amp_B * np.exp(1j * np.angle(u_B))

# 3. Backward propagate from Plane B to Plane A
u_A = propTF(u_B, Dx_m, wavelength_m, -dz)

# 4. Enforce amplitude constraint at Plane A
u_A = amp_A * np.exp(1j * np.angle(u_A))

# 5. Monitor convergence: calculate normalized RMS error at Plane B
recon_B = propTF(u_A, Dx_m, wavelength_m, dz)
err = np.linalg.norm(np.abs(recon_B)**2 - I_z_p) / (np.linalg.norm(I_z_p) +
    1e-20)
errors[k] = err

# Final reconstructed fields at both planes
recon_A = u_A
recon_B = propTF(recon_A, Dx_m, wavelength_m, dz)

Convergence Analysis and Experimental Considerations

The convergence performance of our numerical implementation is plotted in Figure 16(a). In the absence of random noise, the relative intensity error decreases monotonically, reaching a machine-precision floor of approximately 10−1410^{-14} within 50 iterations. The intensity overlay (Figure 16(b)}) demonstrates that the reconstructed fields converge perfectly to the target Gaussian profiles. Most importantly, the phase retrieval successfully recovers the original quadratic phase profile at Plane A, establishing a perfect overlay with the unwrapped phase of the physical field (Figure 16(c)}).

Fresnel-domain GS algorithm performance plots

Figure 16. Fresnel-domain GS algorithm performance: (Left) Monotonic convergence of the relative intensity error over 50 iterations. (Center) Comparison of target and reconstructed intensities at both Plane A and Plane B. (Right) Retrieved phase versus the original phase at Plane A.

The diffractive GS framework provides an exceptionally stable and precise tool for wavefront characterization and beam diagnostics, matching analytical wave theory without requiring complex interferometric hardware.[3, 4]

Structured Wavefronts: Helical-Wavefront Beams and Spiral Phaseplates

While the diffractive elements discussed above focus optical energy into highly localized spots,[3] wave optics also enables the generation of structured fields with custom intensity and phase topologies. A prominent class of structured light is the helical-wavefront laser beam—or spiral beam—which is characterized by a phase term proportional to the azimuthal angle θ\theta:[4]

U(r,θ,z)∝exp⁡(jℓθ)(45)U(r,\theta,z) \propto\exp(j\ell\theta) \tag*{(45)}

where ℓ\ell is an integer representing the topological charge of the vortex.[4] At the center of the beam (r=0r = 0), the phase has a screw dislocation (or phase singularity) where the phase is mathematically undefined.[1, 4] To satisfy the scalar wave equation, the complex field amplitude must vanish at this singularity, forming a dark central core surrounded by a bright ring—the classic ”doughnut” intensity profile.[2, 4]

These fields represent orbital angular momentum (OAM) eigenmodes carrying a well-defined torque of ℓℏ\ell\hbar per photon, completely independent of the wave’s polarization state.[4]

Numerical Construction of the Vortex Phase

Following discrete grid conventions, we represent this helical phase profile numerically by constructing a two-dimensional spatial Cartesian coordinate grid (X,Y)(X,Y) using np.meshgrid.[2] The azimuthal angle θ\theta is computed at each pixel using the four-quadrant inverse tangent function (np.arctan2). The complex vortex field is then generated by multiplying a centered Gaussian amplitude distribution uin(x,y)u_{\mathrm{in}}(x,y) by the spiral phase mask.

Listing 15: Numerical Generation of a Charge-2 Vortex Beam

# Generate a spiral ( vortex ) phase and propagate the vortex beam
charge = 2 # topological charge (ell)

# Compute azimuthal angle theta using a 2D meshgrid
X, Y = np.meshgrid(x_m, y_m)
theta = np.arctan2(Y, X)

# Create spiral phase mask and apply to the input Gaussian field
spiral_phase = np.exp(1j * charge * theta)
vortex = uin_V_m * spiral_phase

Immediately after the phase mask is applied (z=0z = 0), the beam’s intensity profile remains a solid, unaltered Gaussian spot because the phase modification does not affect the local irradiance ∣U(x,y)∣2|U(x,y)|^2 (Figure 17).[2, 4]

Initial vortex beam state showing azimuthal phase and Gaussian intensity

Figure 17. Initial vortex beam state (charge ℓ=2\ell= 2): (Left) Azimuthal phase ramp showing 4π4\pi of total phase rotation. (Right) Gaussian intensity profile immediately before propagation.

Propagation and Laguerre-Gaussian Mode Decomposition

The physical properties of the vortex beam emerge during free-space propagation. Using the paraxial transfer function propagator propTF, the field is evolved over a distance z=0.05z = 0.05 m.

Listing 16: Propagation of the Vortex Field

# Define propagation parameters
z_prop_m = 0.05
wavelength = 500e-9

# Compute the complex field at distance z
field_out = propTF(vortex, Dx_m, wavelength, z_prop_m)

Because a “spiralized” Gaussian beam is no longer a pure transverse mode of free space, it is best analyzed by decomposing the exiting field into a complete set of orthogonal Laguerre-Gaussian (LG) modes.[4] LG modes propagate with only a scale change of their intensity distribution, and they naturally accommodate helical phase terms of the form exp⁡(jℓθ)\exp(j\ell\theta).[4]

When propagating downstream, the destructive interference of these superimposed modes close to the optical axis enforces the on-axis intensity null.[4] This results in the ring-like ”doughnut” intensity profile and helical spiral phase arms illustrated in Figure 18.

Propagated vortex beam intensity and phase

Figure 18. Propagated vortex beam at z=0.05z = 0.05 m: (Left) Intensity distribution showing the central singularity. (Right) Helical phase structure showing the spiral evolution of the wavefront.

By varying the charge parameter, the framework can simulate a variety of structured light fields, vortices of (l=1l = 1) (Figure 19(a)) or (l=3l = 3) (Figure 19(b)).

Propagated phase plots for l=1 and l=3

Figure 19. (a) Just as the l=2l = 2 phase plot had two “arms,” at l=1l = 1 the propagated phase has only one ”arm.” (b) At l=3l = 3 the propagated phase has three.

Conclusion

In this work, we presented a comprehensive computational and experimental framework for wave optics and scalar diffraction modeling implemented entirely in Python. Heavily inspired by David Voelz’s foundational text, Computational Fourier Optics: A MATLAB Tutorial,3 this project translates classical numerical Fourier optics algorithms—originally developed for the MATLAB environment—into an open-source, flexible, and accessible Python framework.

Throughout this paper, we established the foundational numerical building blocks required for discrete wave-optics simulations, beginning with 2-D spatial grid conventions, frequency-domain array centering, and paraxial transfer-function propagation (propTF). We demonstrated the modeling of both refractive optical systems—such as positive thin lenses and conjugate magnification scaling—and diffractive optical elements, including binary amplitude gratings, Fresnel zone plates, and structured optical vortex beams carrying orbital angular momentum. Furthermore, we validated these theoretical tools against laboratory through-focus profiling data and demonstrated advanced wavefront recovery methods, including phase-only digital holography playback and referenceless, iterative Fresnel-domain phase retrieval using the Gerchberg-Saxton algorithm.

To streamline future work and make these tools readily accessible to the broader optics community, the core functions developed throughout this research—including spatial grid generators, transfer-function propagators, diffractive mask constructors, and phase-retrieval routines—have been bundled into a dedicated open-source Python package. The topolino package is published on the Python Package Index (PyPI) and can be accessed at https://pypi.org/project/topolino/. By bridging classical scalar wave theory with modern Python scientific computing libraries, this work provides a versatile foundation for optical design, beam diagnostics, and computational metrology.

References

  1. [1]Goodman J W 1996 Introduction to Fourier Optics 2nd ed (New York: McGraw-Hill)
  2. [2]Voelz D G 2011 Computational Fourier Optics: A MATLAB® Tutorial (Tutorial Texts in Optical Engineering vol TT89) (Bellingham, WA: SPIE Press)DOI
  3. [3]Miyakawa R, Zhou X, Goldstein M, Ashworth D, Cummings K, Fan Y J, Shroff Y, Denbeaux G, Kandel Y and Naulleau P 2014 AIS wavefront sensor: a robust optical test of exposure tools using localized wavefront curvature Extreme Ultraviolet (EUV) Lithography V (Proceedings of SPIE vol 9048) ed Wood II O R and Panning E M p 90483ADOI
  4. [4]Zalevsky Z, Mendlovic D and Dorsch R G 1996 Optics Letters 21 842–844

Paper details

vlnc:W_zxrpzr7u
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Physics and Astronomy

Not recorded for this paper

View statement
Looking for related papers…
Contents