-
-
Notifications
You must be signed in to change notification settings - Fork 559
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
fix content of polynomials #16613
Comments
comment:2
The content of a polynomial is sometimes defined as the gcd of its coefficients, and sometimes as the ideal generated by the coefficients. In SageMath, we have inconsistencies between polynomial rings:
I propose to make all the implementations return a element of the base ring rather than an ideal. Rationale:
P.S.: I cc the author and reviewer of #12218 in which the generic |
comment:3
Addendum: One could also let the possibility of having the ideal, with one of the following two propositions. I am not sure this is useful.
|
comment:4
I'm okay with having a method |
comment:5
Replying to @kedlaya:
Of course, this is a difficulty... Well, I propose then to implement I'll work on a proposal and let you tell me what you think about it. |
comment:6
I am trying to provide some code for this. I'd like opinions on two points:
Remarks for the semantics for fields:Currently, there is a method
I guess that there should not be any opposition for
P.S.: I really would like that we reach some consensus on the semantics before including any code in order to limit as much as possible future backward incompatible changes! |
comment:7
It generally is best for the development workflow if individual tickets are as limited as possible. So I would vote in favor of creating a second ticket to deal with Regarding |
Changed keywords from none to polynomial, content |
This comment has been minimized.
This comment has been minimized.
Commit: |
Branch: u/bruno/content |
Changed author from Vincent Delecroix to Bruno Grenet |
comment:8
Based on answers on this ticket and on sage-devel, I've implemented the solution with two methods from sage.warnings import warn
warn("This method now returns the gcd of the coefficients of the input polynomial. Use content_ideal()` to get the ideal generated by the coefficients.") |
comment:9
The changes look fine to me. What do you think? |
Reviewer: Julian Rüth |
comment:11
Replying to @saraedum:
Do you mean that right now,
What do you think? |
comment:12
Replying to @bgrenet:
Yes.
That would certainly break existing code. It points you to the place where you have to fix it so it would be fine with me. I am not sure what our policy is here.
If we go for this we should remove that parameter completely after some time. I am also fine with this approach but I find it a bit weird to do deprecation by introducing something deprecated (the
I think the first option (do not change |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:26
failing doctests, see patchbot reports |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:28
Should be OK now (I'll watch the patchbot logs), I made a mistake during the merge. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:30
The implementation looks good to me. What is the deprecation strategy now? Do we want this to go in and have a followup ticket (to be merged in a year) to have content return an element? If so, there should be such a ticket and a comment in the code. Or do we want to change this without deprecation? We missed the 8.0 window, so I am slightly in favor of the two step change. |
Work Issues: followup ticket mentioned in source code |
Changed work issues from followup ticket mentioned in source code to followup ticket mentioned in source code, update ticket summary |
comment:32
In the docstring of
with an example. |
This comment has been minimized.
This comment has been minimized.
comment:34
Replying to @saraedum:
I was in favor of a direct change with the argument of "the sooner the better" but the result was endless discussions and the ticket waits for 3 years! So in order for this ridiculously simple issue to be fixed at some point, let's say we implement the two phase change. Replying to @slel: Now needs review (again!). |
comment:35
I think we should just change the behavior (hopefully in an early beta) and put a |
Changed branch from u/bruno/content to |
There is an inconsistency between several implementations of methods
content
for polynomials which either return the gcd of the coefficients or the ideal generated by the coefficients.To remove the inconsistency, we implement two distinct methods:
content
returns the gcd of the coefficients;content_ideal
returns the ideal generated by the coefficients.In a period of deprecation, for (most) univariate polynomial rings,
content
is a deprecated alias forcontent_ideal
. In the future,content
will be defined everywhere as described above.CC: @sagetrac-mkosters @loefflerd
Component: commutative algebra
Keywords: polynomial, content
Work Issues: followup ticket mentioned in source code, update ticket summary
Author: Bruno Grenet
Branch/Commit:
017adb6
Reviewer: Julian Rüth
Issue created by migration from https://trac.sagemath.org/ticket/16613
The text was updated successfully, but these errors were encountered: