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}\), by two half recursions running inwards from the edges \(m = \mp\ell\). Each half recursion is only stable while the slice grows in its direction, so the halves meet at \(m^\star = \mathrm{round}(m^\prime\cos\beta)\), the centre of the oscillatory region of the slice, rather than at \(m = 0\); near the poles the slice peaks at \(m = \pm m^\prime\) and decays away from it. The recursion is that of compute_all_slices_jax() for a single \(\ell\).

The Wigner-d slice \(d^\ell_{m, m^{\prime}}(\beta)\) is indexed for \(-L < m < L\) by dl[m + L - 1], and is zero for \(|m| > \ell\). This implementation has computational scaling \(\mathcal{O}(L)\) and typically requires \(\sim 2(L + |m^\prime|)\) 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