All notable changes to PyChebyshev will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Sub-interval integration via
boundsparameter onintegrate()for bothChebyshevApproximationandChebyshevSpline. Uses generalized Fejér-1 quadrature with sub-interval Chebyshev moments computed from closed-form antiderivatives (Trefethen 2013, Ch. 19). - Spline sub-interval integration with automatic piece overlap clipping: pieces with no overlap are skipped, partial overlaps receive sub-interval bounds, fully contained pieces use standard Fejér-1 weights.
- 22 new tests for sub-interval integration (14 for ChebyshevApproximation, 8 for ChebyshevSpline), including polynomial exactness, scipy cross-validation, additivity, and error handling.
integrate()method onChebyshevApproximationandChebyshevSplinefor definite integration via Fejér-1 quadrature (Waldvogel 2006), with O(n log n) weight computation via DCT-III and O(n^d) multi-D contraction via BLAS.roots()method onChebyshevApproximationandChebyshevSplinefor finding all real roots along a dimension via companion matrix eigenvalues (numpy.polynomial.chebyshev.chebroots).minimize()/maximize()methods onChebyshevApproximationandChebyshevSplinefor global optimization via derivative rootfinding and endpoint evaluation.- Partial integration returns a lower-dimensional
ChebyshevApproximation(analogous toslice()). - Internal
_calculus.pymodule with shared helpers for Fejér-1 weights, 1-D rootfinding, and 1-D optimization. - New documentation page: Chebyshev Calculus (integration, roots, optimization).
- 52 new tests for calculus operations (test_calculus.py).
extrude()andslice()methods onChebyshevApproximation,ChebyshevSpline, andChebyshevSlider.- Extrusion adds new dimensions where the function is constant, enabling portfolio combination across different risk-factor sets.
- Slicing fixes a dimension at a value, reducing dimensionality via barycentric interpolation (with fast path at exact nodes).
- Extrude-then-slice round-trip preserves the original interpolant exactly.
- Internal
_extrude_slice.pymodule with shared validation and tensor manipulation helpers. - New documentation page: Extrusion & Slicing (mathematical proofs, API reference, portfolio use case).
compare_extrude_slice.py-- MoCaX comparison script (local only, not in CI).- 63 new tests for extrusion and slicing across all three classes.
- Arithmetic operators (
+,-,*,/, unary-,+=,-=,*=,/=) forChebyshevApproximation,ChebyshevSpline, andChebyshevSlider. - Portfolio-level combination of Chebyshev interpolants via weighted sums -- no re-evaluation needed.
- Derivatives and error estimates propagate correctly through algebraic operations.
- Internal
_algebra.pymodule with shared compatibility validation. _from_grid()factory onChebyshevApproximation,_from_pieces()onChebyshevSpline,_from_slides()onChebyshevSlider.
ChebyshevSplineclass for piecewise Chebyshev interpolation with user-specified knots (Section 3.8, Ruiz & Zeron 2021)- Knot-based domain partitioning: place knots at kinks or discontinuities to restore spectral convergence on each piece
eval(),eval_multi(),eval_batch()with automatic piece routing vianp.searchsorted- Analytical derivatives within each piece via spectral differentiation matrices (inherited from
ChebyshevApproximation) ValueErrorraised when requesting derivatives at knot boundaries (left/right derivatives differ)error_estimate()returning the maximum error across all disjoint piecessave()/load()serialization following the same pattern as other PyChebyshev classesnum_pieces,total_build_evals,build_timeproperties- New documentation page: Chebyshev Splines (mathematical justification, usage guide)
compare_spline.py— MoCaX spine comparison script (local only, not in CI)- ~34 new tests for spline construction, accuracy, derivatives, batch eval, serialization
ChebyshevTTclass for Chebyshev interpolation in Tensor Train format (Chapter 6, Ruiz & Zeron 2021)- TT-Cross approximation (
method='cross') for building from O(d * n * r^2) function evaluations instead of O(n^d) - TT-SVD build option (
method='svd') for validation and moderate-dimension problems eval()for single-point evaluation via TT inner product with Chebyshev polynomial contractioneval_batch()for vectorized batch evaluation of multiple points simultaneously via numpy einsumeval_multi()for finite-difference derivatives (1st and 2nd order, including cross-derivatives)error_estimate()for approximate error estimation from Chebyshev coefficient coressave()/load()serialization with version compatibility checks (same pattern as other classes)tt_ranksandcompression_ratioproperties for inspecting the TT decomposition_maxvol()module-level function implementing the maximum-volume row selection algorithm_tt_cross()module-level function implementing TT-Cross with alternating left-right sweeps and maxvol pivot selection
error_estimate()method onChebyshevApproximation— estimates supremum-norm interpolation error from Chebyshev expansion coefficients via DCT-II, without needing the true function (Ruiz & Zeron 2021, Section 3.4)error_estimate()method onChebyshevSlider— returns sum of per-slide error estimates_chebyshev_coefficients_1d()static method for computing Chebyshev expansion coefficients from values at Type I nodes- Error estimate shown in
__str__()output for both classes when built - New documentation page: Error Estimation (mathematical background, usage examples)
- 12 new tests for error estimation (8 for barycentric, 4 for slider)
compare_error_estimation.py— local benchmarking script comparing PyChebyshev vs MoCaX error estimates
fast_eval()— usevectorized_eval()instead, which is ~150x faster via BLAS GEMV[jit]optional dependency (Numba) — no longer needed since BLAS path outperforms JIT_jit.pymodule — will be removed in a future version
- README, docs, and CLAUDE.md updated to reflect BLAS GEMV as the primary fast path
- Removed Numba JIT installation instructions from all documentation
- Removed
numbafrom dev dependencies
save()andload()methods onChebyshevApproximationandChebyshevSliderfor persisting built interpolants to disk (pickle-based)__repr__and__str__methods on both classes for human-readable printing- Version compatibility check on load with warning for mismatched versions
- New documentation page: Saving & Loading Interpolants
- 21 new tests for serialization and printing
ChebyshevSliderclass for high-dimensional approximation via the Sliding Technique (Ch. 7, Ruiz & Zeron 2021)- Additive decomposition into low-dimensional slides around a pivot point
- Analytical derivatives per slide with correct cross-group mixed partial handling (returns 0)
- Documentation page for the Sliding Technique with usage examples and limitations
- 24 new tests for slider (additive, coupled, 5D, cross-group derivatives, validation)
- README updated: repositioned as a library (was standalone educational script)
- Getting Started section now uses
pip install pychebyshevwith code examples - Fixed repo URL in docs (
maxjingwezhang→0xC000005)
- README images now load on PyPI (use absolute GitHub URLs instead of relative paths)
ChebyshevApproximationclass for multi-dimensional Chebyshev tensor interpolation- Barycentric interpolation with full weight pre-computation
- Analytical derivatives via spectral differentiation matrices (1st and 2nd order)
vectorized_eval()using BLAS matrix-vector products (~0.065 ms/query)vectorized_eval_multi()with shared barycentric weights (~0.29 ms for price + 5 Greeks)fast_eval()with Numba JIT compilation (optional)- Node coincidence handling for all evaluation methods
- MkDocs + Material documentation with KaTeX math rendering
- pytest test suite (22 tests covering 3D/5D accuracy and method consistency)
- GitHub Actions CI/CD for testing and PyPI publishing