id summary reporter owner description type status priority milestone component resolution keywords cc merged author reviewer upstream work_issues branch commit dependencies stopgaps
10483 Deprecate the misuse of symbolic variables as polynomial variable SimonKing AlexGhitza "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. = 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 .
In an interactive session, you should use a definition of the form 'R.=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 .
In an interactive session, you should use a definition of the form 'R.=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 .
In an interactive session, you should use a definition of the form 'R.=QQ[]'.
#!/usr/bin/env python
Multivariate Polynomial Ring in x, Gap, Singular over Rational Field
}}}
See also #13187 where the problem of this ticket had the wrong solution (allowing for other types than string)." defect needs_work major sage-8.0 basic arithmetic deprecation symbolic polynomial variable Simon King, Ralf Stephan, Jeroen Demeyer Karl-Dieter Crisman, Jeroen Demeyer N/A public/10483-4 938beb01e0dd296790dc2748f99f0e5a0ed4ce26 #23337, #23338, #23343, #23377, #23638, #23640