Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
166 tokens/sec
GPT-4o
7 tokens/sec
Gemini 2.5 Pro Pro
42 tokens/sec
o3 Pro
4 tokens/sec
GPT-4.1 Pro
38 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

Differentiable and accelerated spherical harmonic and Wigner transforms (2311.14670v2)

Published 24 Nov 2023 in physics.comp-ph, astro-ph.IM, and cs.LG

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.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (73)
  1. 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.
  2. Rapid and stable determination of rotation matrices between spherical harmonics by direct recursion, J. Chem. Phys. 111 (1999) 8825–8831.
  3. W. Boomsma, J. Frellsen, Spherical convolutions and their application in molecular modelling, Advances in neural information processing systems 30 (2017).
  4. Clebsch–gordan nets: a fully fourier space spherical convolutional neural network, Advances in Neural Information Processing Systems 31 (2018).
  5. D. S. Tuch, Q-ball imaging 52 (2004) 1358–1372.
  6. 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.
  7. 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.
  8. 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.
  9. P. Audet, Directional wavelet analysis on the sphere: Application to gravity and topography of the terrestrial planets 116 (2011).
  10. Solving or resolving global tomographic models with spherical wavelets, and the scale and sparsity of seismic heterogeneity 187 (2011) 969--988.
  11. 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.
  12. Posterior sampling for inverse imaging problems on the sphere in seismology and cosmology, Roy. Astron. Soc. Tech. & Instrum. 2 (2022) 20--32.
  13. K. S. Thorne, Multipole expansions of gravitational radiation, Reviews of Modern Physics 52 (1980) 299.
  14. 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.
  15. M. Boyle, Transformations of asymptotic gravitational-wave data, Physical Review D 93 (2016) 084031.
  16. Mapping dark matter on the celestial sphere with weak gravitational lensing, Mon. Not. Roy. Astron. Soc. 509 (2022) 4480--4497.
  17. Sparse Bayesian mass-mapping with uncertainties: full-sky observations on the celestial sphere, Mon. Not. Roy. Astron. Soc. 500 (2021) 5436--5452.
  18. Almanac: Weak lensing power spectra and map inference on the masked sphere, arXiv preprint arXiv:2210.13260 (2022).
  19. The atacama cosmology telescope: Map-based noise simulations for dr6, arXiv preprint arXiv:2303.04180 (2023).
  20. Planck Collaboration I, Planck 2018 results. I. Overview, and the cosmological legacy of Planck, Astron. & Astrophys. 641 (2020).
  21. Euclid: Reconstruction of weak-lensing mass maps for non-gaussianity studies, Astronomy & Astrophysics 638 (2020) A141.
  22. Dark energy survey year 3 results: Curved-sky weak lensing mass map reconstruction, Monthly Notices of the Royal Astronomical Society 505 (2021) 4626--4645.
  23. Lsst: from science drivers to reference design and anticipated data products, The Astrophysical Journal 873 (2019) 111.
  24. Laser interferometer space antenna, arXiv preprint arXiv:1702.00786 (2017).
  25. Fast directional continuous spherical wavelet transform algorithms, IEEE Trans. Sig. Proc. 55 (2007) 520--529.
  26. Localisation of directional scale-discretised wavelets on the sphere, Applied Comput. Harm. Anal. 44 (2018) 59--88.
  27. Directional spin wavelets on the sphere, IEEE Trans. Sig. Proc., submitted (2015).
  28. Spherical cnns, arXiv preprint arXiv:1801.10130 (2018).
  29. 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.
  30. Efficient generalized spherical CNNs, in: International Conference on Learning Representations (ICLR), 2021. arXiv:arXiv:2010.11661.
  31. Scattering networks on the sphere for scalable and rotationally equivariant spherical CNNs, in: International Conference on Learning Representations (ICLR), 2022. arXiv:arXiv:2102.02828.
  32. Physics-informed machine learning, Nature Reviews Physics 3 (2021) 422--440.
  33. 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.
  34. Learned interferometric imaging for the SPIDER instrument, Roy. Astron. Soc. Tech. & Instrum. 2 (2023) 760--778.
  35. 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.
  36. Jax-cosmo: An end-to-end differentiable and gpu accelerated cosmology library, arXiv preprint arXiv:2302.05163 (2023).
  37. D. Piras, A. S. Mancini, Cosmopower-jax: high-dimensional bayesian inference with differentiable cosmological emulators, arXiv preprint arXiv:2305.06347 (2023).
  38. J. R. Driscoll, D. M. J. Healy, Computing Fourier transforms and convolutions on the sphere, Adv. Appl. Math. 15 (1994) 202--250.
  39. J. D. McEwen, Y. Wiaux, A novel sampling theorem on the sphere, IEEE Trans. Sig. Proc. 59 (2011) 5876--5887.
  40. A novel sampling theorem on the rotation group, IEEE Sig. Proc. Let. 22 (2015) 2425--2429.
  41. Healpix -- a framework for high resolution discretization and fast analysis of data distributed on the sphere, Astrophys. J. 622 (2005) 759--771.
  42. N. Schaeffer, Efficient spherical harmonic transforms aimed at pseudospectral numerical simulations, Geochemistry, Geophysics, Geosystems 14 (2013) 751--758.
  43. E. T. Newman, R. Penrose, Note on the Bondi-Metzner-Sachs group, J. Math. Phys. 7 (1966) 863--870.
  44. Spin-s𝑠sitalic_s spherical harmonics and ðitalic-ð\ethitalic_ð, J. Math. Phys. 8 (1967) 2155--2161.
  45. Statistics of cosmic microwave background polarization, Phys. Rev. D. D55 (1997) 7368--7388.
  46. Gauss-legendre sampling on the rotation group, IEEE Sig. Proc. Let. 23 (2016) 207--211.
  47. 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.
  48. S2LET: A code to perform fast wavelet analysis on the sphere, Astron. & Astrophys. 558 (2013) 1--9.
  49. An optimal-dimensionality sampling scheme on the sphere with fast spherical harmonic transforms, IEEE Trans. Sig. Proc. 62 (2014) 4597--4610.
  50. FFTs for the 2-sphere -- improvements and variations, J. Fourier Anal. and Appl. 9 (2003) 341--385.
  51. 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.
  52. P. Kostelec, D. Rockmore, FFTs on the rotation group, J. Fourier Anal. and Appl. 14 (2008) 145--179.
  53. T. Risbo, Fourier transform summation of Legendre series and D𝐷Ditalic_D-functions, J. Geodesy 70 (1996) 383--396.
  54. 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.
  55. W. Gautschi, Computational aspects of three-term recurrence relations, SIAM review 9 (1967) 24--82.
  56. G. Prézeau, M. Reinecke, Algorithm for the evaluation of reduced wigner matrices, The Astrophysical Journal Supplement Series 190 (2010) 267.
  57. M. Reinecke, D. S. Seljebotn, Libsharp--spherical harmonic transforms revisited, Astronomy & Astrophysics 554 (2013) A112.
  58. J. W. Cooley, J. W. Tukey, An algorithm for the machine calculation of complex fourier series 19 (1965) 297--301.
  59. 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.
  60. Scalable and equivariant spherical CNNs by discrete-continuous (DISCO) convolutions, in: International Conference on Learning Representations (ICLR), 2023. arXiv:arXiv:2209.13603.
  61. Convolutional networks for spherical signals, in: ICML, Springer, 2018. arXiv:arXiv:1709.04893.
  62. R. E. Wengert, A simple automatic derivative evaluation program, Communications of the ACM 7 (1964) 463--464.
  63. Automatic differentiation in machine learning: a survey, Journal of Marchine Learning Research 18 (2018) 1--43.
  64. Learning representations by back-propagating errors, nature 323 (1986) 533--536.
  65. Sparse image reconstruction on the sphere: implications of a new sampling theorem, IEEE Trans. Image Proc. 22 (2013) 2275--2285.
  66. Sparse image reconstruction on the sphere: analysis vs synthesis, IEEE Trans. Image Proc. 26 (2017) 5176--5187.
  67. Sparse image reconstruction on the sphere: a general approach with uncertainty quantification, IEEE Trans. Image Proc., submitted (2021).
  68. Differentiable cosmological simulation with the adjoint method, The Astrophysical Journal Supplement Series 270 (2024) 36.
  69. BICEP2 Collaboration, Detection of B-Mode Polarization at Degree Angular Scales by BICEP2, Phys. Rev. Lett. 112 (2014) 241101.
  70. Geometric deep learning: Grids, groups, graphs, geodesics, and gauges, arXiv preprint arXiv:2104.13478 (2021).
  71. 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.
  72. Differentiable and accelerated wavelet transforms on the sphere and ball, Journal of Computational Physics, submitted (2024).
  73. Generative models of astrophysical fields with scattering transforms on the sphere, Astronomy & Astrophysics (in prep.).
Citations (5)

Summary

  • The paper develops recursive algorithms for spherical harmonic and Wigner transforms that enable stable, high-performance computations at very high harmonic degrees.
  • It employs a hybrid differentiation approach combining manual and automatic methods to reduce memory overhead during gradient computations.
  • The implementation in the S2FFT library demonstrates up to 400-fold acceleration on GPUs and TPUs, facilitating scalable spherical data analysis.

Overview of "Differentiable and Accelerated Spherical Harmonic and Wigner Transforms"

The research presented in "Differentiable and Accelerated Spherical Harmonic and Wigner Transforms" by Price and McEwen addresses the computational demands for efficient and differentiable spherical harmonic and Wigner transforms. These transforms are critical for data analysis on spherical manifolds, relevant in a wide array of scientific disciplines such as cosmology, quantum chemistry, and geophysics. This paper tackles the emerging need for transforms that can leverage modern hardware accelerators like GPUs and TPUs, and which can also support differentiable programming platforms that are increasingly critical in the field of machine learning.

Algorithmic Contributions

The primary contribution of the paper is the development of novel algorithms for the computation of Fourier transforms on the sphere (S2\mathbb{S}^2) and the rotation group (SO(3)). The authors introduce a recursive algorithm for Wigner dd-functions computation, which is key for both spin spherical harmonic and Wigner transforms. Notably, the recursion they develop is stable to very high harmonic degrees and exhibits a highly parallelizable structure, allowing for significant computational acceleration on modern hardware accelerators.

The authors achieve this by constructing a recursion that iterates over the order mm, independently from degree \ell, spin nn, and angle β\beta. This independence allows for extreme parallelization, a critical feature for deployment on hardware accelerators. They further mitigate the numerical overflow issues by implementing an on-the-fly normalisation scheme throughout the recursion.

Hybrid Differentiation Approach

Price and McEwen develop a hybrid approach to differentiation that combines both manual differentiation for core recursive components and automatic differentiation for the encompassing operations. This approach effectively mitigates the computational memory overhead typically associated with reverse-mode automatic differentiation while still reaping the software maintainability and complexity reduction benefits AD provides.

Practical Implementation: S2FFT

The research leads to the creation of S2FFT, a Python-based software library leveraging the JAX framework. S2FFT supports varying sampling schemes such as Driscoll & Healy (DH), McEwen & Wiaux (MW), and the HEALPix sampling scheme. S2FFT is designed to transparently deploy over multiple hardware accelerators, and for high-bandwidth settings, reveals close to linear scalability with increasing numbers of GPUs.

Numerical Evaluation and Performance

The performance of the proposed algorithms is rigorously evaluated against existing implementations. For bandlimits up to L=8192L=8192, the algorithms demonstrate computational errors within machine precision for sampling theorems, confirming the effectiveness of implementing exact quadrature approaches. Moreover, S2FFT achieves speed-ups up to 400-fold compared to alternative C implementations for spherical harmonic and Wigner transforms, showcasing its potential to significantly reduce computational time in extensive applications.

Implications and Future Directions

The results presented in this paper have significant implications for computational science and data analysis on spherical domains. By making these transforms both fast and differentiable, the paper opens up new possibilities for their integration with machine learning frameworks, particularly for gradient-based optimization processes. Potential applications extend to precise global climate modeling, cosmological data analysis, and various physics-based machine learning models.

Furthermore, this work could underpin advances in geometric deep learning, where leveraging spherical data with efficient harmonic analysis plays a crucial role. Future work might explore extending these algorithms for other spherical transformations or adapting them to emerging scientific computing environments and hardware platforms. The development of S2FFT as an open-source project invites further community engagement and extension, fostering further innovation and application in diverse scientific settings.

Github Logo Streamline Icon: https://streamlinehq.com