-
-
Notifications
You must be signed in to change notification settings - Fork 535
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
Power series composition messes up precision #3979
Comments
comment:1
A closely related issue is #5075. |
comment:3
Attachment: trac_3979_power_series_substitution.patch.gz In the attached patch I have completely rewritten In order to make the
If we interpret
In the course of checking the power series code, a minor mistake in the polynomial code has been found and corrected. A doctest in I have also deleted the doctest in
|
Author: Francis Clarke |
comment:5
The patch looks reasonable on its own. However, changing the call syntax for power series generates quite a number of doctest failures elsewhere, by triggering the error message
Here are the examples I found in the rings and schemes directories; there may be more elsewhere that I didn't find. (This used 4.7.1.rc1, but I don't think the version much matters.)
This patch can't receive a positive review with all these broken doctests. The best thing would be to fix them all now, but if that is infeasible, I would propose the following.
|
comment:6
Replying to @kedlaya: Yes, I'm sorry to have missed those failures. I've been able to fix most of them. The code in I'll get back to this in a couple of weeks. |
Apply only this file |
comment:7
Attachment: trac_3979_power_series_substitution_rev1.patch.gz I have attached a revised patch. All the previous failures have been dealt with. Some changes were essentially trivial, but more major were:
|
This comment has been minimized.
This comment has been minimized.
Reviewer: Kiran Kedlaya, Luis Felipe Tabera Alonso |
comment:8
Some problems I have found This should work
This should raise an error:
You cannot substitute x by 1/x on a power series unless it is a Laurent polynomial. Suggestions, comments: On file laurent_series_ring_element.pyx @446 def laurentpolynomial(... Improve the documentation. By what is written it seems that the output should be a Laurent polynomial but the method actually returns a Laurent power series. @1141 @1165 raise ValueError, "must not specify %s keyword and positional argument" % name Add a doctest to the On file multi_power_series_ring @964,989 improve documentation, not clear if the input can be polynomials, powerseries, powerseries + bigoh or in which ring is the result. If we can use big_Oh in the input etc. Maybe for another ticket. On file local_generic_element.pyx @140 I would write: Returns self up to reduced precision On file polynomial_element.pyx @461-467 doctest should go in the TESTS section. @567 raise ValueError, "must not specify %s keyword and positional argument" % name On file power_series_mpoly @74 Add documentation and a valid example to the On file power_series_poly @290 raise ValueError, "must not specify %s keyword and positional argument" % name @936 This is a bug and should be fixed. This is a regression since this works without the patch (except for the incorrect precision). On file scheme.py @178 temp2 = temp.exp().change_ring(ZZ) Is there a reason you want a powerseries in ZZ instead of QQ? |
comment:16
Attachment: trac_3979_power_series_substitution_rev3.patch.gz Replying to @fchapoton:
I've attached new patch. I hope it can be reviewed before this has to be done again. |
comment:17
Apply only trac_3979_power_series_substitution_rev3.patch |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:20
Apply only trac_3979_power_series_substitution_rev4.patch |
comment:21
I would like to see, when possible, a more specific error instead of
In particular, when this is because of negative valuation, one should say it. |
apply after trac_3979_power_series_substitution_rev4.patch |
This comment has been minimized.
This comment has been minimized.
comment:22
Attachment: trac_3979_power_series_substitution_rev4_extra.patch.gz Replying to @fchapoton:
A good point. The new patch (to be applied after trac_3979_power_series_substitution_rev4.patch) gives a more explicit error message. |
comment:23
This looks good to me. The patches applies smoothly on 5.4beta1. All tests pass. This ticket solves some embarassing problems and is much wanted. Positive review ! |
This comment has been minimized.
This comment has been minimized.
Changed reviewer from Kiran Kedlaya, Luis Felipe Tabera Alonso to Kiran Kedlaya, Luis Felipe Tabera Alonso, Frédéric Chapoton |
comment:25
The bot is back and is unhappy because the patch removes one test in rings/power_series_mpoly.pyx This should be easy to correct, if really required to close the ticket. |
comment:26
Replying to @fchapoton:
As I said in July last year: I have also deleted the doctest in
And I explained this more fully a year ago: The reason I removed rather than corrected the doctest in
However I didn't have the confidence to delete it myself, and add other issues to an already complicated patch. Adding documentation to this function would be hard to do since the whole file is so poorly documented that I can't understand what it's for. I have now understood how to create an element of the relevant type (something that isn't done anywhere else, as far as I can see):
The final answers are wrong (they shouldn't have infinite precision), inconsistent (the first is a polynomial, the second a power series), and the syntax is non-standard. Compare
Of course However, I have made a supplementary patch which reinserts into |
Apply after trac_3979_power_series_substitution_rev4_extra.patch |
comment:27
Attachment: trac_3979_power_series_substitution_rev4_supplementary.patch.gz |
This comment has been minimized.
This comment has been minimized.
Apply only this patch |
comment:28
Attachment: trac_3979_power_series_substitution_rev5.patch.gz The patchbot tried (and failed) to apply only patches 2 and 3 out of three So I have merged them all into one patch. Hope this works. |
This comment has been minimized.
This comment has been minimized.
Merged: sage-5.4.rc0 |
Changed stopgaps from 12783 to #12783 |
The composition of two power series is sometimes returned with the wrong precision. A trivial example:
where the return value should have precision 4 rather than infinity. A more nontrivial example:
where the return value should have precision 8 instead of 10.
Apply
CC: @fchapoton
Component: algebra
Keywords: power series, composition, precision
Stopgaps: #12783
Author: Francis Clarke
Reviewer: Kiran Kedlaya, Luis Felipe Tabera Alonso, Frédéric Chapoton
Merged: sage-5.4.rc0
Issue created by migration from https://trac.sagemath.org/ticket/3979
The text was updated successfully, but these errors were encountered: