A Python Sparse Grid Package
Project description
sparse_grid
A Python Sparse Grid Package
sparse_grid is a pure-Python implementation of regular
sparse grids
over box domains. It provides hierarchical index generation, nodal-to-hierarchical
coefficient conversion, and fast function evaluation using the hat basis:
$$f_n(\mathbf{x}) = \sum_{\lvert\mathbf{l}\rvert_1 \le n+d-1} \sum_{\mathbf{p}} \alpha_{\mathbf{l},\mathbf{p}}, \prod_{i=1}^{d} \phi_{l_i, p_i}(x_i)$$
Quick example
from sparse_grid import SparseGrid
sg = SparseGrid(dim=2, level=3)
sg.generate_points()
for index in sg.indices:
pos = sg.g_p[tuple(index)].pos
sg.g_p[tuple(index)].fv = (
4.0 * pos[0] * (1.0 - pos[0]) * 4.0 * pos[1] * (1.0 - pos[1])
)
sg.nodal_2_hier()
print(sg.eval_funct([0.25, 0.75]))
Installation
pip install sparse_grid
Requires Python 3.10+. No external runtime dependencies. See the full installation guide for uv, poetry, and source builds.
Documentation
- Theory — mathematical background, hierarchical basis, algorithms
- Quickstart — runnable examples
- API Reference — class and function signatures
- References — literature citations
License
BSD-3-Clause — see LICENSE.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sparse_grid-0.1.4.tar.gz.
File metadata
- Download URL: sparse_grid-0.1.4.tar.gz
- Upload date:
- Size: 58.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebbc59e69af70cdcf670e1db0f8380652934081d15f9b0e170dbbe29e1c7b6c5
|
|
| MD5 |
740b1d0fbb743588bd5a97be9cbb594f
|
|
| BLAKE2b-256 |
17c79c9a87c1bb015dd402a9487c2abf73923066a979fb91b4424c6493bcbb84
|
Provenance
The following attestation bundles were made for sparse_grid-0.1.4.tar.gz:
Publisher:
publish_dist.yml on eggzec/sparse_grid
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sparse_grid-0.1.4.tar.gz -
Subject digest:
ebbc59e69af70cdcf670e1db0f8380652934081d15f9b0e170dbbe29e1c7b6c5 - Sigstore transparency entry: 1043900217
- Sigstore integration time:
-
Permalink:
eggzec/sparse_grid@9d6543d39be8818e0cdcee6913720b2e688ad441 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/eggzec
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_dist.yml@9d6543d39be8818e0cdcee6913720b2e688ad441 -
Trigger Event:
release
-
Statement type:
File details
Details for the file sparse_grid-0.1.4-py3-none-any.whl.
File metadata
- Download URL: sparse_grid-0.1.4-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ddc91ed7a4d0e7698fe3517b6aec0defef540716ba096a97ac7f658d5e6e2f59
|
|
| MD5 |
a1222a53334c4ecec3a51b5792a00493
|
|
| BLAKE2b-256 |
3ffd7ae875b6afa97a5e7bd23bdd827ee23695f0fecd2ea8a34ecc0d5f6332ce
|
Provenance
The following attestation bundles were made for sparse_grid-0.1.4-py3-none-any.whl:
Publisher:
publish_dist.yml on eggzec/sparse_grid
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sparse_grid-0.1.4-py3-none-any.whl -
Subject digest:
ddc91ed7a4d0e7698fe3517b6aec0defef540716ba096a97ac7f658d5e6e2f59 - Sigstore transparency entry: 1043900316
- Sigstore integration time:
-
Permalink:
eggzec/sparse_grid@9d6543d39be8818e0cdcee6913720b2e688ad441 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/eggzec
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_dist.yml@9d6543d39be8818e0cdcee6913720b2e688ad441 -
Trigger Event:
release
-
Statement type: