pymiediff.coreshell.ab_gpu#
- pymiediff.coreshell.ab_gpu(x, y, n, m1, m2, which_jn='stable', precision='double')#
an and bn scattering coefficients - GPU compatible implementation
native torch implementation via bessel upward and downward recurrences
Absorption and scattering of light by small particles. Pg. 183 and Equ. 8.1.
- Parameters:
x (torch.Tensor) – size parameter (core)
y (torch.Tensor) – size parameter (shell)
n (torch.Tensor) – orders to compute
m1 (torch.Tensor) – relative refractive index of core
m2 (torch.Tensor) – relative refractive index of shell
which_jn (str) – Which algorithm to use for spherical Bessel of first kind (j_n). must be one of: [‘stable’, ‘fast’], indicating, respectively, continued fractions ratios or standard downward recurrence. Defaults to ‘stable’
precision (str, optional) – “single” our “double”. defaults to “double”.
- Returns:
result
- Return type:
torch.Tensor, torch.Tensor