#7989: Minpoly doesn't work for all matrices
------------------------------+---------------------------------------------
   Reporter:  jason           |          Owner:  was        
       Type:  defect          |         Status:  needs_work 
   Priority:  major           |      Milestone:  sage-4.7.1 
  Component:  linear algebra  |       Keywords:             
Work_issues:                  |       Upstream:  N/A        
   Reviewer:                  |         Author:  Jason Grout
     Merged:                  |   Dependencies:             
------------------------------+---------------------------------------------

Comment(by was):

 This is a great patch.   I can't believe this has got ignored for the last
 1.5 years.

 Regarding what needs to be fixed, the test failure you claim for
 matrix_integer_2x2 is:
 {{{

 deep:sage wstein$ sage -t matrix/matrix_integer_2x2.pyx
 sage -t  "matrix/matrix_integer_2x2.pyx"
 **********************************************************************
 File "/Users/wstein/sage/install/sage-4.7.1.rc0/devel/sage-
 main/sage/matrix/matrix_integer_2x2.pyx", line 101:
     sage: TestSuite(m).run()
 Expected nothing
 Got:
     Failure in _test_minpoly:
     Traceback (most recent call last):
       File "/Users/wstein/sage/install/current/local/lib/python/site-
 packages/sage/misc/sage_unittest.py", line 275, in run
         test_method(tester = tester)
       File "matrix2.pyx", line 1302, in
 sage.matrix.matrix2.Matrix._test_minpoly (sage/matrix/matrix2.c:8933)
       File "polynomial_element.pyx", line 358, in
 sage.rings.polynomial.polynomial_element.Polynomial.subs
 (sage/rings/polynomial/polynomial_element.c:5624)
       File "polynomial_element.pyx", line 557, in
 sage.rings.polynomial.polynomial_element.Polynomial.__call__
 (sage/rings/polynomial/polynomial_element.c:5819)
       File "polynomial_element.pyx", line 638, in
 sage.rings.polynomial.polynomial_element.Polynomial.__call__
 (sage/rings/polynomial/polynomial_element.c:7244)
       File "element.pyx", line 1302, in
 sage.structure.element.RingElement.__add__
 (sage/structure/element.c:11504)
       File "coerce.pyx", line 766, in
 sage.structure.coerce.CoercionModel_cache_maps.bin_op
 (sage/structure/coerce.c:7337)
     TypeError: unsupported operand parent(s) for '+': 'Space of 2x2
 integer matrices' and 'Integer Ring'
     ------------------------------------------------------------
     The following tests failed: _test_minpoly
 **********************************************************************
 1 items had failures:
    1 of   6 in __main__.example_7
 ***Test Failed*** 1 failures.
 For whitespace errors, see the file
 /Users/wstein/.sage//tmp/.doctest_matrix_integer_2x2.py
          [4.6 s]
 }}}

 This is because substitution isn't even implemented for that class:
 {{{
 sage: MS = sage.matrix.matrix_integer_2x2.MatrixSpace_ZZ_2x2()
 sage: a = MS([1,2,3,4])
 sage: a.minpoly()
 x^2 - 5*x - 2
 sage: a.minpoly()(a)
 ---------------------------------------------------------------------------
 TypeError
 }}}

 Also, if one adds this for minpoly, it would make sense to also add
 _test_charpoly.

  -- William

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