#3436: random_matrix() with prescribed density buggy
------------------------------+---------------------------------------------
   Reporter:  rpw             |       Owner:  was         
       Type:  defect          |      Status:  needs_review
   Priority:  major           |   Milestone:  sage-4.3.1  
  Component:  linear algebra  |    Keywords:              
     Author:  spancratz       |    Upstream:  N/A         
   Reviewer:                  |      Merged:              
Work_issues:                  |  
------------------------------+---------------------------------------------

Comment(by spancratz):

 Here are the timings for the code that Tom wrote, which gets rid of the
 "ugly" code I wrote for generating the random matrices over cyclotomic
 fields and instead uses the generic code of random elements in cyclotomic
 fields (implemented by two of the patches above):

 {{{
 sage: MS = MatrixSpace(CyclotomicField(10), 100, 100)
 sage: time A = MS.random_element()
 CPU times: user 27.11 s, sys: 0.35 s, total: 27.46 s
 Wall time: 27.46 s
 }}}

 I suspect that the slowness of this code is largely due to the fact that
 for every random element of the cyclotomic field, two conversions take
 place.  One of a random list of rationals into the polynomial ring, and
 then another of that polynomial into the polynomial quotient ring.

 I don't think there is much we can do about this at the moment.  Thus, I
 propose that we should apply all of the patches on this ticket apart from
 ``trac3436-tb.patch``.  I'll flatten them a little, (1) main patch (2)
 ``random_element`` in polynomial rings, polynomial quotient rings, and
 number fields.  Hopefully, this will then pass all doctests and we'll be
 done.

 Any comments?

 PS: Of course, I'll include the fixed doctests (64-bit difference) from
 Tom's patch.

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