Skip to content

Commit 721030b

Browse files
author
Release Manager
committed
gh-37324: Basis completion for matrices over univariate polynomials This PR (the fruit of discussions with @xcaruso during SageDays 125) introduces a new functionality for matrices over univariate polynomials: completing bases. A description of what this means is below: this is a direct copy-paste of the doc strip written for the function. Two algorithms are offered: the one which one might call "naive", based on Smith form computation (requiring also one of the unimodular transformations); the other one is based on an algorithm by Wei Zhou and George Labahn ([Proceedings of ISSAC, 2014, Unimodular completion of polynomial matrices](https://dl.acm.org/doi/10.1145/2608628.2608640)). The default has been put to the latter, which is faster in most circumstances, sometimes significantly (*). In fact, it does not exploit fast polynomial multiplication (it should, but does not in the current state of Sage), so it is the case that the Smith form variant is faster in a restricted range of matrices of small dimensions and medium-large degrees. If there is interest in efficiency of this computation, one could work out some thresholds to switch between the two algorithms; but a much more impactful move would be to incorporate fast polynomial arithmetic in approximant bases and kernel bases, which would dramatically speed up Zhou and Labahn's algorithm. (*) Measured, for example: speed-up x20 for completing a 20x40 matrix of degree 5, 10, 20, or 40; speed-up about x200 for completing a 40x80 matrix of degree 5 or 10. Here [basis_completion.zip](https://github.com/sagemath/sage/files/14272 879/basis_completion.zip) is an archive with one file with sage code to help if one wishes to run somewhat extensive tests as well as benchmarks, and two files showing the results of some benchmarks. ``` def basis_completion(self, row_wise=True, algorithm="approximant"): Return a Smith form-preserving nonsingular completion of a basis of this matrix: row-wise completing a row basis if ``row_wise`` is True; column-wise completing a column basis if it is False. For a more detailed description, consider the row-wise case (the column-wise case is the same up to matrix transposition). Let `A` be the input matrix, `m \times n` over univariate polynomials `\Bold{K}[x]`, for some field `\Bold{K}`, and let `r` be the rank of `A`, which is unknown a priori. This computes a matrix `C` of dimensions `(n-r) \times n` such that stacking both matrices one above the other, say `[[A],[C]]`, gives a matrix of maximal rank `n` and with the same nontrivial Smith factors as `A`. In particular, `C` has full row rank, and the rank of the input matrix may be recovered from the number of rows of `C`. As a consequence, if `B` is a basis of the module generated by the rows of `A` (for example `B = A` if `A` has full row rank), then `[[B],[C]]` is nonsingular, and its determinant is the product of the nonzero Smith factors of `A` up to multiplication by a nonzero element of `\Bold{K}`. In particular, for `A` with full row rank: if the rows `A` can be completed into a basis of `\Bold{K}[x]^{n}` (or equivalently, `A` has unimodular column bases, or also, if the rows of `A` generate all polynomial vectors in the rational row space of `A`), then `C` provides such a completion. In this case, `[[A],[C]]` is unimodular: it is invertible over `\Bold{K}[x]`, and `det([[A],[C]])` is a nonzero element of the base field `\Bold{K}`. ``` URL: #37324 Reported by: Vincent Neiger Reviewer(s): grhkm21, Vincent Neiger, Xavier Caruso
2 parents 0b38b3e + 864c245 commit 721030b

File tree

2 files changed

+574
-4
lines changed

2 files changed

+574
-4
lines changed

src/doc/en/reference/references/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6671,6 +6671,10 @@ REFERENCES:
66716671
*The CiliPadi Family of Lightweight Authenticated Encryption*
66726672
https://csrc.nist.gov/CSRC/media/Projects/Lightweight-Cryptography/documents/round-1/spec-doc/cilipadi-spec.pdf
66736673
6674+
.. [ZL2014] Wei Zhou and George Labahn. "Unimodular completion of polynomial
6675+
matrices". In Proceedings ISSAC 2014, pages 413-420. ACM, 2014.
6676+
:doi:`10.1145/2608628.2608640`
6677+
66746678
.. [ZZ2005] Hechun Zhang and R. B. Zhang.
66756679
*Dual canonical bases for the quantum special linear group
66766680
and invariant subalgebras*.

0 commit comments

Comments
 (0)