Repository navigation
Releases: astro-informatics/s2conv
Release list
s2conv v0.1.0
The first release of s2conv, a JAX package for the generalised lifted spherical convolution and the spherical convolutions it unifies, for scalar fields, spin fields and functions on the rotation group. It accompanies J. D. McEwen, "Unifying spherical convolutions through lifting" (2026, forthcoming), whose Definition, Theorem and Proposition numbers the docstrings cite.
pip install s2convWhat it provides
-
The four lifted convolutions: $\mathcal{C}{s\to s'}$, $\mathcal{C}{s\to G}$, $\mathcal{C}{G\to s'}$ and $\mathcal{C}{G\to G}$, between spin fields on the sphere and functions on SO(3), with the lift
$\Lambda_s$ and its adjoint projection (s2conv.lifted,s2conv.lifting), and kernels as functions on SO(3) with conversions to the weights of the article (s2conv.kernels). -
The classical convolutions as special cases: axisymmetric, left (Driscoll and Healy), directional and Haar synthesis (
s2conv.classical), spin-changing multipliers and steerable kernels as tuples of spins. -
Physics operators:
$\eth$ ,$\bar\eth$ , the E/B decomposition and Kaiser–Squires mass mapping (s2conv.physics). -
Non-equivariant constructions: section evaluation (standard correlation, commutative anisotropic convolution;
s2conv.section) and harmonic-diagonal operators (harmonic multiplication, sifting;s2conv.diagonal). -
Transform backends from S2FFT behind one
methodswitch:"jax","precompute"(any spin and azimuthal band-limit),"jax_ssht"and"numpy". The operators are differentiable, JIT-compilable, run on GPUs, are exact for band-limited signals, and broadcast over leading axes. -
Equivariance benchmark:
s2conv.utils.equivarianceandbenchmarks/equivariance.pymeasure rotational equivariance with the protocol of Cobb et al. (2021) and Ocampo et al. (2023), at 100 signals × 100 rotations: errors of about 10⁻¹⁵ in double precision for the equivariant operators, and of order one for the section-evaluated and harmonic-diagonal ones. The results of the paper are inbenchmarks/results/. -
Scaling benchmark:
benchmarks/scaling.pytimes the four lifted convolutions against band-limit, following the$L^3$ scaling of their transforms. -
Notebooks (Marimo, also openable in molab):
notebooks/lifted_convolutions.pydemonstrates every convolution and checks it against the closed forms of the article, a literal evaluation on SO(3) and the real-space definitions;notebooks/real_fields.pyapplies the convolutions to real spin fields of the Earth and the sky.
Python 3.11, 3.12 and 3.13 are supported (3.13 needs S2FFT 1.5.0 or later). Documentation: https://astro-informatics.github.io/s2conv/
Citation
If you use s2conv, please cite J. D. McEwen, "Unifying spherical convolutions through lifting" (2026, forthcoming), and S2FFT: M. A. Price and J. D. McEwen, "Differentiable and accelerated spherical harmonic and Wigner transforms", J. Comput. Phys. 510, 113109 (2024). See CITATION.cff.