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 />

[ 0 0 12]<br />

sage: P.is_sparse()<br />

False<br />

symplectic_form()<br />

Find a symplectic basis for self if self is an anti-symmetric, alternating matrix.<br />

Returns a pair (F, C) such that the rows <strong>of</strong> C form a symplectic basis for self <strong>and</strong> F = C * self *<br />

C.transpose().<br />

Raises a ValueError if self is not anti-symmetric, or self is not alternating.<br />

Anti-symmetric means that M = −M t . Alternating means that the diagonal <strong>of</strong> M is identically zero.<br />

A symplectic basis is a basis <strong>of</strong> the form e 1 , . . . , e j , f 1 , . . . f j , z 1 , . . . , z k such that<br />

•z i Mv t = 0 for all vectors v<br />

•e i Me j t = 0 for all i, j<br />

•f i Mf j t = 0 for all i, j<br />

•e i Mf i t = 1 for all i<br />

•e i Mf j t = 0 for all i not equal j.<br />

The ordering for the factors d i |d i+1 <strong>and</strong> for the placement <strong>of</strong> zeroes was chosen to agree with the output<br />

<strong>of</strong> smith_form.<br />

See the example for a pictorial description <strong>of</strong> such a basis.<br />

EXAMPLES:<br />

sage: E = matrix(ZZ, 5, 5, [0, 14, 0, -8, -2, -14, 0, -3, -11, 4, 0, 3, 0, 0, 0, 8, 11, 0, 0<br />

[ 0 14 0 -8 -2]<br />

[-14 0 -3 -11 4]<br />

[ 0 3 0 0 0]<br />

[ 8 11 0 0 8]<br />

[ 2 -4 0 -8 0]<br />

sage: F, C = E.symplectic_form()<br />

sage: F<br />

[ 0 0 1 0 0]<br />

[ 0 0 0 2 0]<br />

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

[ 0 -2 0 0 0]<br />

[ 0 0 0 0 0]<br />

sage: F == C * E * C.transpose()<br />

True<br />

sage: E.smith_form()[0]<br />

[1 0 0 0 0]<br />

[0 1 0 0 0]<br />

[0 0 2 0 0]<br />

[0 0 0 2 0]<br />

[0 0 0 0 0]<br />

transpose()<br />

Returns the transpose <strong>of</strong> self, without changing self.<br />

EXAMPLES:<br />

We create a matrix, compute its transpose, <strong>and</strong> note that the original matrix is not changed.<br />

336 Chapter 17. Dense matrices over the integer ring

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

Saved successfully!

Ooh no, something went wrong!