UnifiedSparseGrids.jl
UnifiedSparseGrids.jl is a Julia package for regular sparse grid data structures, transforms, matrix-free tensor operators, and dimension-adaptive sparse quadrature built around
- nested 1D axis families,
- downward-closed refinement-index sets such as Smolyak, weighted Smolyak, and full tensor, and
- explicit coefficient layouts with deterministic sparse grid traversal.
The package is designed for interpolation / approximation workflows, adaptive quadrature, and sparse grid Galerkin experiments where you want direct control over layouts, transforms, basis changes, tensor operators, and anisotropic admissibility envelopes.
Installation
Until the package is registered, install it directly from GitHub:
import Pkg
Pkg.add(url="https://github.com/redblackbst/UnifiedSparseGrids.jl")Once registered, Pkg.add("UnifiedSparseGrids") will work as usual.
Quick start
A sparse grid is described by
- a 1D axis family per dimension (for example Chebyshev–Gauss–Lobatto axes), and
- a downward-closed refinement-index set.
These are stored in a SparseGridSpec, and wrapped by SparseGrid.
using UnifiedSparseGrids
D = 2
L = 4
axes = ntuple(_ -> ChebyshevGaussLobattoNodes(), Val(D))
I = SmolyakIndexSet(D, L)
grid = SparseGrid(SparseGridSpec(axes, I))
@show length(grid)Sample a function on sparse grid points (ordered consistently with traverse(grid)):
vals = evaluate(grid) do x
exp(-sum(abs2, x))
endWhat the package covers
Already implemented:
- Smolyak, weighted Smolyak, and full tensor refinement-index sets
- nested axis families such as Chebyshev–Gauss–Lobatto, dyadic, Fourier equispaced rules, and several quadrature families
- recursive and subspace (block) coefficient layouts, with explicit conversions
- the unidirectional engine for hierarchization, nodal–modal transforms, basis changes, and matrix-free tensor operators
- evaluation planning on tensor grids and scattered point sets
- dimension-adaptive sparse quadrature on downward-closed admissibility envelopes
- cross-grid transfers (
restrict!/embed!) and Galerkin utilities - worked tutorials covering sparse FFT splitting, sparse spectral Galerkin elliptic solves, and hierarchical-hat Helmholtz operators
Active directions:
- more axis families and transforms:
- Gauss / Gauss–Lobatto rules with fast tensorized transforms,
- nested sequences such as Patterson / Leja / pseudo-Gauss,
- dyadic wavelet / Walsh–Hadamard transforms,
- Chebyshev–Gauss (roots) with DCT-II / DCT-III,
- combination-technique workflows,
- tighter PDE tooling integration, for example via GalerkinToolkit.jl.
Related projects
- SG++: sparse grids toolbox
- Tasmanian: sparse grids for UQ / interpolation
- ASGarD: adaptive sparse grid DG for high-dimensional PDEs
- SparseGridQuadrature.jl: Julia sparse grid quadrature
- smolyax: Smolyak interpolation operator in JAX
Where to start
- Coefficient ordering and iteration: Layouts and iteration
- Fast tensor-product sweeps (including nodal–modal transforms): Unidirectional principle
- Evaluating sparse grid coefficient vectors at point sets: Evaluation
- Matrix-free Galerkin building blocks: Galerkin tools
- Dimension-adaptive sparse quadrature: Adaptive quadrature
- End-to-end examples: see the Tutorials section in the navigation sidebar
- Layouts and iteration
- Unidirectional principle
- Evaluation
- Adaptive quadrature
- Galerkin tools
- Time-dependent Schrödinger equation on sparse grids (Gradinaru 2007)
- Sparse spectral Galerkin elliptic solve (Shen–Yu 2010)
- Helmholtz on sparse grids in a hierarchical hat basis (Balder–Zenger 1996)
- Conventions
- Development notes
- Multi-threading