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

[]<br />

sage: m.numpy()<br />

array([], shape=(5, 0), dtype=float64)<br />

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

sage: spectrum[0][0]<br />

2.0<br />

sage: (RDF^4).subspace(spectrum[0][1].basis())<br />

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

Basis matrix:<br />

[ 1.0 -2.0 3.0 1.0]<br />

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

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

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

381

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

Saved successfully!

Ooh no, something went wrong!