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

find integral solutions to matrix equations over PIDs #38019

Conversation

yyyyx4
Copy link
Member

@yyyyx4 yyyyx4 commented May 17, 2024

Even for matrices explicitly defined over ℤ, the .solve_left() and .solve_right() methods may return solutions over ℚ. In this patch, we add an optional flag integral= to these methods which forces the computation of an integral solution if one exists (and throws an exception otherwise).

The algorithm is completely standard, using the (pre-existing) .smith_form() method, but so far users had to implement the rest of the solution method on their own each time.

Computing integral solutions to underdetermined systems is a common task when working with lattices.

Copy link

github-actions bot commented May 17, 2024

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

@yyyyx4 yyyyx4 force-pushed the public/solve_integer_linear_systems_using_smith_form branch from 03779b6 to f158c4b Compare May 17, 2024 19:19
@yyyyx4
Copy link
Member Author

yyyyx4 commented May 17, 2024

Thanks, all done.

@mkoeppe
Copy link
Contributor

mkoeppe commented May 17, 2024

Of course, the same can be done with a weaker normal form, the Hermite form. matrix_integer_dense has many algorithm options for that one...

@yyyyx4
Copy link
Member Author

yyyyx4 commented Jun 11, 2024

That's a good suggestion, thanks. I gave it a try.

Copy link
Contributor

@mkoeppe mkoeppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

vbraun pushed a commit to vbraun/sage that referenced this pull request Jun 16, 2024
    
Even for matrices explicitly defined over ℤ, the `.solve_left()` and
`.solve_right()` methods may return solutions over ℚ. In this patch, we
add an optional flag `integral=` to these methods which forces the
computation of an integral solution if one exists (and throws an
exception otherwise).

The algorithm is completely standard, using the (pre-existing)
`.smith_form()` method, but so far users had to implement the rest of
the solution method on their own each time.

Computing integral solutions to underdetermined systems is a common task
when working with lattices.
    
URL: sagemath#38019
Reported by: Lorenz Panny
Reviewer(s): Matthias Köppe
vbraun pushed a commit to vbraun/sage that referenced this pull request Jun 16, 2024
    
Even for matrices explicitly defined over ℤ, the `.solve_left()` and
`.solve_right()` methods may return solutions over ℚ. In this patch, we
add an optional flag `integral=` to these methods which forces the
computation of an integral solution if one exists (and throws an
exception otherwise).

The algorithm is completely standard, using the (pre-existing)
`.smith_form()` method, but so far users had to implement the rest of
the solution method on their own each time.

Computing integral solutions to underdetermined systems is a common task
when working with lattices.
    
URL: sagemath#38019
Reported by: Lorenz Panny
Reviewer(s): Matthias Köppe
@vbraun vbraun merged commit d9f2a63 into sagemath:develop Jun 22, 2024
15 of 18 checks passed
@mkoeppe mkoeppe added this to the sage-10.4 milestone Jul 8, 2024
@yyyyx4 yyyyx4 deleted the public/solve_integer_linear_systems_using_smith_form branch July 9, 2024 13:09
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.

3 participants