Differentiable and accelerated spherical harmonic and Wigner transforms (2311.14670v2)
Abstract: Many areas of science and engineering encounter data defined on spherical manifolds. Modelling and analysis of spherical data often necessitates spherical harmonic transforms, at high degrees, and increasingly requires efficient computation of gradients for machine learning or other differentiable programming tasks. We develop novel algorithmic structures for accelerated and differentiable computation of generalised Fourier transforms on the sphere $\mathbb{S}2$ and rotation group $\text{SO}(3)$, i.e. spherical harmonic and Wigner transforms, respectively. We present a recursive algorithm for the calculation of Wigner $d$-functions that is both stable to high harmonic degrees and extremely parallelisable. By tightly coupling this with separable spherical transforms, we obtain algorithms that exhibit an extremely parallelisable structure that is well-suited for the high throughput computing of modern hardware accelerators (e.g. GPUs). We also develop a hybrid automatic and manual differentiation approach so that gradients can be computed efficiently. Our algorithms are implemented within the JAX differentiable programming framework in the S2FFT software code. Numerous samplings of the sphere are supported, including equiangular and HEALPix sampling. Computational errors are at the order of machine precision for spherical samplings that admit a sampling theorem. When benchmarked against alternative C codes we observe up to a 400-fold acceleration. Furthermore, when distributing over multiple GPUs we achieve very close to optimal linear scaling with increasing number of GPUs due to the highly parallelised and balanced nature of our algorithms. Provided access to sufficiently many GPUs our transforms thus exhibit an unprecedented effective linear time complexity.
- D. W. Ritchie, G. J. L. Kemp, Fast computation, rotation and comparison of low resolution spherical harmonic molecular surfaces, J. Comput. Chem. 20 (1999) 383–395.
- Rapid and stable determination of rotation matrices between spherical harmonics by direct recursion, J. Chem. Phys. 111 (1999) 8825–8831.
- W. Boomsma, J. Frellsen, Spherical convolutions and their application in molecular modelling, Advances in neural information processing systems 30 (2017).
- Clebsch–gordan nets: a fully fourier space spherical convolutional neural network, Advances in Neural Information Processing Systems 31 (2018).
- D. S. Tuch, Q-ball imaging 52 (2004) 1358–1372.
- Harmonic analysis of spherical sampling in diffusion MRI, in: 19th Annual Meeting of the International Society for Magnetic Resonance in Medicine, 2011. arXiv:arXiv:1106.0269.
- J. D. McEwen, M. A. Price, Scale-discretised ridgelet transform on the sphere, in: 27th European Signal Processing Conference (EUSIPCO), 2019. doi:10.23919/EUSIPCO.2019.8903034. arXiv:arXiv:1510.01595.
- How can spherical CNNs benefit ML-based diffusion MRI parameter estimation?, in: Computational Diffusion MRI, 2022. doi:10.1007/978-3-031-21206-2\_9. arXiv:arXiv:2207.00572.
- P. Audet, Directional wavelet analysis on the sphere: Application to gravity and topography of the terrestrial planets 116 (2011).
- Solving or resolving global tomographic models with spherical wavelets, and the scale and sparsity of seismic heterogeneity 187 (2011) 969--988.
- Wavelets and wavelet-like transforms on the sphere and their application to geophysical data inversion, in: SPIE Wavelets and Sparsity XIV, 2011. doi:10.1117/12.892285.
- Posterior sampling for inverse imaging problems on the sphere in seismology and cosmology, Roy. Astron. Soc. Tech. & Instrum. 2 (2022) 20--32.
- K. S. Thorne, Multipole expansions of gravitational radiation, Reviews of Modern Physics 52 (1980) 299.
- Numerical evolutions of fields on the 2-sphere using a spectral method based on spin-weighted spherical harmonics, Classical and Quantum Gravity 31 (2014) 075019.
- M. Boyle, Transformations of asymptotic gravitational-wave data, Physical Review D 93 (2016) 084031.
- Mapping dark matter on the celestial sphere with weak gravitational lensing, Mon. Not. Roy. Astron. Soc. 509 (2022) 4480--4497.
- Sparse Bayesian mass-mapping with uncertainties: full-sky observations on the celestial sphere, Mon. Not. Roy. Astron. Soc. 500 (2021) 5436--5452.
- Almanac: Weak lensing power spectra and map inference on the masked sphere, arXiv preprint arXiv:2210.13260 (2022).
- The atacama cosmology telescope: Map-based noise simulations for dr6, arXiv preprint arXiv:2303.04180 (2023).
- Planck Collaboration I, Planck 2018 results. I. Overview, and the cosmological legacy of Planck, Astron. & Astrophys. 641 (2020).
- Euclid: Reconstruction of weak-lensing mass maps for non-gaussianity studies, Astronomy & Astrophysics 638 (2020) A141.
- Dark energy survey year 3 results: Curved-sky weak lensing mass map reconstruction, Monthly Notices of the Royal Astronomical Society 505 (2021) 4626--4645.
- Lsst: from science drivers to reference design and anticipated data products, The Astrophysical Journal 873 (2019) 111.
- Laser interferometer space antenna, arXiv preprint arXiv:1702.00786 (2017).
- Fast directional continuous spherical wavelet transform algorithms, IEEE Trans. Sig. Proc. 55 (2007) 520--529.
- Localisation of directional scale-discretised wavelets on the sphere, Applied Comput. Harm. Anal. 44 (2018) 59--88.
- Directional spin wavelets on the sphere, IEEE Trans. Sig. Proc., submitted (2015).
- Spherical cnns, arXiv preprint arXiv:1801.10130 (2018).
- Learning SO(3) equivariant representations with spherical CNNs, in: Proceedings of the European Conference on Computer Vision (ECCV), 2018. URL: https://arxiv.org/abs/1711.06721.
- Efficient generalized spherical CNNs, in: International Conference on Learning Representations (ICLR), 2021. arXiv:arXiv:2010.11661.
- Scattering networks on the sphere for scalable and rotationally equivariant spherical CNNs, in: International Conference on Learning Representations (ICLR), 2022. arXiv:arXiv:2102.02828.
- Physics-informed machine learning, Nature Reviews Physics 3 (2021) 422--440.
- Rethinking the modeling of the instrumental response of telescopes with a differentiable optical model, in: NeurIPS 2021 Machine Learning for Physical sciences workshop, 2021. URL: http://arxiv.org/abs/2111.12541. arXiv:2111.12541.
- Learned interferometric imaging for the SPIDER instrument, Roy. Astron. Soc. Tech. & Instrum. 2 (2023) 760--778.
- Proximal nested sampling with data-driven priors for physical scientists, in: International Workshop on Bayesian Inference and Maximum Entropy Methods in Science and Engineering, 2023. doi:10.3390/psf2023009013. arXiv:arXiv:2307.00056.
- Jax-cosmo: An end-to-end differentiable and gpu accelerated cosmology library, arXiv preprint arXiv:2302.05163 (2023).
- D. Piras, A. S. Mancini, Cosmopower-jax: high-dimensional bayesian inference with differentiable cosmological emulators, arXiv preprint arXiv:2305.06347 (2023).
- J. R. Driscoll, D. M. J. Healy, Computing Fourier transforms and convolutions on the sphere, Adv. Appl. Math. 15 (1994) 202--250.
- J. D. McEwen, Y. Wiaux, A novel sampling theorem on the sphere, IEEE Trans. Sig. Proc. 59 (2011) 5876--5887.
- A novel sampling theorem on the rotation group, IEEE Sig. Proc. Let. 22 (2015) 2425--2429.
- Healpix -- a framework for high resolution discretization and fast analysis of data distributed on the sphere, Astrophys. J. 622 (2005) 759--771.
- N. Schaeffer, Efficient spherical harmonic transforms aimed at pseudospectral numerical simulations, Geochemistry, Geophysics, Geosystems 14 (2013) 751--758.
- E. T. Newman, R. Penrose, Note on the Bondi-Metzner-Sachs group, J. Math. Phys. 7 (1966) 863--870.
- Spin-s𝑠sitalic_s spherical harmonics and ðitalic-ð\ethitalic_ð, J. Math. Phys. 8 (1967) 2155--2161.
- Statistics of cosmic microwave background polarization, Phys. Rev. D. D55 (1997) 7368--7388.
- Gauss-legendre sampling on the rotation group, IEEE Sig. Proc. Let. 23 (2016) 207--211.
- On the computation of directional scale-discretized wavelet transforms on the sphere, in: Wavelets and Sparsity XV, SPIE international symposium on optics and photonics, invited contribution, volume 8858, 2013. doi:10.1117/12.2022889. arXiv:arXiv:1308.5706.
- S2LET: A code to perform fast wavelet analysis on the sphere, Astron. & Astrophys. 558 (2013) 1--9.
- An optimal-dimensionality sampling scheme on the sphere with fast spherical harmonic transforms, IEEE Trans. Sig. Proc. 62 (2014) 4597--4610.
- FFTs for the 2-sphere -- improvements and variations, J. Fourier Anal. and Appl. 9 (2003) 341--385.
- W. Skukowsky, A quadrature formula over the sphere with application to high resolution spherical harmonic analysis, J. Geodesy 60 (1986) 1--14. 10.1007/BF02519350.
- P. Kostelec, D. Rockmore, FFTs on the rotation group, J. Fourier Anal. and Appl. 14 (2008) 145--179.
- T. Risbo, Fourier transform summation of Legendre series and D𝐷Ditalic_D-functions, J. Geodesy 70 (1996) 383--396.
- S. Trapani, J. Navaza, Calculation of spherical harmonics and Wigner d functions by FFT. Applications to fast rotational matching in molecular replacement and implementation into AMoRe, Acta Crystallographica Section A 62 (2006) 262--269.
- W. Gautschi, Computational aspects of three-term recurrence relations, SIAM review 9 (1967) 24--82.
- G. Prézeau, M. Reinecke, Algorithm for the evaluation of reduced wigner matrices, The Astrophysical Journal Supplement Series 190 (2010) 267.
- M. Reinecke, D. S. Seljebotn, Libsharp--spherical harmonic transforms revisited, Astronomy & Astrophysics 554 (2013) A112.
- J. W. Cooley, J. W. Tukey, An algorithm for the machine calculation of complex fourier series 19 (1965) 297--301.
- Sampling theorems and compressive sensing on the sphere, in: Wavelets and Sparsity XIV, SPIE international symposium on optics and photonics, invited contribution, volume 8138, 2011. doi:10.1117/12.893481. arXiv:arXiv:1110.6297.
- Scalable and equivariant spherical CNNs by discrete-continuous (DISCO) convolutions, in: International Conference on Learning Representations (ICLR), 2023. arXiv:arXiv:2209.13603.
- Convolutional networks for spherical signals, in: ICML, Springer, 2018. arXiv:arXiv:1709.04893.
- R. E. Wengert, A simple automatic derivative evaluation program, Communications of the ACM 7 (1964) 463--464.
- Automatic differentiation in machine learning: a survey, Journal of Marchine Learning Research 18 (2018) 1--43.
- Learning representations by back-propagating errors, nature 323 (1986) 533--536.
- Sparse image reconstruction on the sphere: implications of a new sampling theorem, IEEE Trans. Image Proc. 22 (2013) 2275--2285.
- Sparse image reconstruction on the sphere: analysis vs synthesis, IEEE Trans. Image Proc. 26 (2017) 5176--5187.
- Sparse image reconstruction on the sphere: a general approach with uncertainty quantification, IEEE Trans. Image Proc., submitted (2021).
- Differentiable cosmological simulation with the adjoint method, The Astrophysical Journal Supplement Series 270 (2024) 36.
- BICEP2 Collaboration, Detection of B-Mode Polarization at Degree Angular Scales by BICEP2, Phys. Rev. Lett. 112 (2014) 241101.
- Geometric deep learning: Grids, groups, graphs, geodesics, and gauges, arXiv preprint arXiv:2104.13478 (2021).
- S. Cheng, B. Ménard, Weak lensing scattering transform: dark energy and neutrino mass sensitivity, Monthly Notices of the Royal Astronomical Society 507 (2021) 1012--1020.
- Differentiable and accelerated wavelet transforms on the sphere and ball, Journal of Computational Physics, submitted (2024).
- Generative models of astrophysical fields with scattering transforms on the sphere, Astronomy & Astrophysics (in prep.).