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

TESTS:<br />

Inexact rings are caught <strong>and</strong> CDF suggested.<br />

sage: A = matrix(RealField(100), 2, range(4))<br />

sage: A.QR()<br />

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

...<br />

NotImplementedError: QR decomposition is implemented over exact rings, try CDF for numerical<br />

Without a fraction field, we cannot hope to run the algorithm.<br />

sage: A = matrix(Integers(6), 2, range(4))<br />

sage: A.QR()<br />

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

...<br />

ValueError: QR decomposition needs a fraction field <strong>of</strong> Ring <strong>of</strong> integers modulo 6<br />

The biggest obstacle is making unit vectors, thus requiring square roots, though some small cases pass<br />

through.<br />

sage: A = matrix(ZZ, 3, range(9))<br />

sage: A.QR()<br />

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

...<br />

TypeError: QR decomposition unable to compute square roots in Rational Field<br />

sage: A = matrix(ZZ, 2, range(4))<br />

sage: Q, R = A.QR()<br />

sage: Q<br />

[0 1]<br />

[1 0]<br />

sage: R<br />

[2 3]<br />

[0 1]<br />

T<br />

REFERENCES:<br />

AUTHOR:<br />

•Rob Beezer (2011-02-17)<br />

Returns the transpose <strong>of</strong> a matrix.<br />

EXAMPLE:<br />

sage: A = matrix(QQ, 5, range(25))<br />

sage: A.T<br />

[ 0 5 10 15 20]<br />

[ 1 6 11 16 21]<br />

[ 2 7 12 17 22]<br />

[ 3 8 13 18 23]<br />

[ 4 9 14 19 24]<br />

adjoint()<br />

Returns the adjoint matrix <strong>of</strong> self (matrix <strong>of</strong> c<strong>of</strong>actors).<br />

OUTPUT:<br />

•N - the adjoint matrix, such that N * M = M * N = M.parent(M.det())<br />

130 Chapter 7. Base class for matrices, part 2

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

Saved successfully!

Ooh no, something went wrong!