Ask Your Question

Revision history [back]

@Semin : Actually, you can use gap if you want, since it is included in Sage:

sage: p = 5
sage: F = GF(p)
sage: MM = MatrixSpace(F,2,3) ; MM
Full MatrixSpace of 2 by 3 dense matrices over Finite Field of size 5

sage: M1 = MM.random_element() ; M1
[3 2 1]
[3 1 2]
sage: M2 = MM.random_element() ; M2
[2 0 4]
[0 3 4]

sage: sp = gap.VectorSpace(F,[M1,M2]) ; sp
VectorSpace( GF(5), [ [ [ Z(5)^3, Z(5), Z(5)^0 ], [ Z(5)^3, Z(5)^0, Z(5) ] ], 
  [ [ Z(5), 0*Z(5), Z(5)^2 ], [ 0*Z(5), Z(5)^3, Z(5)^2 ] ] ] )

sage: M1 + M2 in sp
True

sage: A = sp.Random() ; A
[ [ Z(5)^3, 0*Z(5), Z(5)^0 ], [ 0*Z(5), Z(5), Z(5)^0 ] ]

But then, how to get the matrix A back as a Sage object ?