#13196: GL(n, GF(q)).random_element() is way too slow for what it does
----------------------------+-----------------------------------------------
Reporter: Bouillaguet | Owner: joyner
Type: enhancement | Status: new
Priority: trivial | Milestone: sage-5.2
Component: group theory | Keywords: matrix group, finite field,
random element
Work issues: | Report Upstream: N/A
Reviewers: | Authors: Charles Bouillaguet
Merged in: | Dependencies:
Stopgaps: |
----------------------------+-----------------------------------------------
GL(32, GF(2)).random_element() takes more than 10s, which is ridiculous.
Proposed solution : use simple rejection sampling (i.e. generate a random
matrix, check if it invertible, if not try again). The result is uniformly
distributed amongst invertible matrices.
Before patch:
{{{
sage: %time GL(64, GF(2)).random_element()
5 loops, best of 3: 15.5 s per loop
}}}
After patch :
{{{
sage: %timeit GL(64, GF(2)).random_element()
625 loops, best of 3: 929 µs per loop
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13196>
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.