#11544: Viewing matrices of algebraic numbers can take a long time
------------------------------+---------------------------------------------
   Reporter:  rbeezer         |          Owner:  jason, was  
       Type:  defect          |         Status:  needs_review
   Priority:  major           |      Milestone:  sage-4.7.2  
  Component:  linear algebra  |       Keywords:              
Work_issues:                  |       Upstream:  N/A         
   Reviewer:                  |         Author:              
     Merged:                  |   Dependencies:              
------------------------------+---------------------------------------------
Changes (by rbeezer):

  * status:  new => needs_review


Old description:

> The following code leads to about a one minute hang for me (reproducibly
> in a fresh session).  Keshav Kini (via IRC) had the same experience.
>
> {{{
> sage: A = matrix(QQ, 4, 4, [1, 2, -2, 2, 1, 0, -1, -1, 0, -1, 1, 1, -1,
> 2, 1/2, 0])
> sage: e = A.eigenvalues()[3]
> sage: K = (A-e).kernel()
> sage: P = K.basis_matrix()
> sage: x = P.list()[3]
> sage: remap = {}
> sage: remap.has_key(x)
> }}}
>
> This behavior hangs the creation of a string version of a matrix.  If you
> comment-out {{{sage/matrix/matrix0.pyx}}} at lines 1695-1696, the problem
> goes away.  To see the effect, run the first four lines of the code above
> and then just print P, with and without the two lines mentioned.
>
> I have a workaround in mind that may solve the problem in many cases.
> Root issue is at #11543.

New description:

 The following code leads to about a one minute hang for me (reproducibly
 in a fresh session).  Keshav Kini (via IRC) had the same experience.

 {{{
 sage: A = matrix(QQ, 4, 4, [1, 2, -2, 2, 1, 0, -1, -1, 0, -1, 1, 1, -1, 2,
 1/2, 0])
 sage: e = A.eigenvalues()[3]
 sage: K = (A-e).kernel()
 sage: P = K.basis_matrix()
 sage: x = P.list()[3]
 sage: remap = {}
 sage: remap.has_key(x)
 }}}

 This behavior hangs the creation of a string version of a matrix.  If you
 comment-out {{{sage/matrix/matrix0.pyx}}} at lines 1695-1696, the problem
 goes away.  To see the effect, run the first four lines of the code above
 and then just print P, with and without the two lines mentioned.

 I have a workaround in mind that may solve the problem in many cases.
 Root issue is at #11543.

 '''Apply:'''
   1. [attachment:trac_11544-avoid-hash-of-matrix-entries.patch]

--

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