xnn.gnn.featurizers.spherical_bessel.spherical_bessel_rows#

xnn.gnn.featurizers.spherical_bessel.spherical_bessel_rows(x, first=0, n_terms=30)[source]#

Spherical Bessel functions with one order per row: j_{first + r}(x[..., r, :]).

The radial factors of the 2D basis evaluate j_l at the zeros of the same order only, so the order runs along the row axis (-2) of x. One evaluation for all rows gives the values of spherical_bessel_jn() bitwise, without the orders a row does not use. With a gradient to track, the same evaluation also takes the neighboring orders and keeps the derivative j_l' = (l j_{l-1} - (l+1) j_{l+1}) / (2l+1); the second derivative follows from the spherical Bessel equation, j_l'' = -2 j_l' / x - (1 - l(l+1) / x^2) j_l, so no derivative order evaluates the series again.

Parameters:
  • x (Tensor) – Arguments of shape (..., R, N), x >= 0 (x > 0 where differentiated twice).

  • first (int, optional) – Order of row 0, by default 0; row r has order first + r.

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

Returns:

Same shape and dtype as x.

Return type:

Tensor