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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<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 0 0 0 0 0 200 0 0]<br />

[ 0 0 0 0 0 0 0 0 200 0]<br />

[ 0 0 0 0 0 0 0 0 0 200]<br />

elementary_divisors(algorithm=’pari’)<br />

Return the elementary divisors <strong>of</strong> self, in order.<br />

Warning: This is MUCH faster than the smith_form function.<br />

The elementary divisors are the invariants <strong>of</strong> the finite abelian group that is the cokernel <strong>of</strong> left multiplication<br />

<strong>of</strong> this matrix. They are ordered in reverse by divisibility.<br />

INPUT:<br />

•self - matrix<br />

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

–’pari’: works robustly, but is slower.<br />

–’linbox’ - use linbox (currently <strong>of</strong>f, broken)<br />

OUTPUT: list <strong>of</strong> integers<br />

Note: These are the invariants <strong>of</strong> the cokernel <strong>of</strong> left multiplication:<br />

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

sage: M<br />

[3 0 1]<br />

[0 1 0]<br />

sage: M.elementary_divisors()<br />

[1, 1]<br />

sage: M.transpose().elementary_divisors()<br />

[1, 1, 0]<br />

EXAMPLES:<br />

sage: matrix(3, range(9)).elementary_divisors()<br />

[1, 3, 0]<br />

sage: matrix(3, range(9)).elementary_divisors(algorithm=’pari’)<br />

[1, 3, 0]<br />

sage: C = MatrixSpace(ZZ,4)([3,4,5,6,7,3,8,10,14,5,6,7,2,2,10,9])<br />

sage: C.elementary_divisors()<br />

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

sage: M = matrix(ZZ, 3, [1,5,7, 3,6,9, 0,1,2])<br />

sage: M.elementary_divisors()<br />

[1, 1, 6]<br />

This returns a copy, which is safe to change:<br />

sage: edivs = M.elementary_divisors()<br />

sage: edivs.pop()<br />

6<br />

sage: M.elementary_divisors()<br />

[1, 1, 6]<br />

See Also:<br />

smith_form()<br />

324 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!