#10483: Deprecate the misuse of symbolic variables as polynomial variable
--------------------------------+-------------------------------------------
   Reporter:  SimonKing         |       Owner:  AlexGhitza                      
        
       Type:  defect            |      Status:  new                             
        
   Priority:  major             |   Milestone:  sage-4.6.1                      
        
  Component:  basic arithmetic  |    Keywords:  deprecation symbolic polynomial 
variable
     Author:                    |    Upstream:  N/A                             
        
   Reviewer:                    |      Merged:                                  
        
Work_issues:                    |  
--------------------------------+-------------------------------------------
 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.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10483>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to