Convolutions of sampled signals#
Lifted convolutions of sampled signals.
These wrap the harmonic operators of s2conv.convolutions.lifted between forward and
inverse transforms, so that samples on the sphere or rotation group go in and come out.
With the "jax" or "precompute" backends they can be JIT compiled, with the
band-limits, spins, sampling and method static, for example:
convolve_jit = jax.jit(
s2conv.convolve,
static_argnames=("L", "s_in", "s_out", "N_out", "sampling", "method"),
)
With "precompute" the cached transform kernels, of sizes \(\mathcal{O}(L^3)\) and
\(\mathcal{O}(NL^3)\), become constants of the compiled program: it then runs fastest,
but takes longer to compile at large band-limits than with "jax", which computes
the Wigner functions on the fly.
- s2conv.convolutions.sampled.convolve(x, kernel, L: int, s_in, s_out, N_out: int = None, sampling: str = 'mw', method: str = 'jax', nside: int = None)[source]#
The generalised lifted convolution \(\mathcal{C}_{s\to s'}[\Psi]\) of sampled signals (Definition V.1).
- Parameters:
x – Samples of a spin-\(s\) field on the sphere or, if
s_in == "G", samples on the rotation group with shape[2N_in - 1, ...].kernel – The kernel \(\Psi\),
[2N_k - 1, L, 2L - 1](sees2conv.kernels).L (int) – Harmonic band-limit.
s_in (int or "G") – Input spin, or
"G"for the rotation group.s_out (int or "G") – Output spin, or
"G"for the rotation group.N_out (int, optional) – Azimuthal band-limit of an output on the rotation group. Defaults to \(L\).
sampling (str, optional) – Sampling scheme. Defaults to “mw”.
method (str, optional) – Transform backend, one of
s2conv.transforms.METHODS. Defaults to “jax”.nside (int, optional) – HEALPix resolution, if
sampling="healpix".
- Returns:
Samples of the output on the sphere or, if
s_out == "G", on the rotation group.
- s2conv.convolutions.sampled.convolve_multiplier(f, c, L: int, s_in: int, s_out: int, sampling: str = 'mw', method: str = 'jax', nside: int = None)[source]#
A spin-changing convolution with multiplier \(c_\ell\) of a sampled field (Proposition VI.5).
- Parameters:
f – Samples of a spin-\(s\) field on the sphere.
c – Multiplier \(c_\ell\),
[L].L (int) – Harmonic band-limit.
s_in (int) – Input spin \(s\).
s_out (int) – Output spin \(s'\).
sampling (str, optional) – Sampling scheme. Defaults to “mw”.
method (str, optional) – Transform backend. Defaults to “jax”.
nside (int, optional) – HEALPix resolution, if
sampling="healpix".
- Returns:
Samples of the spin-\(s'\) output on the sphere.