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

[ 7 - 3*I -1 - 6*I 3 - 5*I]<br />

[ 3 - 3*I -3 - 6*I 5 - 1*I]<br />

H<br />

Returns the conjugate-transpose (Hermitian) matrix.<br />

EXAMPLE:<br />

sage: A = matrix(QQbar, [[ -3, 5 - 3*I, 7 - 4*I],<br />

... [7 + 3*I, -1 + 6*I, 3 + 5*I],<br />

... [3 + 3*I, -3 + 6*I, 5 + I]])<br />

sage: A.H<br />

[ -3 7 - 3*I 3 - 3*I]<br />

[ 5 + 3*I -1 - 6*I -3 - 6*I]<br />

[ 7 + 4*I 3 - 5*I 5 - 1*I]<br />

I<br />

Returns the inverse <strong>of</strong> the matrix, if it exists.<br />

EXAMPLES:<br />

sage: A = matrix(QQ, [[-5, -3, -1, -7],<br />

... [ 1, 1, 1, 0],<br />

... [-1, -2, -2, 0],<br />

... [-2, -1, 0, -4]])<br />

sage: A.I<br />

[ 0 2 1 0]<br />

[-4 -8 -2 7]<br />

[ 4 7 1 -7]<br />

[ 1 1 0 -2]<br />

sage: B = matrix(QQ, [[-11, -5, 18, -6],<br />

... [ 1, 2, -6, 8],<br />

... [ -4, -2, 7, -3],<br />

... [ 1, -2, 5, -11]])<br />

sage: B.I<br />

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

...<br />

ZeroDivisionError: input matrix must be nonsingular<br />

LU(pivot=None, format=’plu’)<br />

Finds a decomposition into a lower-triangular matrix <strong>and</strong> an upper-triangular matrix.<br />

INPUT:<br />

•pivot - pivoting strategy<br />

–‘auto’ (default) - see if the matrix entries are ordered (i.e. if they have an absolute value method),<br />

<strong>and</strong> if so, use a the partial pivoting strategy. Otherwise, fall back to the nonzero strategy. This is<br />

the best choice for general routines that may call this for matrix entries <strong>of</strong> a variety <strong>of</strong> types.<br />

–‘partial’ - each column is examined for the element with the largest absolute value <strong>and</strong> the row<br />

containing this element is swapped into place.<br />

–‘nonzero’ - the first nonzero element in a column is located <strong>and</strong> the row with this element is used.<br />

•format - contents <strong>of</strong> output, see more discussion below about output.<br />

–‘plu’ (default) - a triple; matrices P, L <strong>and</strong> U such that A = P*L*U.<br />

–‘compact’ - a pair; row permutation as a tuple, <strong>and</strong> the matrices L <strong>and</strong> U combined into one<br />

matrix.<br />

120 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!