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

EXAMPLES:<br />

sage: a = matrix(ZZ, 3, [1,2,5,7,-3,4,2,1,123])<br />

sage: a.hadamard_bound()<br />

4<br />

sage: a.det()<br />

-2014<br />

sage: 10^4<br />

10000<br />

In this example the Hadamard bound has to be computed (automatically) using MPFR instead <strong>of</strong> doubles,<br />

since doubles overflow:<br />

sage: a = matrix(ZZ, 2, [2^10000,3^10000,2^50,3^19292])<br />

sage: a.hadamard_bound()<br />

12215<br />

sage: len(str(a.det()))<br />

12215<br />

hermite_form(include_zero_rows=True, transformation=False)<br />

Return the Hermite form <strong>of</strong> self, if it is defined.<br />

INPUT:<br />

•include_zero_rows – bool (default: True); if False the zero rows in the output matrix are deleted.<br />

•transformation – bool (default: False) a matrix U such that U*self == H.<br />

OUTPUT:<br />

•matrix H<br />

•(optional) transformation matrix U such that U*self == H, possibly with zero rows deleted...<br />

EXAMPLES:<br />

sage: M = FunctionField(GF(7),’x’).maximal_order()<br />

sage: K. = FunctionField(GF(7)); M = K.maximal_order()<br />

sage: A = matrix(M, 2, 3, [x, 1, 2*x, x, 1+x, 2])<br />

sage: A.hermite_form()<br />

[ x 1 2*x]<br />

[ 0 x 5*x + 2]<br />

sage: A.hermite_form(transformation=True)<br />

(<br />

[ x 1 2*x] [1 0]<br />

[ 0 x 5*x + 2], [6 1]<br />

)<br />

sage: A = matrix(M, 2, 3, [x, 1, 2*x, 2*x, 2, 4*x])<br />

sage: A.hermite_form(transformation=True, include_zero_rows=False)<br />

([ x 1 2*x], [1 0])<br />

sage: H, U = A.hermite_form(transformation=True, include_zero_rows=True); H, U<br />

(<br />

[ x 1 2*x] [1 0]<br />

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

)<br />

sage: U*A == H<br />

True<br />

sage: H, U = A.hermite_form(transformation=True, include_zero_rows=False)<br />

sage: U*A<br />

[ x 1 2*x]<br />

sage: U*A == H<br />

True<br />

179

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

Saved successfully!

Ooh no, something went wrong!