Diffraction

This package provides some functions and modules to compute various diffraction integral. In general, they compute the complex amplitude on a (target) plane given that on another (source) plane parallel to it. In their documentations and signatures, coordinates on source plane are denoted as \((u,v)\) while those on target plane are denoted as \((x,y)\). Both source field and target field are sampled in a evenly-spaced grid on respective plane. This is typically used to compute the pulse response of an optical system given the pupil function \(U\). It is assumed to have non-zero value only on a finite region around the origin, covered by the region from which \(U\) is sampled.

The theoretical bases of them include Maxwell’s equations, scalar diffraction theory, Sommerfeld radiation condition, which gives Rayleigh-Sommerfeld solution. If Fresnel’s approximation is valid, it is simplified to Fresnel diffraction. If far field condition is satisfied further, it is simplified to Fraunhofer diffraction. See “Goodman, Joseph W. Introduction to Fourier optics. Roberts and Company publishers, 2005.” for more details.

There are mainly three numerical ways implemented to compute these diffraction integrals. Fourier transform (ft) accomplishes computation by only one Fourier transform. Angular spectrum (as) transforms source field to frequency domain, multiplies corresponding transfer function with analytical expression and transforms it inversely. In contrast, convolution (conv) computes the convolution between source field and a kernel function so the transfer function is not analytical. As a result, there are six functions (or modules) available:

Mathematical form

Numerical method

Fourier transform

Angular spectrum

Convolution

Fraunhofer

fraunhofer()

none

none

Fresnel

fresnel_ft()

fresnel_as()

fresnel_conv()

Rayleigh-Sommerfeld

none

rayleigh_sommerfeld_as()

rayleigh_sommerfeld_conv()

Note that in some literature the first Rayleigh-Sommerfeld solution is also called angular spectrum method, whereas it refers to a numerical method here.

Modules

Diffraction(grid_size[, wl, d])

Base class for all diffraction modules.

Fraunhofer(grid_size[, spacing, wl, d, ...])

Module for computing Fraunhofer diffraction using Fourier transform method.

FresnelFT(grid_size[, spacing, wl, d, ...])

Module for computing Fresnel diffraction using Fourier transform method.

FresnelAS(grid_size[, dx, dy, wl, d])

Module for computing Fresnel diffraction using angular spectrum method.

RayleighSommerfeldAS(grid_size[, dx, dy, wl, d])

Module for computing Rayleigh-Sommerfeld diffraction using angular spectrum method.

FresnelConv(grid_size[, wl, d, ksize, ...])

Module for computing Fresnel diffraction using convolution method.

RayleighSommerfeldConv(grid_size[, wl, d, ...])

Module for computing Rayleigh-Sommerfeld diffraction using convolution method.

Functional API

fraunhofer(pupil[, wl, distance, dx, dy])

Computes Fraunhofer diffraction integral using Fourier transform method:

fresnel_ft(pupil[, wl, distance, dx, dy])

Computes Fresnel diffraction integral using Fourier transform method:

fresnel_as(pupil[, wl, distance, dx, dy, ...])

Computes Fresnel diffraction integral using angular spectrum method:

rayleigh_sommerfeld_as(pupil[, wl, ...])

Computes the first Rayleigh-Sommerfeld diffraction integral using convolution :

fresnel_conv(pupil[, wl, distance, dx, dy])

Computes Fresnel diffraction integral using convolution method:

rayleigh_sommerfeld_conv(pupil[, wl, ...])

Computes Fresnel diffraction integral using convolution method:

Utilities

delta_convert(delta, n, wl, distance)

Convert grid spacing between source plane (\(\delta_\text{s}\)) and target plane (\(\delta_\text{t}\)) in Fourier-transform-based Fresnel diffraction integral, using the following formula:

init_fraunhofer(grid_size, wl, distance, dx)

Pre-compute the intermediate results for fraunhofer() and return them to avoid repeated computation.

init_fresnel_ft(grid_size, wl, distance, dx)

Pre-compute the intermediate results for fresnel_ft() and return them to avoid repeated computation.

init_fresnel_as(grid_size, wl, distance, dx)

Pre-compute the intermediate results for fresnel_as() and return them to avoid repeated computation.

init_rayleigh_sommerfeld_as(grid_size, wl, ...)

Pre-compute the intermediate results for rayleigh_sommerfeld_as() and return them to avoid repeated computation.

init_fresnel_conv(grid_size, wl, distance, dx)

Pre-compute the intermediate results for fresnel_conv() and return them to avoid repeated computation.

init_rayleigh_sommerfeld_conv(grid_size, wl, ...)

Pre-compute the intermediate results for rayleigh_sommerfeld_conv() and return them to avoid repeated computation.