more cleanups
This is a collection of basic programming tools for numerical computation, including Fast Fourier Transforms, Spherical Harmonic Transforms, non-equispaced Fourier transforms, as well as some concrete applications like 4pi convolution on the sphere and gridding/degridding of radio interferometry data.
The code is written in C++23, but provides a simple and comprehensive Python interface.
g++ (verified with gcc 12.4.0, earlier versions might also work)clang++ (verified with clang++ 18.1.3, earlier versions might also work)icpx (oneAPI compiler series, verified woth icpx 2026.2, earlier versions might also work). Note that the older icpc compilers are not supported.The latest version of DUCC can be obtained by cloning the repository via
git clone https://gitlab.mpcdf.mpg.de/mtr/ducc.git
It can be installed via
pip3 install .
with optional additional flags, depending on personal preferences.
Online documentation of the most recent Python interface is available at https://mtr.pages.mpcdf.de/ducc.
The C++ interface is documented at https://mtr.pages.mpcdf.de/ducc/cpp. Please note that this interface is not as well documented as the Python one, and that it should not be considered stable.
For best performance it is recommended to compile DUCC from source, optimizing for the specific CPU on the system. This can be done using the command
pip3 install --no-binary ducc0 --user ducc0
NOTE: compilation requires the appropriate compilers to be installed (see above) and can take a few minutes.
Alternatively, a simple
pip3 install --user ducc0
will install a pre-compiled binary package, which makes the installation process much quicker and does not require any compilers to be installed on the system.
On Linux and x86_64 hardware, the binary package will contain multiple variants of the library for different CPU feature sets, the best of which is loaded at import time. This will result in a much smaller performance gap compared to a self-compiled package. This multiarch approach will likely be extended to other CPU architectures in future releases.
Additionally, pre-compiled binaries are distributed for the following systems:
This package provides Fast Fourier, trigonometric and Hartley transforms with a simple Python interface. It is an evolution of pocketfft and pypocketfft which are currently used by numpy and scipy.
The central algorithms are derived from Paul Swarztrauber's FFTPACK code.
ducc.fft can be significantly faster.Library for non-uniform FFTs in 1D/2D/3D (all transform types). The goal is to provide similar or better performance and accuracy than FINUFFT, making use of lessons learned during the implementation of the wgridder module (see below).
This package provides efficient spherical harmonic transforms (SHTs). Its code is derived from libsharp, but has been significantly enhanced.
The code for rotating spherical harmonic coefficients was taken (with some modifications) from Mikael Slevinsky's FastTransforms package.
This library provides Python bindings for the most important functionality related to the HEALPix tesselation, except for spherical harmonic transforms, which are covered by ducc.sht.
The design goals are
Library for high-accuracy 4pi convolution on the sphere, which generates a total convolution data cube from a set of sky and beam a_lm and computes interpolated values for a given list of detector pointings. This code has evolved from the original totalconvolver algorithm via the conviqt code.
ducc.sht SHTs and ducc.fft FFTs to compute the data cubeLibrary for high-accuracy gridding/degridding of radio interferometry datasets (code paper available at https://arxiv.org/abs/2010.10122). This code has also been integrated into wsclean (https://arxiv.org/abs/1407.1943) as the wgridder component.
Various unsorted functionality which will hopefully be categorized in the future.
This module contains an efficient algorithm for the computation of abscissas and weights for Gauss-Legendre quadrature. For degrees up to 100, the solutions are computed in the standard iterative fashion; for higher degrees Ignace Bogaert's FastGL algorithm is used.