pymiediff.Particle.get_nearfields

pymiediff.Particle.get_nearfields#

Particle.get_nearfields(k0: Tensor, r_probe: Tensor, **kwargs) dict#

Compute electric and magnetic near-fields at probe positions

Parameters:
  • k0 (torch.Tensor) – Evaluation wavenumbers (rad nm^-1). Will be cast to the particle’s device automatically.

  • r_probe (torch.Tensor) – Cartesian probe positions with shape (..., 3) where the last dimension indexes the x, y, z coordinates.

  • **kwargs (dict) – Additional keyword arguments passed to pymiediff.coreshell.nearfields(). The illumination amplitude is fixed to E_0 = 1.

Returns:

Dictionary containing the fields:

  • E_storch.Tensor

    Scattered electric field at each probe position.

  • H_storch.Tensor

    Scattered magnetic field at each probe position.

  • E_ttorch.Tensor

    Total electric field at each probe position (scat+inc).

  • H_ttorch.Tensor

    Total magnetic field at each probe position (scat+inc).

  • E_itorch.Tensor

    Incident electric field at each probe position.

  • H_itorch.Tensor

    Incident magnetic field at each probe position.

Any extra entries returned by nearfields are also included.

Return type:

dict

Notes

The method internally calls pymiediff.coreshell.nearfields(), handling material permittivities and radius selection. For a single-particle calculation the singleton particle dimension is squeezed from the output.