FFTArray: A Python Library for the Implementation of Discretized Multi-Dimensional Fourier Transforms

arXiv:2508.03697v1 Announce Type: new
Abstract: Partial differential equations describing the dynamics of physical systems rarely have closed-form solutions. Fourier spectral methods, which use Fast Fourier Transforms (FFTs) to approximate solutions, are a common approach to solving these equations. However, implementing those requires careful attention to grid selection and coordinate-dependent phase and scale factors when mapping the Fourier integrals to discrete FFTs. Most existing software packages integrate the Fourier transform discretization tightly into their full-stack implementations. This integrated design sacrifices generality, making it difficult to adapt to new coordinate systems, boundary conditions, or problem-specific requirements. To address these challenges, we present FFTArray, a Python library that automates the general discretization of Fourier transforms. It allows to easily define valid coordinate grids and efficiently applies the coordinate grid specific corrections with minimal impact on computational performance. Built on the Python Array API Standard, FFTArray supports GPU acceleration and integrates seamlessly with array backends like NumPy, JAX and PyTorch. Its interface enables the direct translation of textbook equations and complex research problems into code, while its modular design scales naturally to multiple dimensions. FFTArray allows scientists to focus on their core scientific challenges and thereby reduces the barrier to developing high-performance, maintainable code for pseudo-spectral Fourier methods. The code is openly available at https://github.com/QSTheory/fftarray under Apache-2.0 license.

More From Author

Energies, Vol. 18, Pages 4198: Comprehensive Energy and Economic Analysis of Selected Variants of a Large-Scale Photovoltaic Power Plant in a Temperate Climate

Pathways to Quantum: Fostering High School Student Interest in Quantum Information Science

Leave a Reply

Your email address will not be published. Required fields are marked *