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

(-1.0, [(1.0, -0.5, 2.0, 0.5)], 1)<br />

exp(algorithm=’pade’, order=None)<br />

Calculate the exponential <strong>of</strong> this matrix X, which is the matrix<br />

INPUT:<br />

e X =<br />

∞∑<br />

k=0<br />

X k<br />

k! .<br />

•algorithm – ‘pade’, ‘eig’, or ‘taylor’; the algorithm used to compute the exponential.<br />

•order – for the Taylor series algorithm, this specifies the order <strong>of</strong> the Taylor series used. This is<br />

ignored for the other algorithms. The current default (from scipy) is 20.<br />

EXAMPLES:<br />

sage: A=matrix(RDF, 2, [1,2,3,4]); A<br />

[1.0 2.0]<br />

[3.0 4.0]<br />

sage: A.exp()<br />

[51.9689561987 74.736564567]<br />

[112.104846851 164.073803049]<br />

sage: A.exp(algorithm=’eig’)<br />

[51.9689561987 74.736564567]<br />

[112.104846851 164.073803049]<br />

sage: A.exp(algorithm=’taylor’, order=5)<br />

[19.9583333333 28.0833333333]<br />

[ 42.125 62.0833333333]<br />

sage: A.exp(algorithm=’taylor’)<br />

[51.9689035511 74.7364878369]<br />

[112.104731755 164.073635306]<br />

sage: A=matrix(CDF, 2, [1,2+I,3*I,4]); A<br />

[ 1.0 2.0 + 1.0*I]<br />

[ 3.0*I 4.0]<br />

sage: A.exp()<br />

[-19.6146029538 + 12.5177438468*I 3.79496364496 + 28.8837993066*I]<br />

[-32.3835809809 + 21.8842359579*I 2.26963300409 + 44.9013248277*I]<br />

sage: A.exp(algorithm=’eig’)<br />

[-19.6146029538 + 12.5177438468*I 3.79496364496 + 28.8837993066*I]<br />

[-32.3835809809 + 21.8842359579*I 2.26963300409 + 44.9013248277*I]<br />

sage: A.exp(algorithm=’taylor’, order=5)<br />

[ -6.29166666667 + 14.25*I 14.0833333333 + 15.7916666667*I]<br />

[ -10.5 + 26.375*I 20.0833333333 + 24.75*I]<br />

sage: A.exp(algorithm=’taylor’)<br />

[-19.6146006163 + 12.5177432169*I 3.79496442472 + 28.8837964828*I]<br />

[-32.3835771246 + 21.8842351994*I 2.26963458304 + 44.9013203415*I]<br />

is_hermitian(tol=1e-12, algorithm=’orthonormal’)<br />

Returns True if the matrix is equal to its conjugate-transpose.<br />

INPUT:<br />

•tol - default: 1e-12 - the largest value <strong>of</strong> the absolute value <strong>of</strong> the difference between two matrix<br />

entries for which they will still be considered equal.<br />

•algorithm - default: ‘orthonormal’ - set to ‘orthonormal’ for a stable procedure <strong>and</strong> set to ‘naive’<br />

for a fast procedure.<br />

367

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

Saved successfully!

Ooh no, something went wrong!