Ask Your Question

Revision history [back]

The issue is that matrices are not considered as vectors, so you can flatten them as vectors first:

sage: S = span([vector(A),vector(B)]) ; S
Vector space of degree 121 and dimension 2 over Finite Field in z2 of size 2^2
Basis matrix:
2 x 121 dense matrix over Finite Field in z2 of size 2^2

Given a vector v in such a space, you can make it a matrix as follows:

sage: v = S.random_element()
sage: matrix(n,n,v)

You can check consistency:

sage: matrix(n,n,vector(A)) == A
True
sage: matrix(n,n,vector(B)) == B
True
sage: v in S
True
sage: vector(A) in S
True