On Fri, Apr 4, 2014 at 2:50 PM, pong <wypon...@gmail.com> wrote:
> I want to form the span of a finite sequence of matrices (in the matrix
> space).
>
> I tried:
> M = MatrixSpace(QQ,4)
> span([M(range(16)), M(range(2,18))])
>
> But sage returns:
> ....
>
> TypeError: The base_ring (= [ 2  3  4  5]
> [ 6  7  8  9]
> [10 11 12 13]
> [14 15 16 17]) must be a principal ideal domain.
>
> What should be the correct way to generate the span in this case?

Completely rewrite the MatrixSpace class to actually be a vector
space... sadly it isn't:

  sage: is_VectorSpace(M)
  False

You'll have to work in QQ^16, e.g.,


M = MatrixSpace(QQ,4)
v = M(range(16)); w = M(range(2,18))
A = QQ^16
v0 = A(v.list()); w0 = A(w.list())
S = span([v0, w0])
M(S.0.list())

You can translate back and forth -- it's a little painful, but will fully work.

William










>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.



-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to