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

Turok & Bucher#

s2fft.recursions.turok.compute_full(beta: float, el: int, L: int) ndarray#

Compute the complete Wigner-d matrix at polar angle \(\beta\) using Turok & Bucher recursion.

The Wigner-d plane for a given \(\ell\) (el) and \(\beta\) is computed recursively over \(m, m^{\prime}\).

The Wigner-d plane \(d^\ell_{m, m^{\prime}}(\beta)\) is indexed for \(-L < m, m^{\prime} < L\) by dl[L - 1 + \(m\), L - 1 + \(m^{\prime}\)] but is only computed for the eighth of the plane \(m^{\prime} <= m < \ell, 0 <= m^{\prime} <= \ell\). Symmetry relations are used to fill in the remainder of the plane (see fill()).

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

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

  • L (int) – Harmonic band-limit.

Raises:

ValueError – If el is greater than L.

Returns:

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

Return type:

np.ndarray

s2fft.recursions.turok.compute_quarter(dl: ndarray, beta: float, l: int, L: int) ndarray#

Compute the left quarter triangle of the Wigner-d matrix via Turok & Bucher recursion.

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

  • beta (float) – Polar angle in radians.

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

  • L (int) – Harmonic band-limit.

Returns:

Wigner-d matrix of dimension [2L-1, 2L-1] with left quarter triangle populated.

Return type:

np.ndarray

s2fft.recursions.turok.compute_quarter_slice(dl: ndarray, beta: float, el: int, L: int, mm: int, positive_m_only: bool = False) ndarray#

Compute a single slice at \(m^{\prime}\) of the Wigner-d matrix evaluated at \(\beta\).

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

  • beta (float) – Polar angle in radians.

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

  • L (int) – Harmonic band-limit.

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

  • positive_m_only (bool, optional) – Compute Wigner-d matrix for slice at m greater than zero only. Defaults to False.

Returns:

Wigner-d matrix slice of dimension [2L-1] populated only on the mm slice.

Return type:

np.ndarray

s2fft.recursions.turok.compute_slice(beta: float, el: int, L: int, mm: int, positive_m_only: bool = False) ndarray#

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.

  • positive_m_only (bool, optional) – Compute Wigner-d matrix for slice at m greater than zero only. Defaults to False.

  • construction (Whether to exploit conjugate symmetry. By) – this only leads to significant improvement for mm = 0. Defaults to False.

Raises:
  • ValueError – If el is greater than L.

  • ValueError – If el is less than mm.

  • Warning – If positive_m_only is true but mm not 0.

Returns:

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

Return type:

np.ndarray

s2fft.recursions.turok.fill(dl: ndarray, l: int, L: int) ndarray#

Reflects Wigner-d quarter plane to complete full matrix by using symmetry properties of the Wigner-d matrices.

Parameters:
  • dl (np.ndarray) – Wigner-d matrix to populate by symmetry.

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

  • L (int) – Harmonic band-limit.

Returns:

A complete Wigner-d matrix of dimension [2L-1, 2L-1].

Return type:

np.ndarray