multislice_forward_model_vec_all

multislice_forward_model_vec_all#

ptyrad.forward.multislice_forward_model_vec_all(object_patches, probe, H, omode_occu=None, eps=1e-10)[source]#

Computes the multislice electron diffraction pattern with multiple incoherent probe and object modes using a vectorized forward model.

Parameters:
  • object_patches (torch.Tensor) – Tensor of shape (N, omode, Nz, Ny, Nx, 2), representing pseudo-complex object patches with float32 amplitude and phase components. N is the number of samples in a batch, omode is the number of object modes, Nz, Ny, Nx are the dimensions of the object patches.

  • omode_occu (torch.Tensor) – Tensor of shape (omode,) with float32 values, representing the occupancy/expectation for each object mode. The sum of all elements should be 1.

  • probe (torch.Tensor) – Tensor of shape (N, pmode, Ny, Nx) with complex64 values, representing the probe(s). N is the number of samples in the batch, pmode is the number of probe modes. By default, N is 1, assuming the same probe for all samples.

  • H (torch.Tensor) – Tensor of shape (N, Ky, Kx) with complex64 values, representing the Fresnel propagator that propagates the wave by a slice thickness.

  • eps (float, optional) – A small value added for numerical stability. Defaults to 1e-10.

Returns:

Tensor of shape (N, Ky, Kx) with float32 positive values, representing the forward diffraction pattern for each sample in the batch.

Return type:

torch.Tensor