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

sage: k = t-39<br />

sage: k.restrict(V)<br />

[ 0 -10 -12]<br />

[ 0 -37 -1]<br />

[ 0 2 -41]<br />

sage: ker = k.kernel_on(V); ker<br />

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

Basis matrix:<br />

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

sage: ker.0 * k<br />

(0, 0, 0, 0)<br />

Test that trac ticket #9425 is fixed.<br />

sage: V = span([[1/7,0,0] ,[0,1,0]], ZZ); V<br />

Free module <strong>of</strong> degree 3 <strong>and</strong> rank 2 over Integer Ring<br />

Echelon basis matrix:<br />

[1/7 0 0]<br />

[ 0 1 0]<br />

sage: T = matrix(ZZ,3,[1,0,0,0,0,0,0,0,0]); T<br />

[1 0 0]<br />

[0 0 0]<br />

[0 0 0]<br />

sage: W = T.kernel_on(V); W.basis()<br />

[<br />

(0, 1, 0)<br />

]<br />

sage: W.is_submodule(V)<br />

True<br />

left_eigenmatrix()<br />

Return matrices D <strong>and</strong> P, where D is a diagonal matrix <strong>of</strong> eigenvalues <strong>and</strong> P is the corresponding matrix<br />

where the rows are corresponding eigenvectors (or zero vectors) so that P*self = D*P.<br />

EXAMPLES:<br />

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

[0 1 2]<br />

[3 4 5]<br />

[6 7 8]<br />

sage: D, P = A.eigenmatrix_left()<br />

sage: D<br />

[ 0 0 0]<br />

[ 0 -1.348469228349535 0]<br />

[ 0 0 13.34846922834954]<br />

sage: P<br />

[ 1 -2 1]<br />

[ 1 0.3101020514433644 -0.3797958971132713]<br />

[ 1 1.289897948556636 1.579795897113272]<br />

sage: P*A == D*P<br />

True<br />

Because P is invertible, A is diagonalizable.<br />

sage: A == (~P)*D*P<br />

True<br />

The matrix P may contain zero rows corresponding to eigenvalues for which the algebraic multiplicity is<br />

greater than the geometric multiplicity. In these cases, the matrix is not diagonalizable.<br />

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