FresnelConv

class dnois.optics.df.FresnelConv(grid_size: int | tuple[int, int], wl: Real | Sequence[Real] | Tensor = None, d: Real | Sequence[Real] | Tensor = None, ksize: int | tuple[int, int] = None, padding: int | str = 'linear', phase_factor: bool = True, scale_factor: bool = True, dft_scale: bool = True, simpson: bool = True)

Module for computing Fresnel diffraction using convolution method. See fresnel_conv() and init_fresnel_conv() for more details and description of parameters.

forward(pupil: Tensor) Tensor

Compute diffraction integral for given pupil function pupil

Parameters:

pupil (Tensor) – Pupil function \(U\). A tensor of shape \((\cdots,N_d,N_\lambda,H,W)\).

Returns:

Diffracted complex amplitude \(U'\). A tensor of shape \((\cdots,N_d,N_\lambda,H,W)\).

Return type:

Tensor

property d: Tensor

Diffraction distances \(z\). It can be assigned with a float, sequence of float, 0D or 1D tensor. This property returns a 0D tensor if assigned with a float or 0D tensor, or a 1D tensor otherwise.

property device: device

Device of this object.

Type:

torch.device

property dtype: dtype

Data type of this object.

Type:

torch.dtype

property du: Tensor

Grid spacing for \(u\) coordinate. See corresponding functional API reference for allowed values. Note that this property depends on dx, vice versa.

property dv: Tensor

Grid spacing for \(v\) coordinate. See corresponding functional API reference for allowed values. Note that this property depends on dy, vice versa.

property dx: Tensor

Grid spacing for \(x\) coordinate. See corresponding functional API reference for allowed values. Note that this property depends on du, vice versa.

property dy: Tensor

Grid spacing for \(y\) coordinate. See corresponding functional API reference for allowed values. Note that this property depends on dv, vice versa.

u: Ts

One of coordinates on source plane.

u_range: tuple[Ts, Ts]

Range of u. A pair of 0D tensor.

u_size: Ts

Span of u, i.e. u_range[1] - u_range[0].

v: Ts

One of coordinates on source plane.

v_range: tuple[Ts, Ts]

Range of v. A pair of 0D tensor.

v_size: Ts

Span of v, i.e. v_range[1] - v_range[0].

property wl: Tensor

Wavelengths \(\lambda\). It can be assigned with a float, sequence of float, 0D or 1D tensor. This property returns a 0D tensor if assigned with a float or 0D tensor, or a 1D tensor otherwise.

x: Ts

One of coordinates on target plane.

x_range: tuple[Ts, Ts]

Range of x. A pair of 0D tensor.

x_size: Ts

Span of x, i.e. x_range[1] - x_range[0].

y: Ts

One of coordinates on target plane.

y_range: tuple[Ts, Ts]

Range of y. A pair of 0D tensor.

y_size: Ts

Span of y, i.e. y_range[1] - y_range[0].