Registry / ai-ml / sparsediffpy

sparsediffpy

JSON →
library0.4.0pypypiunverified

Python bindings for SparseDiffEngine, an algorithmic differentiation library that computes sparse Jacobians and Hessians efficiently using graph coloring methods. Current version 0.4.0, requires Python >=3.11. Active development with monthly releases.

pip install sparsediffpy
INSTALL
IMPORT
SIG · SPARSEDIFFPY
S
sparsediffpy
ai-mlpythonv0.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Jacobian
✓ from sparsediffpy import Jacobian
✗ from sparsediff import Jacobian

Compute sparse Jacobian of a 2D function at a point

from sparsediff import Jacobian import numpy as np def f(x): return np.array([x[0]**2 + x[1]**2, x[0]*x[1]]) J = Jacobian(f, np.array([1.0, 2.0])) print(J.compute())
Debug
Known issues
gotchaImport path: use `from sparsediff import ...`, NOT `import sparsediffpy`. The package name on PyPI is sparsediffpy, but the importable module is sparsediff.
fix
Use `from sparsediff import Jacobian, Hessian`
affects: all
breakingAPI changes in 0.4.0: `Jacobian.compute()` now returns a dense numpy array by default; use `sparse=True` to get a scipy sparse matrix.
fix
Call `compute(sparse=False)` for old behavior or adjust code accordingly.
affects: >=0.4.0
gotchaRequires Python >=3.11; installing on older Python versions will fail silently or produce import errors.
fix
Ensure Python 3.11 or newer is used.
affects: all
deprecatedThe `seed_matrix` argument in Jacobian constructor is deprecated since 0.3.0 and will be removed in 0.5.0.
fix
Use the new `coloring` parameter instead of `seed_matrix`.
affects: >=0.3.0,<0.5.0
Upgrade
Version history
0.4.0latest on PyPI · released May 22, 2026
Audit
Dependencies
numpyrequiredcore dependency for array operations
Agent activity
14 hits · last 30 days
node
12
OpenAI (training)
1
Resources

No resource links recorded.

sparsediffpy — pip install sparsediffpy · libregistry