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

Note: This row reduction does not use division if the matrix is not over a field (e.g., if the matrix is over<br />

the integers). If you want to calculate the echelon form using division, then use rref(), which assumes<br />

that the matrix entries are in a field (specifically, the field <strong>of</strong> fractions <strong>of</strong> the base ring <strong>of</strong> the matrix).<br />

INPUT:<br />

•algorithm – string. Which algorithm to use. Choices are<br />

–’default’: Let <strong>Sage</strong> choose an algorithm (default).<br />

–’classical’: Gauss elimination.<br />

–’strassen’: use a Strassen divide <strong>and</strong> conquer algorithm (if available)<br />

•cut<strong>of</strong>f – integer. Only used if the Strassen algorithm is selected.<br />

•transformation – boolean. Whether to also return the transformation matrix. Some matrix<br />

backends do not provide this information, in which case this option is ignored.<br />

OUTPUT:<br />

The reduced row echelon form <strong>of</strong> self, as an immutable matrix. Note that self is not changed by this<br />

comm<strong>and</strong>. Use echelonize() to change self in place.<br />

If the optional parameter transformation=True is specified, the output consists <strong>of</strong> a pair (E, T ) <strong>of</strong><br />

matrices where E is the echelon form <strong>of</strong> self <strong>and</strong> T is the transformation matrix.<br />

EXAMPLES:<br />

sage: MS = MatrixSpace(GF(19),2,3)<br />

sage: C = MS.matrix([1,2,3,4,5,6])<br />

sage: C.rank()<br />

2<br />

sage: C.nullity()<br />

0<br />

sage: C.echelon_form()<br />

[ 1 0 18]<br />

[ 0 1 2]<br />

The matrix library used for Z/p-matrices does not return the transformation matrix,<br />

transformation option is ignored:<br />

so the<br />

sage: C.echelon_form(transformation=True)<br />

[ 1 0 18]<br />

[ 0 1 2]<br />

sage: D = matrix(ZZ, 2, 3, [1,2,3,4,5,6])<br />

sage: D.echelon_form(transformation=True)<br />

(<br />

[1 2 3] [ 1 0]<br />

[0 3 6], [ 4 -1]<br />

)<br />

sage: E, T = D.echelon_form(transformation=True)<br />

sage: T*D == E<br />

True<br />

echelonize(algorithm=’default’, cut<strong>of</strong>f=0, **kwds)<br />

Transform self into a matrix in echelon form over the same base ring as self.<br />

Note: This row reduction does not use division if the matrix is not over a field (e.g., if the matrix is over<br />

the integers). If you want to calculate the echelon form using division, then use rref(), which assumes<br />

153

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

Saved successfully!

Ooh no, something went wrong!