Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add minimal relation bases for univariate polynomial matrices #39516

Open
wants to merge 27 commits into
base: develop
Choose a base branch
from

Conversation

vneiger
Copy link
Contributor

@vneiger vneiger commented Feb 13, 2025

Fixes #23645

This covers:

The focus of this PR is on providing methods that are as versatile/general as possible (while keeping performance at a reasonable level).

With regards to #23645 , note that approximant bases had already been integrated in SageMath some years ago. Thus with this PR all types of relation bases mentioned in that issue are now covered.

@vneiger
Copy link
Contributor Author

vneiger commented Feb 13, 2025

Still to do: add interpolant bases, and the corresponding documentation and tests.

For reference: this is based directly on a minimal kernel basis computation, with suitable degree constraints to ensure that the sought relation basis appears as a submatrix of this kernel basis.

@vneiger vneiger requested a review from HugoPasse February 13, 2025 17:16
@vneiger vneiger added t: enhancement sd128 tickets of Sage Days 128 Le Teich labels Feb 13, 2025
Copy link

github-actions bot commented Feb 13, 2025

Documentation preview for this PR (built with commit 49b9758; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@vneiger vneiger marked this pull request as ready for review February 16, 2025 21:33
@vneiger
Copy link
Contributor Author

vneiger commented Feb 17, 2025

This is ready for review.

Note that approximant and interpolation bases could call relation bases with an input of some specific form. Yet having dedicated implementations does make a non-negligible difference in performance, see the timings below (ratios in columns rel/app and int/app):

shift leading to reduced form (weak Popov):
m	n	d	appbas	relbas	rel/app	intbas	relbas	rel/int
6	1	200	5.2e-03	8.7e-03	1.7e+00	7.0e-03	9.9e-03	1.4e+00
6	3	200	1.6e-02	5.4e-02	3.3e+00	2.7e-02	8.1e-02	3.0e+00
6	5	200	2.4e-02	1.5e-01	6.4e+00	5.7e-02	2.7e-01	4.8e+00
14	1	20	1.5e-03	2.2e-03	1.5e+00	1.7e-03	2.3e-03	1.4e+00
14	7	20	9.1e-03	4.7e-02	5.1e+00	1.4e-02	5.7e-02	4.0e+00
14	13	20	9.3e-03	1.7e-01	1.8e+01	3.2e-02	2.4e-01	7.7e+00

shift leading to lower triangular basis (close to HNF):
m	n	d	appbas	relbas	rel/app	intbas	relbas	rel/int
6	1	200	5.4e-03	1.6e-01	2.9e+01	8.2e-03	2.1e-01	2.5e+01
6	3	200	1.7e-02	5.9e-01	3.5e+01	3.7e-02	1.8e+00	4.8e+01
6	5	200	2.2e-02	1.2e+00	5.2e+01	8.5e-02	5.6e+00	6.5e+01
14	1	20	1.6e-03	1.0e-01	6.4e+01	1.6e-03	1.1e-01	7.1e+01
14	7	20	8.7e-03	9.5e-01	1.1e+02	1.6e-02	2.5e+00	1.5e+02
14	13	20	9.0e-03	2.3e+00	2.5e+02	4.3e-02	7.2e+00	1.7e+02

@HugoPasse
Copy link
Contributor

I saw in the reference manual that the methods minimal_kernel_basis and minimal_approximant_basis both have their counterparts is_minimal_kernel_basis and is_minimal_approximant_basis. Do you plan to impement equivalent methods for the suggested features minimal_relation_basis and minimal_interpolation_basis?

@vneiger
Copy link
Contributor Author

vneiger commented Feb 21, 2025

I saw in the reference manual that the methods minimal_kernel_basis and minimal_approximant_basis both have their counterparts is_minimal_kernel_basis and is_minimal_approximant_basis. Do you plan to impement equivalent methods for the suggested features minimal_relation_basis and minimal_interpolation_basis?

Thanks for the suggestion. Here are some thoughts on this question.

  • Concerning a relation basis P in general, say for a matrix F modulo a matrix M. Testing that P has the right weak Popov form is very cheap. Testing that P consists of relations is already less cheap (one matrix multiplication P F and one matrix division with remainder PF rem M; not clear to me how to do it faster deterministically). And finally, the worst part: for verifying that P indeed generates the module of relations, I'm not sure to see any (deterministic) method that would be faster than basically recomputing P. Well, any method that provides the degree of determinant of this module would directly yield a test, but same thing, not clear to me how to do this much more efficiently than by computing P. With all of this in mind, it seems that such a method would not bring much.

  • Concerning an interpolant basis P, say for a matrix F at points $a_{i,j}, 0 \le i < d_j, 0 \le j < n$. Testing weak Popov form remains easy. Testing that P consists of interpolants is somewhat easier than above: the matrix division with remainder is replaced by usual polynomial quo_rem's (or, one might use multipoint evaluation but that is not yet fast in SageMath, I think). However here, the generation test could become easier; at least that is the case when all points are pairwise distinct. I will think about it, to see if there is an "easy" test for more general points, in which case it could make sense to add is_minimal_interpolant_basis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Approximant bases and Relation bases for polynomial matrices
3 participants