Precomputations#

s2scat.operators.matrices.generate_precompute_matrices(L: int, N: int, J_min: int = 0, reality: bool = False) List[List[Array]]#
Generates the full set of precompute matrices for the scattering transform with

\(\mathcal{O}(NL^3)\) memory overhead.

Parameters:
  • L (int) – Spherical harmonic bandlimit.

  • N (int) – Azimuthal bandlimit (directionality).

  • J_min (int, optional) – Minimum dyadic wavelet scale to consider. Defaults to 0.

  • reality (bool, optional) – Whether \(f \in \mathbb{R}\), if True exploits hermitian symmetry of harmonic coefficients. Defaults to False.

Returns:

First list is indexed by [spherical matrices, [], Wigner matrices],

second list is indexed by wavelet scale \(j\). Within these nested lists one will find jnp.ndarrays with elements of the reduced Wigner-d matrices.

Return type:

List[List[jnp.ndarray]]

Notes

Effectively, this uses the Price-McEwen recursion [1] to compute and cache the reduced Wigner-d matrices in a multiresolution manner, where each scale \(j\) has its own set of matrices bandlimited at \(L_j, N_j\). This multiresolution approach means that the majority of the memory overhead is incurred for the highest wavelet scale \(J_{\text{max}}\) alone.

[1] Price, Matthew A., and Jason D. McEwen. “Differentiable and accelerated spherical harmonic and Wigner transforms.” arXiv preprint arXiv:2311.14670 (2023).

s2scat.operators.matrices.generate_recursive_matrices(L: int, N: int, J_min: int = 0, reality: bool = False) List[Array]#
Generates a small set of recursive matrices for underlying Wigner-d recursion

algorithms with a modest \(\mathcal{O}(NL^2)\) memory overhead.

Parameters:
  • L (int) – Spherical harmonic bandlimit.

  • N (int) – Azimuthal bandlimit (directionality).

  • J_min (int, optional) – Minimum dyadic wavelet scale to consider. Defaults to 0.

  • reality (bool, optional) – Whether \(f \in \mathbb{R}\), if True exploits hermitian symmetry of harmonic coefficients. Defaults to False.

Returns:

First list is indexed by [spherical matrices, [], Wigner matrices],

second list is indexed by wavelet scale \(j\). Within these nested lists one will find jnp.ndarrays with elements of the reduced Wigner-d matrices.

Return type:

List[List[jnp.ndarray]]

Notes

These matrices are simply initial conditions and recursion update matrices used within the Price-McEwen Wigner-d recursion [1]. In principle these could be computed on-the-fly however computing and caching them a priori can improve the efficiency of the recursion.

[1] Price, Matthew A., and Jason D. McEwen. “Differentiable and accelerated spherical harmonic and Wigner transforms.” arXiv preprint arXiv:2311.14670 (2023).