#8389: Sage eats all memory trying to evaluate MatrixSpace(QQ, 2)['x']
---------------------------+------------------------------------------------
   Reporter:  mmezzarobba  |       Owner:  AlexGhitza
       Type:  defect       |      Status:  new       
   Priority:  major        |   Milestone:  sage-4.6.2
  Component:  algebra      |    Keywords:            
     Author:               |    Upstream:  N/A       
   Reviewer:               |      Merged:            
Work_issues:               |  
---------------------------+------------------------------------------------

Comment(by davidloeffler):

 The problem's not in the polynomial ring constructor per se:
 {{{
 sage: R = PolynomialRing(MatrixSpace(QQ, 2),'x'); R
 Univariate Polynomial Ring in x over Full MatrixSpace of 2 by 2 dense
 matrices over Rational Field
 }}}
 Almost nothing works with R because printing of elements is broken, but at
 least you can construct it!

 The problem reported above lies in the {{{R['x']}}} syntax; for some
 reason, the "list" method of the matrix ring is getting called, and this
 (of course) never terminates. If you try this with a matrix space over a
 *finite* ring, the list call succeeds, and it tries to get the element of
 index 'x' -- which fails because the string 'x' isn't an integer:
 {{{
 sage: MatrixSpace(GF(3), 2)['x']
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)

 /home/masiao/<ipython console> in <module>()

 /storage/masiao/sage-4.6.2.alpha1/local/lib/python2.6/site-
 packages/sage/structure/parent.so in
 sage.structure.parent.Parent.__getitem__ (sage/structure/parent.c:8072)()

 TypeError: list indices must be integers, not str
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8389#comment:2>
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