-
-
Notifications
You must be signed in to change notification settings - Fork 598
Implement conversion from laurent series to rational function field #39485
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 7471239; changes) is ready! 🎉 |
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.
Thank you. LGTM.
This is not perfect yet. Ideally it should R.<x> = QQ[]
T.<t> = R[[]]
f = 1 + (x + 1)*t + (x^2 + 2*x + 1)*t^2 + (x^3 + 3*x^2 + 3*x + 1)*t^3 + O(t^4) # belong to R[[t]], not Frac(R)[[t]]
Frac(Frac(R)[t])( f ) # error!
Frac(Frac(R)[t])( Frac(R)[[t]]( f ) ) # work We want the |
As in the title. I think this behavior makes sense because
QQ(RR(…))
currently uses.simplest_rational()
instead of like exact value (likex / 2^53
for some integerx
), so it makes sense for similar conversions to compute a good approximation too.I cannot prove that this round-trips, however.
Note that currently conversion from power series
QQ[[x]]
to polynomial ringQQ[x]
truncates, because of implementation detail this leads to conversion fromQQ[[x]]
toFrac(QQ[x])
also truncates. I think this is undesirable behavior because identical-looking elements inQQ[[x]]
versusFrac(QQ[[x]]) = LaurentSeriesRing(QQ, "x")
has different conversion behavior.Elements which are already Laurent polynomial are preserved.
Side note:
.one()
is faster because it's cachedMaybe this doesn't need to be explicitly written in the documentation (users trying to do the conversion will just see the result)
There exists also
:meth:`.PowerSeries_poly.pade`
which should probably be mentioned in the documentation.Reverse direction (that one is a morphism): #39365
Possible caveat:
It could be argued the latter would be simpler as
1/(x^31+x^30)
, but then that way gives higher denominator degree.📝 Checklist
⌛ Dependencies