-
-
Notifications
You must be signed in to change notification settings - Fork 649
Refactor O() and fix O() for lazy power series ring #39436
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
Conversation
Documentation preview for this PR (built with commit 61023a1; changes) is ready! 🎉 |
Looks like genuine bug in doctest.
The problem is the extension is ramified (Eisenstein), so But then,
|
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.
LGTM except I don't know the math enough to verify the padic change. @xcaruso Can you comment on that doctest?
A (more conservative) alternative is to implement a check in implementation of But I really can't think of any case where |
I'll take a look, though probably won't have time for a couple days. |
I decide to just revert the change and special-case fixed modulus p-adic to always return 0. So the behavior of the doctest remains the same. (I have no idea why |
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.
Sorry for the very long delay in finalizing this review. LGTM now. Thank you.
Maybe worth noting that when (I think someone (you?) pointed it out to me somewhere) |
Fixes
O(x)
forLazyPowerSeriesRing
. (previously it doesn't work)Also refactor it to check less special cases.
Use
.perfect_power()
instead offactor()
to avoid wasting time if a large composite is passed.Note:
.O()
and.add_bigoh()
is the same for many rings, but notAsymptoticRing
.In particular
x.O(5)
meansx.add_bigoh(5)
orx+O(x^5)
x.O()
meansO(x)
Personally I think the latter makes more sense, but this is part of public API so we will have to live with this inconsistency. (The former does not make sense for
AsymptoticRing
even)Thus the explicit check is needed. (
add_bigoh
is not implemented forAsymptoticRing
)I don't know why it's desirable to block
O(2*x^2)
for polynomial ring, but I'll leave the behavior unchanged just in case.📝 Checklist
⌛ Dependencies