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

The matrix must have entries from a field, <strong>and</strong> it must be an exact field.<br />

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

sage: A.is_diagonalizable()<br />

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

...<br />

ValueError: matrix entries must be from a field, not Integer Ring<br />

sage: A = matrix(RDF, 4, range(16))<br />

sage: A.is_diagonalizable()<br />

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

...<br />

ValueError: base field must be exact, not Real Double Field<br />

AUTHOR:<br />

•Rob Beezer (2011-04-01)<br />

is_normal()<br />

Returns True if the matrix commutes with its conjugate-transpose.<br />

OUTPUT:<br />

True if the matrix is square <strong>and</strong> commutes with its conjugate-transpose, <strong>and</strong> False otherwise.<br />

Normal matrices are precisely those that can be diagonalized by a unitary matrix.<br />

This routine is for matrices over exact rings <strong>and</strong> so may not work properly for matrices<br />

over RR or CC. For matrices with approximate entries, the rings <strong>of</strong> doubleprecision<br />

floating-point numbers, RDF <strong>and</strong> CDF, are a better choice since the<br />

sage.matrix.matrix_double_dense.Matrix_double_dense.is_normal() method<br />

has a tolerance parameter. This provides control over allowing for minor discrepancies between entries<br />

when checking equality.<br />

The result is cached.<br />

EXAMPLES:<br />

Hermitian matrices are normal.<br />

sage: A = matrix(QQ, 5, range(25)) + I*matrix(QQ, 5, range(0, 50, 2))<br />

sage: B = A*A.conjugate_transpose()<br />

sage: B.is_hermitian()<br />

True<br />

sage: B.is_normal()<br />

True<br />

Circulant matrices are normal.<br />

sage: G = graphs.CirculantGraph(20, [3, 7])<br />

sage: D = digraphs.Circuit(20)<br />

sage: A = 3*D.adjacency_matrix() - 5*G.adjacency_matrix()<br />

sage: A.is_normal()<br />

True<br />

Skew-symmetric matrices are normal.<br />

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

sage: B = A - A.transpose()<br />

sage: B.is_skew_symmetric()<br />

True<br />

sage: B.is_normal()<br />

True<br />

187

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

Saved successfully!

Ooh no, something went wrong!