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

determinant()<br />

Return the determinant <strong>of</strong> self.<br />

ALGORITHM:<br />

Use numpy<br />

EXAMPLES:<br />

sage: m = matrix(RDF,2,range(4)); m.det()<br />

-2.0<br />

sage: m = matrix(RDF,0,[]); m.det()<br />

1.0<br />

sage: m = matrix(RDF, 2, range(6)); m.det()<br />

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

...<br />

ValueError: self must be a square matrix<br />

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

Computes the left eigenspaces <strong>of</strong> a matrix <strong>of</strong> double precision real or complex numbers (i.e. RDF or 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 left 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_left()<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_left" instead<br />

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

sage: m = matrix(RDF, [[-5, 3, 2, 8],[10, 2, 4, -2],[-1, -10, -10, -17],[-2, 7, 6, 13]])<br />

sage: spectrum = m.eigenspaces_left()<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 />

361

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

Saved successfully!

Ooh no, something went wrong!