Skip to content

docs: design of the dense linear-algebra foundation (scipy.linalg side) - #92

Merged
tannevaled merged 1 commit into
mainfrom
docs/design-linalg
Nov 4, 2026
Merged

tannevaled merged 1 commit into
mainfrom
docs/design-linalg

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Design only, no code: docs/design-linalg.md, the plan for the scipy.linalg functions that docs/coverage.md slices 6-8 and the go-scikit roadmap ("Shared foundations", PLAN.md item 10) list as missing.

  • Sources opened: SciPy v1.18.1 _matfuncs*.py, src/_matfuncs_expm.c, src/_matfuncs_sqrtm.c, _decomp*.py, _basic.py, the C++ batched LU/QR/Cholesky headers, special/_orthogonal.py, sparse/linalg/_onenormest.py; Reference-LAPACK v3.12.1 dgees, dhseqr, iparmq, ilaenv, dtrsen, dtrsyl, dgges, dtgsen, dstevd, dsbevd, dstebz, dstein, dstemr, dgeqp3, dlapy2; Al-Mohy and Higham 2009 (expm) and 2011/2012 (logm); Deadman, Higham and Ralha (title page only). What was not obtained is listed in section 1.
  • Exactness: integers and structure exact against the wheel; values bit-exact against SciPy and NumPy built against Reference-LAPACK's BLAS and LAPACK (-ffp-contract=off, correctly rounded libm); tolerance against the wheel. Complex scalar functions wait for go-numerics/special cmplx.
  • Found while reading: in SciPy 1.18.1 the real expm adds A^6 to U when m = 13 (beta = 1 at _matfuncs_expm.c:1294, 1513; the complex variants use beta = 0). Measured against mpmath, the real path is about 100x less accurate than the complex one (2.6e-12 against 2.4e-14 at 30*I + 0.1*randn(5)). The port fixes it as a documented departure. Not yet reported upstream.

🤖 Generated with Claude Code

docs/design-linalg.md: exports of existing internals (lu, cho_*, banded and
triangular solves, pivoted QR, hessenberg, schur, balance), matrix functions
(expm, logm, sqrtm, fractional power, funm, signm, Frechet), tridiagonal and
banded eigensolvers, QZ/ordqz, and the MATLAB delta. Records which
Reference-LAPACK routines SciPy 1.18.1 reaches for each, the exactness tiers
(integers vs the wheel, values bit-exact vs a reference-BLAS C oracle,
tolerance vs the wheel), validation, performance, security, file layout and
21 ordered tasks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit a1745f5 into main Nov 4, 2026
12 checks passed
@tannevaled
tannevaled deleted the docs/design-linalg branch November 4, 2026 21:30
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.

1 participant