Sparse Grid Interpolation Toolbox for Python
Sparse Grid Interpolation Toolbox for Python.
| Grid type | Basis | Max depth |
|---|---|---|
| Clenshaw-Curtis | Piecewise linear | 8 |
| Chebyshev | Polynomial (DCT) | 10 |
| Gauss-Patterson | Nested Gaussian | 6 |
| Maximum | Piecewise linear | 8 |
| NoBoundary | Piecewise linear | 8 |
| Python binding | Description |
|---|---|
spvals |
Compute hierarchical surpluses |
spinterp |
Evaluate interpolant (and gradient) at points |
spquad |
Integrate interpolant over domain |
spgrid |
Return sparse grid node coordinates |
spgetseq |
Generate multi-index level sequences |
import spinterp
z = spinterp.spvals(lambda x, y, t: x**2 + y**2 - 2 * t, d=3)
f = spinterp.spinterp(z, 0.5, 0.2, 0.2)
q = spinterp.spquad(z)pip install spinterpRequires Python 3.10+ and NumPy.
python bin/build.py install # build and install via uv
python bin/build.py wheel # produce a wheel in dist/
python bin/build.py clean # remove all build artifactsRequires gfortran, Meson, and f2py (numpy).
- Theory — hierarchical basis, Smolyak construction, algorithms
- Quickstart — runnable examples
- API Reference — function signatures and arguments
GNU General Public License v3 (GPLv3) — see LICENSE.