Skip to content

refactor(core): use SymPy for plugin matrix algebra - #802

Merged
morluto merged 1 commit into
mainfrom
agent/use-sympy-matrix-plugin
Aug 8, 2026
Merged

refactor(core): use SymPy for plugin matrix algebra#802
morluto merged 1 commit into
mainfrom
agent/use-sympy-matrix-plugin

Conversation

@morluto

@morluto morluto commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Fixes #706 and #699.

Change

Replace the matrix reference plugin’s handwritten Fraction Gaussian elimination and row-echelon routines with narrow adapters to SymPy’s maintained exact Matrix.det() and Matrix.nullspace() operations. The plugin continues to expose standard-library Fraction values at its wire boundary.

The adapter explicitly converts SymPy numerators and denominators before constructing each Fraction, preserving exact rational output without relying on third-party numeric-conversion behavior. Empty-matrix behavior is retained.

Scope

This intentionally leaves the certified-SNF and finite-field matrix code unchanged: their algorithms have different domain and certificate requirements.

Validation

  • make test-component TESTS=tests/component/plugins/test_matrix_plugin.py — 14 passed
  • uv run ruff check src/jacobian/plugins/matrices.py tests/component/plugins/test_matrix_plugin.py — passed
  • uv run mypy src/jacobian/plugins/matrices.py — passed

@morluto
morluto marked this pull request as ready for review August 8, 2026 04:34
@cursor

cursor Bot commented Aug 8, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@morluto
morluto merged commit bbc69f2 into main Aug 8, 2026
39 checks passed
@morluto
morluto deleted the agent/use-sympy-matrix-plugin branch August 8, 2026 04:34
@morluto morluto changed the title Use SymPy for plugin matrix algebra refactor(core): use SymPy for plugin matrix algebra Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Tech debt]: Replace hand-rolled matrix algebra in plugin matrix reference implementation

1 participant