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

[1.0 1.0 1.0 1.0]<br />

sage: e, V = spectrum[2]<br />

sage: v = V.basis()[0]<br />

sage: diff = (v*m).change_ring(CDF) - e*v<br />

sage: abs(abs(diff)) < 1e-14<br />

True<br />

TESTS:<br />

sage: m.eigenspaces_left(algebraic_multiplicity=True)<br />

Traceback (most recent call last):<br />

...<br />

ValueError: algebraic_multiplicity must be set to False for double precision matrices<br />

eigenspaces_right(var=’a’, algebraic_multiplicity=False)<br />

Computes the right eigenspaces <strong>of</strong> a matrix <strong>of</strong> double precision real or complex numbers (i.e. RDF or<br />

CDF).<br />

Warning: This method returns eigenspaces that are all <strong>of</strong> dimension one, since it is impossible to<br />

ascertain if the numerical results belong to the same eigenspace. So this is deprecated in favor <strong>of</strong> the<br />

eigenmatrix routines, such as sage.matrix.matrix2.Matrix.eigenmatrix_right().<br />

INPUT:<br />

•var - ignored for numerical matrices<br />

•algebraic_multiplicity - must be set to False for numerical matrices, <strong>and</strong> will raise an<br />

error otherwise.<br />

OUTPUT:<br />

Return a list <strong>of</strong> pairs (e, V) where e is a (complex) eigenvalue <strong>and</strong> V is the associated right eigenspace<br />

as a vector space.<br />

No attempt is made to determine if an eigenvalue has multiplicity greater than one, so all the eigenspaces<br />

returned have dimension one.<br />

The SciPy routines used for these computations produce eigenvectors normalized to have length 1, but on<br />

different hardware they may vary by a sign. So for doctests we have normalized output by creating an<br />

eigenspace with a canonical basis.<br />

EXAMPLES:<br />

This first test simply raises the deprecation warning.<br />

sage: A = identity_matrix(RDF, 2)<br />

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

doctest:...: DeprecationWarning: Eigenspaces <strong>of</strong> RDF/CDF matrices are<br />

deprecated as <strong>of</strong> <strong>Sage</strong> version 5.0,<br />

please use "eigenmatrix_right" instead<br />

See http://trac.sagemath.org/11603 for details.<br />

sage: m = matrix(RDF, [[-9, -14, 19, -74],[-1, 2, 4, -11],[-4, -12, 6, -32],[0, -2, -1, 1]])<br />

sage: m<br />

[ -9.0 -14.0 19.0 -74.0]<br />

[ -1.0 2.0 4.0 -11.0]<br />

[ -4.0 -12.0 6.0 -32.0]<br />

[ 0.0 -2.0 -1.0 1.0]<br />

sage: spectrum = m.eigenspaces_right()<br />

362 Chapter 19. Dense matrices using a NumPy backend.

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

Saved successfully!

Ooh no, something went wrong!