init_rayleigh_sommerfeld_as

dnois.optics.df.init_rayleigh_sommerfeld_as(grid_size: int | tuple[int, int], wl: Real | Sequence[Real] | Tensor, distance: Real | Sequence[Real] | Tensor, dx: float | Tensor, dy: float | Tensor = None) dict[str, Tensor]

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

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,)\).

  • distance (float, Sequence[float] or Tensor) – distance: Propagation distance \(d\). A scalar or a tensor of shape \((N_d,)\).

  • dx (float or Tensor) – See rayleigh_sommerfeld_as().

  • dy (float or Tensor) – See rayleigh_sommerfeld_as().

Returns:

Intermediate results that can be passed to rayleigh_sommerfeld_as() as intermediate argument.

Return type:

dict[str, Tensor]