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 3 6]<br />

[0 0 0]<br />

sage: matrix(ZZ,3,[1..9]).hermite_form(algorithm=’pari0’)<br />

[1 2 3]<br />

[0 3 6]<br />

[0 0 0]<br />

sage: matrix(ZZ,3,[1..9]).hermite_form(algorithm=’pari4’)<br />

[1 2 3]<br />

[0 3 6]<br />

[0 0 0]<br />

sage: matrix(ZZ,3,[1..9]).hermite_form(algorithm=’padic’)<br />

[1 2 3]<br />

[0 3 6]<br />

[0 0 0]<br />

sage: matrix(ZZ,3,[1..9]).hermite_form(algorithm=’default’)<br />

[1 2 3]<br />

[0 3 6]<br />

[0 0 0]<br />

The ‘ntl’ algorithm doesn’t work on matrices that do not have full rank.:<br />

sage: matrix(ZZ,3,[1..9]).hermite_form(algorithm=’ntl’)<br />

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

...<br />

ValueError: ntl only computes HNF for square matrices <strong>of</strong> full rank.<br />

sage: matrix(ZZ,3,[0] +[2..9]).hermite_form(algorithm=’ntl’)<br />

[1 0 0]<br />

[0 1 0]<br />

[0 0 3]<br />

TESTS:<br />

This example illustrated trac 2398:<br />

sage: a = matrix([(0, 0, 3), (0, -2, 2), (0, 1, 2), (0, -2, 5)])<br />

sage: a.hermite_form()<br />

[0 1 2]<br />

[0 0 3]<br />

[0 0 0]<br />

[0 0 0]<br />

Check that #12280 is fixed:<br />

sage: m = matrix([(-2, 1, 9, 2, -8, 1, -3, -1, -4, -1),<br />

... (5, -2, 0, 1, 0, 4, -1, 1, -2, 0),<br />

... (-11, 3, 1, 0, -3, -2, -1, -11, 2, -2),<br />

... (-1, 1, -1, -2, 1, -1, -1, -1, -1, 7),<br />

... (-2, -1, -1, 1, 1, -2, 1, 0, 2, -4)]).stack(<br />

... 200 * identity_matrix(ZZ, 10))<br />

sage: matrix(ZZ,m).hermite_form(algorithm=’pari’, include_zero_rows=False)<br />

[ 1 0 2 0 13 5 1 166 72 69]<br />

[ 0 1 1 0 20 4 15 195 65 190]<br />

[ 0 0 4 0 24 5 23 22 51 123]<br />

[ 0 0 0 1 23 7 20 105 60 151]<br />

[ 0 0 0 0 40 4 0 80 36 68]<br />

[ 0 0 0 0 0 10 0 100 190 170]<br />

[ 0 0 0 0 0 0 25 0 100 150]<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 />

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