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.

CHAPTER<br />

FOURTEEN<br />

DENSE MATRICES OVER Z/NZ FOR N<br />

SMALL<br />

Dense matrices over Z/nZ for n small<br />

AUTHORS:<br />

• William Stein<br />

• Robert Bradshaw<br />

This is a compiled implementation <strong>of</strong> dense matrices over Z/nZ for n small.<br />

EXAMPLES:<br />

sage: a = matrix(Integers(37),3,range(9),sparse=False); a<br />

[0 1 2]<br />

[3 4 5]<br />

[6 7 8]<br />

sage: a.rank()<br />

2<br />

sage: type(a)<br />

<br />

sage: a[0,0] = 5<br />

sage: a.rank()<br />

3<br />

sage: parent(a)<br />

Full MatrixSpace <strong>of</strong> 3 by 3 dense matrices over Ring <strong>of</strong> integers modulo 37<br />

sage: a^2<br />

[ 3 23 31]<br />

[20 17 29]<br />

[25 16 0]<br />

sage: a+a<br />

[10 2 4]<br />

[ 6 8 10]<br />

[12 14 16]<br />

sage: b = a.new_matrix(2,3,range(6)); b<br />

[0 1 2]<br />

[3 4 5]<br />

sage: a*b<br />

Traceback (most recent call last):<br />

...<br />

TypeError: unsupported oper<strong>and</strong> parent(s) for ’*’: ’Full MatrixSpace <strong>of</strong> 3 by 3 dense matrices over Rin<br />

sage: b*a<br />

293

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

Saved successfully!

Ooh no, something went wrong!