08.02.2015 Views

Sage Reference Manual: Matrices and Spaces of Matrices - Mirrors

Sage Reference Manual: Matrices and Spaces of Matrices - Mirrors

Sage Reference Manual: Matrices and Spaces of Matrices - Mirrors

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Sage</strong> <strong>Reference</strong> <strong>Manual</strong>: <strong>Matrices</strong> <strong>and</strong> <strong>Spaces</strong> <strong>of</strong> <strong>Matrices</strong>, Release 6.1.1<br />

[15 18 21]<br />

[20 17 29]<br />

sage: TestSuite(a).run()<br />

sage: TestSuite(b).run()<br />

sage: a.echelonize(); a<br />

[1 0 0]<br />

[0 1 0]<br />

[0 0 1]<br />

sage: b.echelonize(); b<br />

[ 1 0 36]<br />

[ 0 1 2]<br />

We create a matrix group:<br />

sage: M = MatrixSpace(GF(3),3,3)<br />

sage: G = MatrixGroup([M([[0,1,0],[0,0,1],[1,0,0]]), M([[0,1,0],[1,0,0],[0,0,1]])])<br />

sage: G<br />

Matrix group over Finite Field <strong>of</strong> size 3 with 2 generators (<br />

[0 1 0] [0 1 0]<br />

[0 0 1] [1 0 0]<br />

[1 0 0], [0 0 1]<br />

)<br />

sage: G.gap()<br />

Group([ [ [ 0*Z(3), Z(3)^0, 0*Z(3) ], [ 0*Z(3), 0*Z(3), Z(3)^0 ], [ Z(3)^0, 0*Z(3), 0*Z(3) ] ],<br />

[ [ 0*Z(3), Z(3)^0, 0*Z(3) ], [ Z(3)^0, 0*Z(3), 0*Z(3) ], [ 0*Z(3), 0*Z(3), Z(3)^0 ] ] ])<br />

TESTS:<br />

sage: M = MatrixSpace(GF(5),2,2)<br />

sage: A = M([1,0,0,1])<br />

sage: A - int(-1)<br />

[2 0]<br />

[0 2]<br />

sage: B = M([4,0,0,1])<br />

sage: B - int(-1)<br />

[0 0]<br />

[0 2]<br />

sage: Matrix(GF(5),0,0, sparse=False).inverse()<br />

[]<br />

class sage.matrix.matrix_modn_dense.Matrix_modn_dense<br />

Bases: sage.matrix.matrix_dense.Matrix_dense<br />

TESTS:<br />

sage: matrix(GF(7), 2, 2, [-1, int(-2), GF(7)(-3), 1/4])<br />

[6 5]<br />

[4 2]<br />

charpoly(var=’x’, algorithm=’generic’)<br />

Returns the characteristic polynomial <strong>of</strong> self.<br />

INPUT:<br />

•var - a variable name<br />

•algorithm - ‘generic’ (default)<br />

EXAMPLES:<br />

294 Chapter 14. Dense matrices over Z/nZ for n small

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!