-
-
Notifications
You must be signed in to change notification settings - Fork 655
Add flatter support #40274
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 flatter support #40274
Conversation
Documentation preview for this PR (built with commit dc5a22f; changes) is ready! 🎉 |
@@ -3097,6 +3101,16 @@ cdef class Matrix_integer_dense(Matrix_dense): | |||
[0 0 0] | |||
[0 0 0] | |||
|
|||
When ``algorithm='flatter'``, some matrices are not supported depends |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the sentence is broken. When
is a Germanism, too. You want something like
The ``algorithm='flatter'`` might not support matrices supported by other algorithms.
@@ -3024,6 +3024,10 @@ cdef class Matrix_integer_dense(Matrix_dense): | |||
|
|||
- ``'pari'`` -- pari's qflll | |||
|
|||
- ``'flatter'`` -- external executable ``flatter``, requires manual install (see caveats below). | |||
Note that sufficiently new version of ``pari`` also supports FLATTER algorithm, see |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please provide Pari version info where this appeared. Also, do you know if this already is available from cypari2
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- New recursive implementation of the qflll and qflllgram functions
using the FLATTER reduction algorithm of N. Heninger and K. Ryan.
from https://pari.math.u-bordeaux.fr/archives/pari-announce-24/msg00003.html
so, 2.17.0.
supposedly it's available
sage: pari.version()
(2, 17, 1)
but pari is still slower than flatter on my machine. Demo where LLL is used to compute (integral) kernel of a matrix:
m = random_matrix(ZZ, 25, 50, x=1, y=10^100)
assert m.rank() == 25
%time m.change_ring(QQ).right_kernel_matrix() # 2.5s
%time m.right_kernel_matrix() # 8s
%time m1 = (m.T*2^1200).augment(matrix.identity(50)).LLL(algorithm="pari") # 5s
assert m1[:25,:25]==0
%time m1 = (m.T*2^1200).augment(matrix.identity(50)).LLL(algorithm="flatter") # 3s (CPU time is small because time is spent in subprocess)
assert m1[:25,:25]==0
more:
%time m.right_kernel_matrix(algorithm='flint') # 6s
%time m.right_kernel_matrix(algorithm='pari') # unreasonably long
%time m.right_kernel_matrix(algorithm='padic') # 8.5s
%time m.change_ring(QQ).right_kernel_matrix(algorithm='flint') # 2.2s
%time m.change_ring(QQ).right_kernel_matrix(algorithm='padic') # 2.2s
if fp is not None or early_red or use_givens or transformation or eta is not None or use_siegel: | ||
raise TypeError("flatter does not support fp, early_red, use_givens, transformation, eta or use_siegel") | ||
if kwds: | ||
raise TypeError("flatter does not support additional keywords") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it be more consistent to just ignore kwds
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better practice to complain to the user about invalid data than to silently ignore them.
sagemathgh-40274: Add flatter support Supports calling external `flatter` executable for `LLL` algorithm. (If the user wants to use this it is necessary to install from source from https://github.com/keeganryan/flatter) ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#40274 Reported by: user202729 Reviewer(s): Dima Pasechnik, user202729
Supports calling external
flatter
executable forLLL
algorithm. (If the user wants to use this it is necessary to install from source from https://github.com/keeganryan/flatter)📝 Checklist
⌛ Dependencies