Diffraction¶
- class dnois.optics.df.Diffraction(grid_size: int | tuple[int, int], wl: Real | Sequence[Real] | Tensor = None, d: Real | Sequence[Real] | Tensor = None)¶
Base class for all diffraction modules. Its subclasses implement the computation of various diffraction integral. One advantage of using module API rather than functional API is that intermediate results are handled automatically.
- Parameters:
grid_size (int or tuple[int, int]) – Size of spatial dimensions \((H, W)\).
wl (float, Sequence[float] or Tensor) – Wavelengths \(\lambda\). A scalar or a tensor of shape \((N_\lambda,)\). Default: ignored temporarily.
d (float, Sequence[float] or Tensor) – Propagation distance \(d\). A scalar or a tensor of shape \((N_d,)\). Default: ignored temporarily.
- 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: Tensor¶
One of coordinates on source plane.
- v: Tensor¶
One of coordinates on source plane.
- 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: Tensor¶
One of coordinates on target plane.
- y: Tensor¶
One of coordinates on target plane.