-
-
Notifications
You must be signed in to change notification settings - Fork 532
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 option to use pari for small_roots #39243
base: develop
Are you sure you want to change the base?
Conversation
Hmm, it seems that the pari |
Actually this would be a breaking change: previously
Maybe rename the new that is, if the Another alternative I can think of is Worst case (if default to pari isn't better in all cases) you can try to do something such as (pseudocode) t = Timer(5, lambda: warning("looks like small_roots() is taking a long time, try using algorithm='pari'?")
B = B.LLL()
t.cancel() then the user still get notification to possibly change, but only if it's slow. |
Documentation preview for this PR (built with commit 0197b8f; changes) is ready! 🎉 |
I'll fix the Also, as the example suggests, pari is not only faster than Sage, but also stronger, but it errors sometimes. I don't think there's an objective "better", but maybe we should catch the |
If sage is likely to return |
@user202729 this is ready for review :) |
what is And why exactly is it random? (isn't the root unique and it's sort of guaranteed pari can find it anyway? Of course the flip side is sage's algorithm may happen to improve in the future for some reason, but in that case at least remove the |
@user202729 I think the time the test took was random and might time out randomly, but I can't replicate that behaviour now 😓 I will just remove the tag entirely. The output is not random anyways, since I set the seed above. |
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.
looks good to me.
I wonder if
The implementation of this algorithm follows Alexander May’s PhD thesis referenced below.
is still true. (not that it matters much.)
the timeout might as well be one of the random timeout issues that happen once in a while (which as far as I can tell nobody knows why)
Oh, is there a timeout in any CI? I don't see any errors 🤔 |
Use
pari.zncoppersmith
as an alternative Coppersmith implementation forsmall_roots
.I decided to make pari the default because in my testings (in many practical cases, not really "edge cases") it outperforms Sage's default ("basic") implementation, both in speed and strength - see the added test for example.