SHTnsKit.jl
🌐 Full Transform Suite
Scalar, tangential-vector, and three-component QST transforms with Gauss–Legendre and equiangular grids.
⚡ Multi-Backend
Run full-grid transforms on CPUs, NVIDIA CUDA, AMD ROCm, and Apple Metal GPUs through the same Julia API.
📡 MPI Distribution
Distribute latitude bands across MPI ranks with PencilArrays for fields that exceed single-node memory.
🧮 Differentiable
ForwardDiff, Zygote, and ChainRules extensions make transforms compatible with Julia’s AD ecosystem.
Install
using Pkg
Pkg.add("SHTnsKit")See Installation only if you need a GPU, MPI, or help with setup.
First transform
Start with known band-limited coefficients so the roundtrip has an exact answer:
using SHTnsKit
cfg = create_gauss_config(16, 18)
coefficients = zeros(ComplexF64, cfg.lmax + 1, cfg.mmax + 1)
coefficients[3, 1] = 1.0 # degree l=2, order m=0
coefficients[5, 3] = 0.25 - 0.1im # degree l=4, order m=2
field = synthesis(cfg, coefficients)
recovered = analysis(cfg, field)
@assert maximum(abs, recovered - coefficients) < 1e-12
size(field)(18, 34)Spatial fields use (latitude, longitude) order. Dense coefficients use (l + 1, m + 1) indexing because Julia arrays start at one.
Choose your path
| I want to... | Read... |
|---|---|
| understand arrays and transform directions | Quick Start |
| choose the right spherical sampling | Grid Types |
| adapt a working scientific recipe | Examples Gallery |
| keep transforms on an NVIDIA, AMD, or Apple GPU | GPU Acceleration |
| distribute fields across MPI ranks | Distributed Computing |
| make repeated transforms faster | Performance Guide |
| use packed storage, operators, rotations, or AD | Advanced Usage |
| exchange coefficients with another library | Normalization and Phase |
| understand source files and extension system | Package Architecture |
The API Reference lists the complete public surface. Most users can begin with the default Gauss–Legendre grid and orthonormal convention.