s2fft is currently in an open beta, please provide feedback on GitHub

Turok & Bucher JAX#

s2fft.recursions.turok_jax.compute_slice(beta: float, el: int, L: int, mm: int) Array#

Compute a particular slice \(m^{\prime}\), denoted mm, of the complete Wigner-d matrix at polar angle \(\beta\) using Turok & Bucher recursion.

The Wigner-d slice for a given \(\ell\) (el) and \(\beta\) is computed recursively over \(m\) labelled ‘m’ at a specific \(m^{\prime}\). The Turok & Bucher recursion is analytically correct from \(-\ell < m < \ell\) however numerically it can become unstable for \(m > 0\). To avoid this we compute \(d_{m, m^{\prime}}^{\ell}(\beta)\) for negative \(m\) and then evaluate \(d_{m, -m^{\prime}}^{\ell}(\beta) = (-1)^{m-m^{\prime}} d_{-m, m^{\prime}}^{\ell}(\beta)\) which we can again evaluate using a Turok & Bucher recursion.

The Wigner-d slice \(d^\ell_{m, m^{\prime}}(\beta)\) is indexed for \(-L < m < L\) by dl[L - 1 - m]. This implementation has computational scaling \(\mathcal{O}(L)\) and typically requires \(\sim 2L\) operations.

Parameters:
  • beta (float) – Polar angle in radians.

  • el (int) – Harmonic degree of Wigner-d matrix.

  • L (int) – Harmonic band-limit.

  • mm (int) – Harmonic order at which to slice the matrix.

Returns:

Wigner-d matrix mm slice of dimension [2L-1].

Return type:

jnp.ndarray

s2fft.recursions.turok_jax.reindex(dl, el, L, mm) Array#

Reorders indexing of Wigner-d matrix.

Reindexes the Wigner-d matrix to centre m values around L-1. The original indexing is given by \([-m \rightarrow -1, \dots, 0 \rightarrow m]\) and the resulting indexing is given by \([\dots, -m \rightarrow 0 \rightarrow m, \dots]\), where \(\dots\) represents entries in which the values should be ignored. These extra entries are necessary to ensure compute_slice() can operate with static length.

Parameters:
  • dl (np.ndarray) – Wigner-d matrix to populate (shape: 2L-1).

  • el (int) – Harmonic degree of Wigner-d matrix.

  • L (int) – Harmonic band-limit.

  • mm (int) – Harmonic order at which to slice the matrix.

Returns:

Wigner-d matrix slice of dimension [2L-1].

Return type:

jnp.ndarray