#10483: Deprecate the misuse of symbolic variables as polynomial variable
-------------------------------------+-------------------------------------
Reporter: SimonKing | Owner: AlexGhitza
Type: defect | Status: needs_work
Priority: major | Milestone: sage-6.4
Component: basic arithmetic | Resolution:
Keywords: deprecation | Merged in:
symbolic polynomial variable | Reviewers: Karl-Dieter Crisman,
Authors: Simon King, Ralf | Jeroen Demeyer
Stephan | Work issues:
Report Upstream: N/A | Commit:
Branch: public/10483-3 | 75e2a04227770247968a88f5fd9172d543710fba
Dependencies: #17406, #17407 | Stopgaps:
-------------------------------------+-------------------------------------
Description changed by rws:
Old description:
> Relatively often on sage-support, users run into a problem since they mix
> symbolics and polynomials. Typically, they do
> {{{
> sage: z = var('z')
> sage: P = QQ[z]
> }}}
> and expect that `z` is the generator of `P` - which is of course
> wrong and will soon mean trouble.
>
> I find even worse that one can do
> {{{
> sage: QQ[x,gap,singular]
> Multivariate Polynomial Ring in x, Gap, Singular over Rational Field
> }}}
> 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
> {{{
> sage: R.<x,y,z> = QQ[]
> }}}
>
> Hence, it is quite amazing that in the documentation one occasionally
> finds the "wrong" usage
> {{{
> sage: x,y,z = var('x y z')
> sage: P = QQ[x,y,z]
> }}}
>
> 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
> {{{
> sage: QQ[x,gap,singular]
> /mnt/local/king/SAGE/sage-4.6/local/bin/sage-ipython:1:
> DeprecationWarning: (Since Sage Version 4.6.1) Variable name 'x' should
> be a string, but we obtained <type
> 'sage.symbolic.expression.Expression'>.
> In an interactive session, you should use a definition of the form
> 'R.<x,y,z>=QQ[]'.
> #!/usr/bin/env python
> /mnt/local/king/SAGE/sage-4.6/local/bin/sage-ipython:1:
> DeprecationWarning: (Since Sage Version 4.6.1) Variable name 'Gap' should
> be a string, but we obtained <class 'sage.interfaces.gap.Gap'>.
> In an interactive session, you should use a definition of the form
> 'R.<x,y,z>=QQ[]'.
> #!/usr/bin/env python
> /mnt/local/king/SAGE/sage-4.6/local/bin/sage-ipython:1:
> DeprecationWarning: (Since Sage Version 4.6.1) Variable name 'Singular'
> should be a string, but we obtained <class
> 'sage.interfaces.singular.Singular'>.
> In an interactive session, you should use a definition of the form
> 'R.<x,y,z>=QQ[]'.
> #!/usr/bin/env python
> Multivariate Polynomial Ring in x, Gap, Singular over Rational Field
> }}}
>
> I am not sure what component this ticket belongs. I try basic arithmetic.
New description:
Relatively often on sage-support, users run into a problem since they mix
symbolics and polynomials. Typically, they do
{{{
sage: z = var('z')
sage: P = QQ[z]
}}}
and expect that `z` is the generator of `P` - which is of course
wrong and will soon mean trouble.
I find even worse that one can do
{{{
sage: QQ[x,gap,singular]
Multivariate Polynomial Ring in x, Gap, Singular over Rational Field
}}}
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
{{{
sage: R.<x,y,z> = QQ[]
}}}
Hence, it is quite amazing that in the documentation one occasionally
finds the "wrong" usage
{{{
sage: x,y,z = var('x y z')
sage: P = QQ[x,y,z]
}}}
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
{{{
sage: QQ[x,gap,singular]
/mnt/local/king/SAGE/sage-4.6/local/bin/sage-ipython:1:
DeprecationWarning: (Since Sage Version 4.6.1) Variable name 'x' should be
a string, but we obtained <type 'sage.symbolic.expression.Expression'>.
In an interactive session, you should use a definition of the form
'R.<x,y,z>=QQ[]'.
#!/usr/bin/env python
/mnt/local/king/SAGE/sage-4.6/local/bin/sage-ipython:1:
DeprecationWarning: (Since Sage Version 4.6.1) Variable name 'Gap' should
be a string, but we obtained <class 'sage.interfaces.gap.Gap'>.
In an interactive session, you should use a definition of the form
'R.<x,y,z>=QQ[]'.
#!/usr/bin/env python
/mnt/local/king/SAGE/sage-4.6/local/bin/sage-ipython:1:
DeprecationWarning: (Since Sage Version 4.6.1) Variable name 'Singular'
should be a string, but we obtained <class
'sage.interfaces.singular.Singular'>.
In an interactive session, you should use a definition of the form
'R.<x,y,z>=QQ[]'.
#!/usr/bin/env python
Multivariate Polynomial Ring in x, Gap, Singular over Rational Field
}}}
I am not sure what component this ticket belongs. I try basic arithmetic.
See also #13187 where the problem of this ticket had the wrong solution
(allowing for other types than string).
--
--
Ticket URL: <http://trac.sagemath.org/ticket/10483#comment:45>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.