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

•subdivide - default: False - determines if the returned matrix is subdivided. See the description<br />

<strong>of</strong> the (output) below for details.<br />

•kwds - additional keywords that can be passed to the method that computes the echelon form.<br />

OUTPUT:<br />

If A is an m × n matrix, add the m columns <strong>of</strong> an m × m identity matrix to the right <strong>of</strong> self. Then<br />

row-reduce this m × (n + m) matrix. This matrix is returned as an immutable matrix.<br />

If subdivide is True then the returned matrix has a single division among the columns <strong>and</strong> a single<br />

division among the rows. The column subdivision has n columns to the left <strong>and</strong> m columns to the right.<br />

The row division separates the non-zero rows from the zero rows, when restricted to the first n columns.<br />

For a nonsingular matrix the final m columns <strong>of</strong> the extended echelon form are the inverse <strong>of</strong> self. For<br />

a matrix <strong>of</strong> any size, the final m columns provide a matrix that transforms self to echelon form when<br />

it multiplies self from the left. When the base ring is a field, the uniqueness <strong>of</strong> reduced row-echelon<br />

form implies that this transformation matrix can be taken as the coefficients giving a canonical set <strong>of</strong> linear<br />

combinations <strong>of</strong> the rows <strong>of</strong> self that yield reduced row-echelon form.<br />

When subdivided as described above, <strong>and</strong> again over a field, the parts <strong>of</strong> the subdivision in the upper-left<br />

corner <strong>and</strong> lower-right corner satisfy several interesting relationships with the row space, column space,<br />

left kernel <strong>and</strong> right kernel <strong>of</strong> self. See the examples below.<br />

Note: This method returns an echelon form. If the base ring is not a field, no atttempt is made to move to<br />

the fraction field. See an example below where the base ring is changed manually.<br />

EXAMPLES:<br />

The four relationships at the end <strong>of</strong> this example hold in general.<br />

sage: A = matrix(QQ, [[2, -1, 7, -1, 0, -3],<br />

... [-1, 1, -5, 3, 4, 4],<br />

... [2, -1, 7, 0, 2, -2],<br />

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

... [2, -1, 7, 0, 2, -2]])<br />

sage: E = A.extended_echelon_form(subdivide=True); E<br />

[ 1 0 2 0 0 -1| 0 -1 0 1 -1]<br />

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

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

[-----------------------------+------------------------]<br />

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

[ 0 0 0 0 0 0| 0 0 1 0 -1]<br />

sage: J = E.matrix_from_columns(range(6,11)); J<br />

[ 0 -1 0 1 -1]<br />

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

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

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

[ 0 0 1 0 -1]<br />

sage: J*A == A.rref()<br />

True<br />

sage: C = E.subdivision(0,0); C<br />

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

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

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

sage: L = E.subdivision(1,1); L<br />

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

[ 0 0 1 0 -1]<br />

sage: A.right_kernel() == C.right_kernel()<br />

170 Chapter 7. Base class for matrices, part 2

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

Saved successfully!

Ooh no, something went wrong!