# Introduction

Our goal is efficient and robust numerical evaluation of Fourier integrals of the form $f(\vec{r}) = N_n(a,b) \int\, d^n k\, e^{+b i (\vec{k}\cdot\vec{r})}\, \tilde{f}(\vec{k}) \quad , \quad \tilde{f}(\vec{k}) = \tilde{N}_n(a,b) \int\, d^n r\, e^{-b i (\vec{k}\cdot\vec{r})}\,f(\vec{r}) \; , \label{eqn:fourier}$ with normalization factors $N_n(a,b) = |b|^{n/2} (2\pi)^{-n(1+a)/2} \quad , \quad \tilde{N}_n(a,b) = |b|^{n/2} (2\pi)^{-n(1-a)/2} \; ,$ where the constants $$a$$ and $$b$$ establish our choice of Fourier convention1. We focus on two- and three-dimensional ($$n=2,3$$) transforms of functions that can be adequately represented with a small number of (not necessarily low order) multipoles. Specifically, for $$n=2$$, we expand $f(r,\varphi_r) = \sum_{m=-\infty}^{+\infty} f_m(r)\,\Phi_m(\varphi_r) \quad , \quad \tilde{f}(k,\varphi_k) = \sum_{m=-\infty}^{+\infty} \tilde{f_m}(k)\,\Phi_m(\varphi_k) \; , \label{eqn:multipole2}$ using the polar basis functions $\Phi_m(\varphi) \equiv \frac{1}{\sqrt{2\pi}}\, e^{i m \varphi}$ with orthonormality2 ($$\delta_D$$ and $$\delta$$ are the Dirac and Kronecker delta functions, respectively): $\sum_{m=-\infty}^{+\infty} \Phi_m(\varphi)\Phi^\ast_m(\varphi') = \delta_D(\varphi-\varphi') \label{eqn:dirac2}$ and $\int_0^{2\pi} d\varphi\, \Phi_m(\varphi) \Phi_{m'}^\ast(\varphi) = \delta_{m m'} \; . \label{eqn:kronecker2}$ Similarly, for $$n = 3$$, we expand $f(r,\theta_r,\varphi_r) = \sum_{\ell=0}^{\infty}\sum_{m=-\ell}^{+\ell} f_{\ell m}(r)\, Y_{\ell m}(\theta_r,\varphi_r) \quad, \quad \tilde{f}(k,\theta_k,\varphi_k) = \sum_{\ell=0}^{\infty}\sum_{m=-\ell}^{+\ell} \tilde{f_{\ell m}}(k)\, Y_{\ell m}(\theta_k,\varphi_k) \; , \label{eqn:multipole3}$ using the spherical-harmonic basis functions3 (with associated Legendre polynomials $$P_{\ell}^m$$) $Y_{\ell m}(\theta,\varphi) \equiv \sqrt{\frac{2\ell+1}{2}\frac{(\ell-m)!}{(\ell+m)!}}\, P_{\ell}^m(\cos\theta) \Phi_m(\varphi)$ with orthonormality4 $\sum_{\ell=0}^{\infty}\sum_{m=-\ell}^{+\ell} Y_{\ell m}(\theta,\varphi)Y_{\ell m}^\ast(\theta',\varphi') = \delta_D(\cos\theta-\cos\theta') \delta_D(\varphi-\varphi') \label{eqn:dirac3}$ and5 $\int d\Omega\, Y_{\ell m}(\theta,\varphi) Y_{\ell' m'}^\ast(\theta,\varphi) = \delta_{\ell\ell'}\delta_{m m'} \; . \label{eqn:kronecker3}$ In the special ca