-
-
Notifications
You must be signed in to change notification settings - Fork 510
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
Deprecate the misuse of symbolic variables as polynomial variable #10483
Comments
Author: Simon King |
comment:1
Attachment: 10483deprecate_symbolics_in_polynomial_rings.patch.gz Now the patch is attached. By the way: It also adds some doctests... |
comment:2
Just a question - are the changes in symbolics because before the variables might or might not have been strings? Also, is there an easy way to show what the generator of |
comment:3
Replying to @kcrisman:
As much as I know, the changes that I did in symbolics are indeed "replace a variable
I am not quite sure what you mean. By "remark", you probably mean
So, you suggest to write something like this:
I am not so convinced that the above text is good. Do you have a better suggesion? |
Reviewer: Karl-Dieter Crisman |
comment:4
I'm just saying that the "of course is not the case" is not at all "of course" to me. Current behavior:
So unless you think to do the last thing, that is pretty confusing - they have identical representation methods. Which is of course why you want to change this, and introduce the deprecation. So maybe you could say
Does that make any sense? |
comment:5
Replying to @kcrisman:
Yes, your formulation sounds much better than mine! Could you make a reviewer patch, changing the formulation? Best regards, Simon |
comment:6
Replying to @simon-king-jena:
Umm... that might not happen for a little while. I can do it, though. But if I'm going to give it a formal review, I have to make sure I check that all those changes involving making things strings really catch what they are supposed to, and I don't have time to do that right now, and then make the reviewer patch, and I am slow on such things... sorry. Also, I seem to recall there being some discussion about this on sage-devel. It's enough of a change (particularly since there are doctests which use the old one) that it could inconvenience some heavy users to see the deprecation messages, so if you have a link to that discussion I'd be interested in reading through it. |
comment:7
For reference, here is the sage-devel discussion. Not that much noise, thankfully. |
comment:8
Upon further reflection, I think that one would have to change a lot more of the doctests where
I don't think we want to actually prohibit this - x is so conventional - but the doctests should all definitely be changed so that some variable other than the one default variable actually pre-defined by Sage is used with polynomial rings! And we might want to put more warnings about this in the polynomial ring generator docs anyway. Not to mention the tutorial :) So putting 'needs info' until we think about what the best course of action is. But I don't want to just change these doctests, because it hides the real ambiguity, since 'x' is predefined as a variable when Sage initializes - which it should. |
comment:9
--bump-- Any new info in the last 5 months? |
comment:11
Pardon my naivete, why not recreate the symbol as ring element (and discard the symbol) when the user, by using it in a polynomial context, expects it to behave as one? |
comment:12
Replying to @rwst:
The following two invocations cannot be distinguished by the code implementing polynomial ring constructions:
Hopefully you'll agree that in the second case there is no justification to try and reach into the global scope to rebind python names that happen to print as the corresponding strings But thanks for bumping this ticket. Can we merge it? |
comment:13
Like I said above (3 years ago? wow), it would be best to think about making the default examples for polynomial rings not use x, since that is indeed already defined system-wide, and changing the examples to use the string won't help the confusion. But I have no objection to the change in principle, just the potential for continuing confusion. |
comment:14
I also agree with the patch in principle, except I would use |
This comment has been minimized.
This comment has been minimized.
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:108
Since the deprecation has now moved to |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
New commits:
|
comment:111
I'm going to leave this ticket be for now. So, if other people want to fix things, please go ahead. |
comment:113
Setting new milestone based on a cursory review of ticket status, priority, and last modification date. |
comment:114
Setting a new milestone for this ticket based on a cursory review. |
<!-- Please provide a concise, informative and self-explanatory title. --> <!-- Don't put issue numbers in the title. Put it in the Description below. --> <!-- For example, instead of "Fixes #12345", use "Add a new method to multiply two integers" --> ### 📚 Description <!-- Describe your changes here in detail. --> <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes #12345". --> - Fixes #32721 - See also: #10483 <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. It should be `[x]` not `[x ]`. --> - [x] The title is concise, informative, and self-explanatory. - [ ] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #35648 Reported by: Matthias Köppe Reviewer(s): Frédéric Chapoton
Relatively often on sage-support, users run into a problem since they mix symbolics and polynomials. Typically, they do
and expect that
z
is the generator ofP
- which is of coursewrong and will soon mean trouble.
I find even worse that one can do
since the variable names are obtained from the string representation of the given objects.
It should be clear that the preferred way of constructing a polynomial (or quotient) ring together with its generators is
Hence, it is quite amazing that in the documentation one occasionally finds the "wrong" usage
I suggest to deprecate the possibility of providing the variable names by anything but strings (potentially plus an integer, like
PolynomialRing(QQ,'x',5)
).With my patch, one has
See also #13187 where the problem of this ticket had the wrong solution (allowing for other types than string).
Depends on #23337
Depends on #23338
Depends on #23343
Depends on #23377
Depends on #23638
Depends on #23640
Component: basic arithmetic
Keywords: deprecation symbolic polynomial variable
Author: Simon King, Ralf Stephan, Jeroen Demeyer
Branch/Commit: public/10483-4 @
938beb0
Reviewer: Karl-Dieter Crisman, Jeroen Demeyer
Issue created by migration from https://trac.sagemath.org/ticket/10483
The text was updated successfully, but these errors were encountered: