xnn.gnn.featurizers.spherical_bessel.spherical_bessel_jn#

xnn.gnn.featurizers.spherical_bessel.spherical_bessel_jn(l_max, x, n_terms=30)[source]#

Spherical Bessel functions of the first kind, orders 0 to l_max.

See _spherical_bessel_values() for the evaluation. With a gradient to track, the derivative comes from the identity j_l' = (l j_{l-1} - (l+1) j_{l+1}) / (2l+1): autograd then keeps x only, not the intermediates of the series, and higher derivatives (force training) come from the same identity. TorchScript evaluates _spherical_bessel_values() directly.

Parameters:
  • l_max (int) – Highest order.

  • x (Tensor) – Arguments of any shape, x >= 0.

  • n_terms (int, optional) – Terms of the power series, by default 30.

Returns:

j_l(x) stacked along a new last axis, shape (..., l_max + 1), in the dtype of x.

Return type:

Tensor