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: b = matrix(QQ,2,range(6)); b[0,0]=-5007/293; b<br />

[-5007/293 1 2]<br />

[ 3 4 5]<br />

sage: b.denominator()<br />

293<br />

determinant(algorithm=’default’, pro<strong>of</strong>=None)<br />

Return the determinant <strong>of</strong> this matrix.<br />

INPUT:<br />

•pro<strong>of</strong> - bool or None; if None use pro<strong>of</strong>.linear_algebra(); only relevant for the padic algorithm.<br />

•algorithm:<br />

“default” – use PARI for up to 7 rows, then use integer<br />

“pari” – use PARI<br />

“integer” – clear denominators <strong>and</strong> call det on integer matrix<br />

Note: It would be VERY VERY hard for det to fail even with pro<strong>of</strong>=False.<br />

ALGORITHM: Clear denominators <strong>and</strong> call the integer determinant function.<br />

EXAMPLES:<br />

sage: m = matrix(QQ,3,[1,2/3,4/5, 2,2,2, 5,3,2/5])<br />

sage: m.determinant()<br />

-34/15<br />

sage: m.charpoly()<br />

x^3 - 17/5*x^2 - 122/15*x + 34/15<br />

echelon_form(algorithm=’default’, height_guess=None, pro<strong>of</strong>=None, **kwds)<br />

INPUT:<br />

•algorithm<br />

–‘default’ (default): use heuristic choice<br />

–‘padic’: an algorithm based on the IML p-adic solver.<br />

–‘multimodular’: uses a multimodular algorithm the uses linbox modulo many primes.<br />

–‘classical’: just clear each column using Gauss elimination<br />

•height_guess, **kwds - all passed to the multimodular algorithm; ignored by the p-adic algorithm.<br />

•pro<strong>of</strong> - bool or None (default: None, see pro<strong>of</strong>.linear_algebra or sage.structure.pro<strong>of</strong>). Passed to the<br />

multimodular algorithm. Note that the <strong>Sage</strong> global default is pro<strong>of</strong>=True.<br />

OUTPUT: the reduced row echelon form <strong>of</strong> self.<br />

EXAMPLES:<br />

sage: a = matrix(QQ, 4, range(16)); a[0,0] = 1/19; a[0,1] = 1/5; a<br />

[1/19 1/5 2 3]<br />

[ 4 5 6 7]<br />

[ 8 9 10 11]<br />

[ 12 13 14 15]<br />

sage: a.echelon_form()<br />

343

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

Saved successfully!

Ooh no, something went wrong!