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

but yet the diagonal cannot be completely arbitrary in this case:<br />

sage: n = matrix(Zmod(4), [[0, 1], [-1, 3]])<br />

sage: n.is_skew_symmetric()<br />

False<br />

is_skew_symmetrizable(return_diag=False, positive=True)<br />

This function takes a square matrix over an ordered integral domain <strong>and</strong> checks if it is skew-symmetrizable.<br />

A matrix B is skew-symmetrizable iff there exists an invertible diagonal matrix D such that DB is skewsymmetric.<br />

Warning: Expects self to be a matrix over an ordered integral domain.<br />

INPUT:<br />

•return_diag – bool(default:False) if True <strong>and</strong> self is skew-symmetrizable the diagonal entries<br />

<strong>of</strong> the matrix D are returned.<br />

•positive – bool(default:True) if True, the condition that D has positive entries is added.<br />

OUTPUT:<br />

•True – if self is skew-symmetrizable <strong>and</strong> return_diag is False<br />

•the diagonal entries <strong>of</strong> a matrix D such that DB is skew-symmetric – iff self is skew-symmetrizable<br />

<strong>and</strong> return_diag is True<br />

•False – iff self is not skew-symmetrizable<br />

EXAMPLES:<br />

sage: matrix([[0,6],[3,0]]).is_skew_symmetrizable(positive=False)<br />

True<br />

sage: matrix([[0,6],[3,0]]).is_skew_symmetrizable(positive=True)<br />

False<br />

sage: M = matrix(4,[0,1,0,0,-1,0,-1,0,0,2,0,1,0,0,-1,0]); M<br />

[ 0 1 0 0]<br />

[-1 0 -1 0]<br />

[ 0 2 0 1]<br />

[ 0 0 -1 0]<br />

sage: M.is_skew_symmetrizable(return_diag=True)<br />

[1, 1, 1/2, 1/2]<br />

sage: M2 = diagonal_matrix([1,1,1/2,1/2])*M; M2<br />

[ 0 1 0 0]<br />

[ -1 0 -1 0]<br />

[ 0 1 0 1/2]<br />

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

sage: M2.is_skew_symmetric()<br />

True<br />

REFERENCES:<br />

•[FZ2001] S. Fomin, A. Zelevinsky. Cluster Algebras 1: Foundations, arXiv:math/0104151 (2001).<br />

is_sparse()<br />

Return True if this is a sparse matrix.<br />

In <strong>Sage</strong>, being sparse is a property <strong>of</strong> the underlying representation, not the number <strong>of</strong> nonzero entries.<br />

77

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

Saved successfully!

Ooh no, something went wrong!