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

–‘generic’ - naive algorithm usable for matrices over any field<br />

–‘pari’ - PARI library code for matrices over number fields or the integers<br />

–‘padic’ - padic algorithm from IML library for matrices over the rationals <strong>and</strong> integers<br />

–‘pluq’ - PLUQ matrix factorization for matrices mod 2<br />

•basis - default: ‘echelon’ - a keyword that describes the format <strong>of</strong> the basis returned. Allowable<br />

values are:<br />

OUTPUT:<br />

–‘echelon’: the basis matrix is in echelon form<br />

–‘pivot’ : each basis vector is computed from the reduced row-echelon form <strong>of</strong> self by placing a<br />

single one in a non-pivot column <strong>and</strong> zeros in the remaining non-pivot columns. Only available<br />

for matrices over fields.<br />

–‘LLL’: an LLL-reduced basis. Only available for matrices over the integers.<br />

–‘computed’: no work is done to transform the basis, it is returned exactly as provided by<br />

whichever routine actually computed the basis. Request this for the least possible computation<br />

possible, but with no guarantees about the format <strong>of</strong> the basis.<br />

A matrix X whose rows are an independent set spanning the right kernel <strong>of</strong> self.<br />

self*X.transpose() is a zero matrix.<br />

The output varies depending on the choice <strong>of</strong> algorithm <strong>and</strong> the format chosen by basis.<br />

The results <strong>of</strong> this routine are not cached, so you can call it again with different options to get possibly<br />

different output (like the basis format). Conversely, repeated calls on the same matrix will always start<br />

from scratch.<br />

Note: If you want to get the most basic description <strong>of</strong> a kernel, with a minimum <strong>of</strong> overhead, then ask for<br />

the right kernel matrix with the basis format requested as ‘computed’. You are then free to work with the<br />

output for whatever purpose. For a left kernel, call this method on the transpose <strong>of</strong> your matrix.<br />

For greater convenience, plus cached results, request an actual vector space or free module with<br />

right_kernel() or left_kernel().<br />

EXAMPLES:<br />

Over the Rational Numbers:<br />

Kernels are computed by the IML library in _right_kernel_matrix(). Setting the algorithm<br />

keyword to ‘default’, ‘padic’ or unspecified will yield the same result, as there is no optional behavior.<br />

The ‘computed’ format <strong>of</strong> the basis vectors are exactly the negatives <strong>of</strong> the vectors in the ‘pivot’ format.<br />

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

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

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

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

sage: C = A.right_kernel_matrix(algorithm=’default’, basis=’computed’); C<br />

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

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

sage: A*C.transpose() == zero_matrix(QQ, 4, 2)<br />

True<br />

sage: P = A.right_kernel_matrix(algorithm=’padic’, basis=’pivot’); P<br />

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

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

sage: A*P.transpose() == zero_matrix(QQ, 4, 2)<br />

So<br />

241

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

Saved successfully!

Ooh no, something went wrong!