pymiediff.farfield.cross_sections

Contents

pymiediff.farfield.cross_sections#

pymiediff.farfield.cross_sections(k0, r_c, eps_c, r_s=None, eps_s=None, eps_env=1.0, backend='torch', precision='double', which_jn='stable', n_max=None) dict#

compute farfield cross-sections incuding multipole decomposition

Caution! Always returns as first dimension de number of particles (–> 1 if a single particle)

this function provides autodiff compatible farfield cross-sections calculations, they are computed using the analytical solutions provided in:

Bohren, Craig F., and Donald R. Huffman. Absorption and scattering of light by small particles. John Wiley & Sons, 2008.

Results are retured as a dictionary with keys:
  • ‘wavelength’ : evaluation wavelengths

  • ‘k0’ : evaluation wavenumbers

  • ‘cs_geo’ : geometric cross section

  • ‘q_ext’ : extiniction efficiency

  • ‘q_sca’ : scattering efficiency

  • ‘q_abs’ : absorbtion efficiency

  • ‘cs_ext’ : extiniction cross section

  • ‘cs_sca’ : scattering cross section

  • ‘cs_abs’ : absorbtion cross section

  • ‘q_ext_multipoles’ : multipole decomp. of extiniction efficiency

  • ‘q_sca_multipoles’ : multipole decomp. of scattering efficiency

  • ‘q_abs_multipoles’ : multipole decomp. of absorbtion efficiency

  • ‘cs_ext_multipoles’ : multipole decomp. of extiniction cross section

  • ‘cs_sca_multipoles’ : multipole decomp. of scattering cross section

  • ‘cs_abs_multipoles’ : multipole decomp. of absorbtion cross section

vectorization needs to follow the conventions (see _broadcast_mie_config() for details):
  • dimension 0: N particles to calc.

  • dimension 1: spectral dimension (k0)

  • dimension 2: mie-order

Parameters:
  • k0 (torch.Tensor) – evaluation wavenumbers, must be the same for all particles and Mie orders. 1D tensor of shape (N).

  • r_c (torch.Tensor) – core radius (in nm).

  • eps_c (torch.Tensor) – permittivity of core.

  • r_s (torch.Tensor, optional) – shell radius (in nm). Defaults to None.

  • eps_s (torch.Tensor, optional) – permittivity of shell. Defaults to None.

  • eps_env (float, optional) – permittivity of environment. Defaults to 1.0.

  • backend (str, optional) – backend to use for spherical bessel functions. Either ‘scipy’ or ‘torch’. Defaults to ‘scipy’.

  • precision (str, optional) – has no effect on the scipy implementation.

  • which_jn (str, optional) – only for “torch” backend. Which algorithm for j_n to use. Either ‘stable’ or ‘fast’. Defaults to ‘stable’.

  • n_max (int, optional) – highest order to compute. Defaults to None.

Returns:

dict containing all resulting spectra.

Return type:

dict