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: n= m^(-1); n<br />

[ 0.333333333333 + 0.333333333333*I 0.166666666667 - 0.166666666667*I]<br />

[ -0.166666666667 - 0.333333333333*I 0.0833333333333 + 0.0833333333333*I]<br />

To compute eigenvalues the use the functions left_eigenvectors or right_eigenvectors<br />

sage: p,e = m.right_eigenvectors()<br />

the result <strong>of</strong> eigen is a pair (p,e), where p is a list <strong>of</strong> eigenvalues <strong>and</strong> the e is a matrix whose columns are the<br />

eigenvectors.<br />

To solve a linear system Ax = b where A = [[1,2] <strong>and</strong> b = [5,6] [3,4]]<br />

sage: b = vector(CDF,[5,6])<br />

sage: m.solve_right(b)<br />

(2.66666666667 + 0.666666666667*I, -0.333333333333 - 1.16666666667*I)<br />

See the comm<strong>and</strong>s qr, lu, <strong>and</strong> svd for QR, LU, <strong>and</strong> singular value decomposition.<br />

398 Chapter 21. Dense matrices over the Complex Double Field using NumPy

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

Saved successfully!

Ooh no, something went wrong!