pcfft documentation

PCFFT is a MATLAB library for fast N-body summation of translation-invariant kernels in \(\mathbb{R}^2\) and \(\mathbb{R}^3\). It can approximate sums of the form:

\[f(y_i) = \sum_{j=1}^N k(y_i, x_j) \mu_j, \tag{1}\]
\[g(y_i) = \sum_{j=1}^N \partial_{\boldsymbol{n}_i} \partial_{\boldsymbol{n}_j} k(y_i, x_j) \mu_j. \tag{2}\]

and more at a large number of source points \(x_j\) and target points \(y_i\) efficiently. The code is designed to be easy to use and adaptable to a wide range of kernels, allowing the user to rapidly prototype large-scale numerical computations. In particular:

  • The method applies to a broad class of smooth translation-invariant kernels \(k(y, x) = k(y - x)\), not just kernels arising from the Green’s function of an elliptic PDE.

  • Analytical knowledge of the Fourier transform of the kernel is not required.

  • After a one-time precomputation step, the apply step uses Fast Fourier Transforms and sparse linear algebra, making it very fast for large problems.

The precorrected FFT method is ideal for when the sources and targets with a quasi-uniform distribution and will slow down if points are adaptively clustered.

Example usage 1 provides a brief introduction to using the package to evaluate sums of the form \((1)\), and Example usage 2 shows how to evaluate sums of the form \((2)\). More examples are being built at https://github.com/meliao/pcfft/tree/main/demos.

This package involves solving many poorly conditioned least squares problems. The warnings that this generates can be suppressed by running warning(‘off’,’MATLAB:rankDeficientMatrix’);.

Source repository

Available on GitHub at https://github.com/meliao/pcfft.

Installation and Dependencies

PCFFT can be installed from source:

git clone https://github.com/meliao/pcfft.git --recurse-submodules

The package depends on Kenneth Ho’s package FLAM, available at https://github.com/fastalgorithms/FLAM.