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

sage: image(A)<br />

Free module <strong>of</strong> degree 4 <strong>and</strong> rank 4 over Integer Ring<br />

Echelon basis matrix:<br />

[ 1 0 0 426]<br />

[ 0 1 0 518]<br />

[ 0 0 1 293]<br />

[ 0 0 0 687]<br />

sage: image(B) == B.row_module()<br />

True<br />

indefinite_factorization(algorithm=’symmetric’, check=True)<br />

Decomposes a symmetric or Hermitian matrix into a lower triangular matrix <strong>and</strong> a diagonal matrix.<br />

INPUT:<br />

•self - a square matrix over a ring. The base ring must have an implemented fraction field.<br />

•algorithm - default: ’symmetric’. Either ’symmetric’ or ’hermitian’, according to if<br />

the input matrix is symmetric or hermitian.<br />

•check - default: True - if True then performs the check that the matrix is consistent with the<br />

algorithm keyword.<br />

OUTPUT:<br />

A lower triangular matrix L with each diagonal element equal to 1 <strong>and</strong> a vector <strong>of</strong> entries that form a<br />

diagonal matrix D. The vector <strong>of</strong> diagonal entries can be easily used to form the matrix, as demonstrated<br />

below in the examples.<br />

For a symmetric matrix, A, these will be related by<br />

A = LDL T<br />

If A is Hermitian matrix, then the transpose <strong>of</strong> L should be replaced by the conjugate-transpose <strong>of</strong> L.<br />

If any leading principal submatrix (a square submatrix in the upper-left corner) is singular then this method<br />

will fail with a ValueError.<br />

ALGORITHM:<br />

The algorithm employed only uses field operations, but the compuation <strong>of</strong> each diagonal entry has the<br />

potential for division by zero. The number <strong>of</strong> operations is <strong>of</strong> order n 3 /3, which is half the count for<br />

an LU decomposition. This makes it an appropriate c<strong>and</strong>idate for solving systems with symmetric (or<br />

Hermitian) coefficient matrices.<br />

EXAMPLES:<br />

There is no requirement that a matrix be positive definite, as indicated by the negative entries in the resulting<br />

diagonal matrix. The default is that the input matrix is symmetric.<br />

sage: A = matrix(QQ, [[ 3, -6, 9, 6, -9],<br />

... [-6, 11, -16, -11, 17],<br />

... [ 9, -16, 28, 16, -40],<br />

... [ 6, -11, 16, 9, -19],<br />

... [-9, 17, -40, -19, 68]])<br />

sage: A.is_symmetric()<br />

True<br />

sage: L, d = A.indefinite_factorization()<br />

sage: D = diagonal_matrix(d)<br />

sage: L<br />

[ 1 0 0 0 0]<br />

181

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

Saved successfully!

Ooh no, something went wrong!