#18384: random_matrix with algorithm "subspaces" doesn't choose the rank 
correctly
--------------------------------------+------------------------
       Reporter:  ddrake              |        Owner:
           Type:  defect              |       Status:  new
       Priority:  major               |    Milestone:  sage-6.7
      Component:  linear algebra      |   Resolution:
       Keywords:  matrix random rank  |    Merged in:
        Authors:                      |    Reviewers:
Report Upstream:  N/A                 |  Work issues:
         Branch:                      |       Commit:
   Dependencies:                      |     Stopgaps:
--------------------------------------+------------------------
Description changed by ddrake:

Old description:

> Using Sage 6.5, when I do
> {{{
> random_matrix(QQ, 7,4, algorithm='subspaces')
> }}}
> almost always it says
> {{{
> Error in lines 1-1
> Traceback (most recent call last):
> File "/projects/e51fbbc4-453b-
> 4f00a470028a1136adeb/.sagemathcloud/sage_server.py", line 879, in execute
> exec compile(block+'\n', '', 'single') in namespace, locals
> File "", line 1, in <module>
> File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-
> packages/sage/matrix/constructor.py", line 1364, in random_matrix
> return random_subspaces_matrix(parent, *args, **kwds)
> File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-
> packages/sage/matrix/constructor.py", line 3583, in
> random_subspaces_matrix
> raise ValueError("rank cannot exceed the number of rows or columns.")
> ValueError: rank cannot exceed the number of rows or columns.
> }}}
> If I run that many times, it does produce a matrix -- perhaps 5-10% of
> the time.
>
> The documentation says it randomly generates the rank, but it does not
> seem smart enough to generate a rank that is possible for the given
> dimensions.

New description:

 Using Sage 6.5, when I do
 {{{
 random_matrix(QQ, 7,4, algorithm='subspaces')
 }}}
 almost always it says
 {{{
 Error in lines 1-1
 Traceback (most recent call last):
 File "/projects/e51fbbc4-453b-
 4f00a470028a1136adeb/.sagemathcloud/sage_server.py", line 879, in execute
 exec compile(block+'\n', '', 'single') in namespace, locals
 File "", line 1, in <module>
 File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-
 packages/sage/matrix/constructor.py", line 1364, in random_matrix
 return random_subspaces_matrix(parent, *args, **kwds)
 File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-
 packages/sage/matrix/constructor.py", line 3583, in
 random_subspaces_matrix
 raise ValueError("rank cannot exceed the number of rows or columns.")
 ValueError: rank cannot exceed the number of rows or columns.
 }}}
 If I run that many times, it does produce a matrix -- perhaps 5-10% of the
 time.

 The documentation says it randomly generates the rank, but it does not
 seem smart enough to generate a rank that is possible for the given
 dimensions.

 (If I specify the rank, the function does work as expected. But the
 documentation seems to indicate that you can omit that and it will choose
 a rank for you.)

--

--
Ticket URL: <http://trac.sagemath.org/ticket/18384#comment:1>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to