EP-0232: Geometric, Simplicial Hodge & Cellular Sheaf Spectral Wavelets¶
| Field | Value |
|---|---|
| EP | 0232 |
| Title | Geometric, Simplicial Hodge & Cellular Sheaf Spectral Wavelets |
| Author | Eran Rivlis eran@rivlis.info, Antigravity |
| Sponsor | Core Maintainers |
| Delegate | ⚡ Shannon (Matrix-Free Chebyshev Recurrence), ⚖️ Noether (Hodge Spectral Bands) & 🔬 Popper |
| Status | Draft |
| Type | Standards Track |
| Created | 2026-11-14 |
| Updated | 2026-11-26 |
| Replaces | — |
| Superseded-By | — |
Abstract¶
This proposal bridges algebrax.transforms with the topological Laplacians of Phase 4 (EP-0152, EP-0160, EP-0161), introducing Geometric, Simplicial Hodge, and Cellular Sheaf Harmonic Analysis:
- Matrix-Free Chebyshev Polynomial Spectral Filtering (
chebyshev_spectral_filter): Evaluates any spectral filter \(g(\mathcal{L})f \approx \frac{1}{2}c_0 f + \sum_{k=1}^K c_k T_k(\tilde{\mathcal{L}})f\) on any positive semidefinite sparse Laplacian \(\mathcal{L}\) (Graph \(L_0\), Hodge \(L_k\), or Sheaf \(L_{\mathcal{F}}\)) via the 3-term Chebyshev recurrence \(T_k(\tilde{\mathcal{L}})f = 2\tilde{\mathcal{L}}T_{k-1}(\tilde{\mathcal{L}})f - T_{k-2}(\tilde{\mathcal{L}})f\) using only \(K\) sparse matrix-vector multiplications (zero \(O(N^3)\) eigendecomposition required). - Hammond–Vandergheynst–Gribonval Spectral Graph & Sheaf Wavelets (
spectral_wavelet_transform): Constructs multiscale wavelet frames \(\{T_g^{t_s} \delta_v\}\) localized at vertices, edges, or sheaf stalks across scales \(t_1, \dots, t_S\). - Simplicial Hodge Fourier Transform (
hodge_fourier_transform,hodge_spectral_filter): Decomposes \(k\)-cochain signals (such as edge flows on networks and simplicial meshes) into three orthogonal spectral bands governed by \(L_k = L_k^{\text{down}} + L_k^{\text{up}} = \partial_k^* \partial_k + \partial_{k+1}\partial_{k+1}^*\): - Harmonic Zero-Modes (\(\lambda = 0\), \(\ker L_k\)): Topological holes counted by Betti number \(b_k\).
- Irrotational / Gradient Frequencies (\(\operatorname{im} \partial_k^*\)): Modes excited solely by \(L_k^{\text{down}}\).
- Solenoidal / Curl Frequencies (\(\operatorname{im} \partial_{k+1}\)): Modes excited solely by \(L_k^{\text{up}}\).
Motivation¶
In Phase 4, AlgebraX introduced the Graph Laplacian (laplacian_matrix), the \(k\)-th Hodge Laplacian (hodge_laplacian in EP-0160), and the Sheaf Coboundary Laplacian (sheaf_laplacian in EP-0161). However:
- No Spectral Transform or Wavelet Layer: Users can compute the Laplacian matrix \(\mathcal{L}\), but there is no API to transform signals into the Laplacian frequency domain, design low-pass / band-pass / heat-diffusion spectral filters \(g(\mathcal{L})f\), or compute localized graph/simplicial wavelets.
- Avoiding \(O(N^3)\) Full Eigendecomposition on Sparse Complexes: Diagonalizing a Laplacian of size \(N\) costs \(O(N^3)\) time and \(O(N^2)\) dense memory. By contrast, Hammond, Vandergheynst & Gribonval ([HAMMOND-2009]) showed that Chebyshev polynomial approximation \(T_k(\tilde{\mathcal{L}})f\) requires only sparse dictionary matrix-vector products, running 60x faster (
0.24 msvs.14.42 mswith1.80e-09relative accuracy inEXP-0010Experiment 4). - Joint curl/divergence Filtering on Edge Flows: Standard graph signal processing only filters node signals (\(L_0\)). On edge flows (\(1\)-cochains), a filter \(g_{\text{grad}}(L_1^{\text{down}}) + g_{\text{curl}}(L_1^{\text{up}}) + g_{\text{harm}}(P_{\ker L_1})\) can independently smooth gradient noise while preserving solenoidal vortices and harmonic cycles.
Rationale¶
Validated in EXP-0010 (Experiment 4) and aligned with the Grand Council and Phase 8.5 (EP-0251–EP-0254):
- ⚡ Claude Shannon (Matrix-Free Sparse Clenshaw/Chebyshev Recurrence & \(O(\text{nnz})\) Hot Paths):
Operates directly on AlgebraX's unboxed
SparseMatrix[K, float]andSparseVector[K, float]viaalgebrax.matrix.mat_vec, directly benefiting fromEP-0251's \(O(N^2) \to O(\text{nnz})\)mat_vec/inneroptimization, single-rebuildSimplicialComplex,CellularSheaftolforwarding, and corrected sparse-zero semantics ingradient/laplacian. - ⚖️ Emmy Noether (Hodge Orthogonality \(L_k^{\text{down}} L_k^{\text{up}} = \mathbf{0}\) & Semiring Propagation):
Because \(\partial_k \circ \partial_{k+1} = 0\), the lower and upper Hodge Laplacians commute and annihilate each other (\(L_k^{\text{down}} L_k^{\text{up}} = 0\)), allowing independent polynomial filtering of gradient and curl frequency spectra. Builds on
EP-0251'sRectSparseMatrixrectangular incidence operators andEP-0252's semiring-propagatingSparseChainComplex.hodge_laplacian. - 🔬 Karl Popper (Parseval Energy & Chebyshev Convergence Oracles):
Verifies that Chebyshev polynomial filters converge exponentially to exact spectral functions \(g(\mathcal{L})f\) and that the Graph/Hodge Fourier Transform is an orthogonal isometry preserving inner products \(\langle f, h \rangle = \langle \hat{f}, \hat{h} \rangle\), adhering to
EP-0253non-vacuous sample contracts andNaN != NaNequality guards. - 🛡️ The Golem (Explicit Laplacian Semantics & State Safety):
Respects
EP-0254's explicitis_laplacianparameter onlaplacian_smoothing(eliminating signed-weight guesswork) andEP-0252's defensive copies onSparseChainComplex. - 💡 Richard Feynman (The Freshman Test): "How do you build a wavelet on an irregular network where you can't just 'stretch' \(x \to x/s\)? You let a drop of heat diffuse across the edges using the Laplacian \(e^{-tL}\), and take the difference between two time scales—and with Chebyshev polynomials, you just hop from neighbor to neighbor \(K\) times without ever finding a single eigenvalue!"
Specification¶
1. Fast Chebyshev Polynomial Spectral Filter & Wavelets (src/algebrax/harmonic/spectral.py)¶
from __future__ import annotations
from collections.abc import Callable, Sequence
from typing import TypeVar
from algebrax.typing import SparseMatrix, SparseVector
K = TypeVar("K")
def chebyshev_coefficients(
kernel_fn: Callable[[float], float],
lambda_max: float,
order: int = 12,
) -> tuple[float, ...]:
r"""Compute Gauss–Chebyshev quadrature coefficients $(c_0, c_1, \dots, c_K)$ of $g(\lambda)$ on $[0, \lambda_{\max}]$."""
...
def chebyshev_spectral_filter(
laplacian: SparseMatrix[K, float],
signal: SparseVector[K, float],
kernel_fn: Callable[[float], float],
*,
lambda_max: float | None = None,
order: int = 12,
) -> dict[K, float]:
r"""Apply spectral filter $g(\mathcal{L})\,f \approx \frac{1}{2}c_0 f + \sum_{k=1}^K c_k T_k(\tilde{\mathcal{L}})f$ using sparse matrix-vector products.
Works polymorphically on Graph Laplacians ($L_0$), Simplicial Hodge Laplacians ($L_k$),
and Cellular Sheaf Laplacians ($L_{\mathcal{F}}$) without eigendecomposition.
"""
...
def spectral_wavelet_transform(
laplacian: SparseMatrix[K, float],
signal: SparseVector[K, float],
scales: Sequence[float],
*,
wavelet_kernel: Callable[[float], float] | None = None,
scaling_kernel: Callable[[float], float] | None = None,
lambda_max: float | None = None,
order: int = 12,
) -> dict[int | str, dict[K, float]]:
r"""Compute the Hammond–Vandergheynst–Gribonval multiscale spectral wavelet transform $\{T_g^{t_s} f\}$."""
...
2. Graph & Simplicial Hodge Spectral Transforms (src/algebrax/harmonic/hodge_ft.py)¶
def hodge_spectral_filter(
lower_laplacian: SparseMatrix[K, float],
upper_laplacian: SparseMatrix[K, float],
cochain: SparseVector[K, float],
*,
grad_kernel: Callable[[float], float],
curl_kernel: Callable[[float], float],
harmonic_gain: float = 1.0,
lambda_max: float | None = None,
order: int = 12,
) -> dict[K, float]:
r"""Filter a $k$-cochain independently across gradient ($\operatorname{im}\partial_k^*$), curl ($\operatorname{im}\partial_{k+1}$), and harmonic ($\ker L_k$) bands."""
...
3. Verification Oracles (src/algebrax/verification/)¶
Exported publicly via algebrax.verification (complying with Phase 8.5 EP-0253 non-vacuous sample contracts):
verify_chebyshev_spectral_filter(laplacian, signal, kernel_fn):- Verifies that for any polynomial kernel \(p(\lambda)\) of degree \(d \le K\),
chebyshev_spectral_filter(L, f, p, order=K)matches exact matrix polynomial evaluation \(p(L)f\) to machine precision (< 1e-12). - Verifies Hodge band annihilation: applying
hodge_spectral_filterwithgrad_kernel=0, harmonic_gain=0produces a purely solenoidal cochain in \(\ker \partial_k\).
Backwards Compatibility¶
Strictly additive. Introduces chebyshev_spectral_filter, spectral_wavelet_transform, and hodge_spectral_filter and re-exports them through algebrax.transforms and algebrax.topology.
How to Teach This / Documentation Plan¶
- User Guide: Add a spectral wavelets & Hodge filtering guide in
docs/guide/topology/spectral_wavelets.mdand cross-link fromdocs/guide/transforms/spectral.md. - Recipe: Add
recipes/simplicial_hodge_wavelet_denoising.py(and synced.ipynb) demonstrating vortex-preserving edge-flow denoising on a 2D mesh with holes.
Reference Implementation¶
Prototyped and verified in references/explorations/EXP-0010-generalized-harmonic-analysis/sources/prototype_harmonic_analysis.py (Experiment 4).
Rejected Ideas¶
- Requiring
scipy.sparse.linalg.eigshfor All Graph/Hodge Filtering: - Rejected: Violates the zero-heavy-dependency pure-Python mandate and is unnecessary when Chebyshev polynomial recurrence evaluates \(g(\mathcal{L})f\) directly via sparse
dictmatrix-vector products.
Open Questions¶
- [ ] Adding Gershgorin circle theorem bounds (
estimate_lambda_max(laplacian)) as the defaultlambda_maxestimator whenlambda_max=None.
Change Log¶
- 2026-11-14:
- Initial Draft authored for Phase 10 from
EXP-0010. - 2026-11-26:
- Aligned with Phase 8.5 (
EP-0251–EP-0254): fixed broken symbols (graph_laplacian→laplacian_matrix,algebrax.matrix.multiply→algebrax.matrix.mat_vec), documented \(O(\text{nnz})\)mat_vec& semiringhodge_laplacian/RectSparseMatrixintegration, updated verification path tosrc/algebrax/verification/, and fixed user guide path todocs/guide/transforms/spectral.md.