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

sage: eval, [evec], mult = es[0]<br />

sage: delta = eval*evec - evec*A<br />

sage: abs(abs(delta)) < 1e-10<br />

True<br />

Notice the difference between considering ring extensions or not.<br />

sage: M=matrix(QQ,[[0,-1,0],[1,0,0],[0,0,2]])<br />

sage: M.eigenvectors_left()<br />

[(2, [<br />

(0, 0, 1)<br />

], 1), (-1*I, [(1, -1*I, 0)], 1), (1*I, [(1, 1*I, 0)], 1)]<br />

sage: M.eigenvectors_left(extend=False)<br />

[(2, [<br />

(0, 0, 1)<br />

], 1)]<br />

eigenvectors_right(extend=True)<br />

Compute the right eigenvectors <strong>of</strong> a matrix.<br />

For each distinct eigenvalue, returns a list <strong>of</strong> the form (e,V,n) where e is the eigenvalue, V is a list <strong>of</strong><br />

eigenvectors forming a basis for the corresponding right eigenspace, <strong>and</strong> n is the algebraic multiplicity <strong>of</strong><br />

the eigenvalue. If extend = True (the default), this will return eigenspaces over the algebraic closure<br />

<strong>of</strong> the base field where this is implemented; otherwise it will restrict to eigenvalues in the base field.<br />

EXAMPLES: We compute the right eigenvectors <strong>of</strong> a 3 × 3 rational matrix.<br />

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

[0 1 2]<br />

[3 4 5]<br />

[6 7 8]<br />

sage: es = A.eigenvectors_right(); es<br />

[(0, [<br />

(1, -2, 1)<br />

], 1),<br />

(-1.348469228349535, [(1, 0.1303061543300932, -0.7393876913398137)], 1),<br />

(13.34846922834954, [(1, 3.069693845669907, 5.139387691339814)], 1)]<br />

sage: A.eigenvectors_right(extend=False)<br />

[(0, [<br />

(1, -2, 1)<br />

], 1)]<br />

sage: eval, [evec], mult = es[0]<br />

sage: delta = eval*evec - A*evec<br />

sage: abs(abs(delta)) < 1e-10<br />

True<br />

elementary_divisors()<br />

If self is a matrix over a principal ideal domain R, return elements d i for 1 ≤ i ≤ k = min(r, s) where r<br />

<strong>and</strong> s are the number <strong>of</strong> rows <strong>and</strong> columns <strong>of</strong> self, such that the cokernel <strong>of</strong> self is isomorphic to<br />

R/(d 1 ) ⊕ R/(d 2 ) ⊕ R/(d k )<br />

with d i | d i+1 for all i. These are the diagonal entries <strong>of</strong> the Smith form <strong>of</strong> self (see smith_form()).<br />

EXAMPLES:<br />

sage: OE = EquationOrder(x^2 - x + 2, ’w’)<br />

sage: w = OE.ring_generators()[0]<br />

sage: m = Matrix([ [1, w],[w,7]])<br />

sage: m.elementary_divisors()<br />

[1, -w + 9]<br />

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