pymiediff.coreshell.mie_coefficients

pymiediff.coreshell.mie_coefficients#

pymiediff.coreshell.mie_coefficients(k0, r_c, eps_c, r_s=None, eps_s=None, eps_env=1.0, return_internal=False, backend='torch', precision='double', which_jn='recurrence', n_max=None)#

compute mie coefficients for a core-shell sphere

This function returns Mie coefficient broadcasted to shape (n Mie order, N particles, N wavevectors).

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

Results are retured as a dictionary with keys:
  • ‘a_n’ : external electric Mie coefficient

  • ‘b_n’ : external magnetic Mie coefficient

  • ‘k0’ : evaluation wavenumbers

  • ‘k’ : evaluation wavenumbers in host medium

  • ‘n’ : mie orders

  • ‘n_max’ : maximum mie order

  • ‘r_c’ : core radius

  • ‘r_s’ : shell radius

  • ‘eps_c’ : core permittivities

  • ‘eps_s’ : shell permittivities

  • ‘eps_env’ : environmental permittivity

  • ‘n_c’ : core refractive index

  • ‘n_s’ : shell refractive index

  • ‘n_env’ : environmental refractive index

if kwarg return_internal is True, the returned dict contains also:
  • ‘c_n’ : internal magnetic Mie coefficient (core)

  • ‘d_n’ : internal electric Mie coefficient (core)

  • ‘f_n’ : internal magnetic Mie coefficient - first kind (shell)

  • ‘g_n’ : internal electric Mie coefficient - first kind (shell)

  • ‘v_n’ : internal magnetic Mie coefficient - second kind (shell)

  • ‘w_n’ : internal electric Mie coefficient - second kind (shell)

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.

  • return_internal (float, optional) – If True, return also internal Mie coefficients (longer computation time). Defaults to False.

  • 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