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

kernel.<br />

sage: A = matrix(QQ, 2, 0)<br />

sage: A.right_kernel()<br />

Vector space <strong>of</strong> degree 0 <strong>and</strong> dimension 0 over Rational Field<br />

Basis matrix:<br />

[]<br />

sage: A = matrix(QQ, 0, 2)<br />

sage: A.right_kernel()<br />

Vector space <strong>of</strong> degree 2 <strong>and</strong> dimension 2 over Rational Field<br />

Basis matrix:<br />

[1 0]<br />

[0 1]<br />

Every vector is in the kernel <strong>of</strong> a zero matrix, the dimension is the number <strong>of</strong> columns.<br />

sage: A = zero_matrix(QQ, 10, 20)<br />

sage: A.right_kernel()<br />

Vector space <strong>of</strong> degree 20 <strong>and</strong> dimension 20 over Rational Field<br />

Basis matrix:<br />

20 x 20 dense matrix over Rational Field<br />

Results are cached as the right kernel <strong>of</strong> the matrix. Subsequent requests for the right kernel will return<br />

the cached result, without regard for new values <strong>of</strong> the algorithm or format keyword. Work with a copy<br />

if you need a new right kernel, or perhaps investigate the right_kernel_matrix() method, which<br />

does not cache its results <strong>and</strong> is more flexible.<br />

sage: A = matrix(QQ, 3, range(9))<br />

sage: K1 = A.right_kernel(basis=’echelon’)<br />

sage: K1<br />

Vector space <strong>of</strong> degree 3 <strong>and</strong> dimension 1 over Rational Field<br />

Basis matrix:<br />

[ 1 -2 1]<br />

sage: K2 = A.right_kernel(basis=’pivot’)<br />

sage: K2<br />

Vector space <strong>of</strong> degree 3 <strong>and</strong> dimension 1 over Rational Field<br />

Basis matrix:<br />

[ 1 -2 1]<br />

sage: K1 is K2<br />

True<br />

sage: B = copy(A)<br />

sage: K3 = B.kernel(basis=’pivot’)<br />

sage: K3<br />

Vector space <strong>of</strong> degree 3 <strong>and</strong> dimension 1 over Rational Field<br />

User basis matrix:<br />

[ 1 -2 1]<br />

sage: K3 is K1<br />

False<br />

sage: K3 == K1<br />

True<br />

right_kernel_matrix(*args, **kwds)<br />

Returns a matrix whose rows form a basis for the right kernel <strong>of</strong> self.<br />

INPUT:<br />

•algorithm - default: ‘default’ - a keyword that selects the algorithm employed. Allowable values<br />

are:<br />

–‘default’ - allows the algorithm to be chosen automatically<br />

240 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!