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

A singular matrix over the field QQ.<br />

sage: A = matrix(QQ, 4, [-1,2,-3,6,0,-1,-1,0,-1,1,-5,7,-1,6,5,2])<br />

sage: A.is_singular()<br />

True<br />

sage: A.right_kernel().dimension()<br />

1<br />

A matrix that is not singular, i.e. nonsingular, over a field.<br />

sage: B = matrix(QQ, 4, [1,-3,-1,-5,2,-5,-2,-7,-2,5,3,4,-1,4,2,6])<br />

sage: B.is_singular()<br />

False<br />

sage: B.left_kernel().dimension()<br />

0<br />

For “rectangular” matrices, invertibility is always False, but asking about singularity will give an error.<br />

sage: C = matrix(QQ, 5, range(30))<br />

sage: C.is_invertible()<br />

False<br />

sage: C.is_singular()<br />

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

...<br />

ValueError: self must be a square matrix<br />

When the base ring is not a field, then a matrix may be both not invertible <strong>and</strong> not singular.<br />

sage: D = matrix(ZZ, 4, [2,0,-4,8,2,1,-2,7,2,5,7,0,0,1,4,-6])<br />

sage: D.is_invertible()<br />

False<br />

sage: D.is_singular()<br />

False<br />

sage: d = D.determinant(); d<br />

2<br />

sage: d.is_unit()<br />

False<br />

is_skew_symmetric()<br />

Return True if self is a skew-symmetric matrix.<br />

Here, “skew-symmetric matrix” means a square matrix A satisfying A T = −A. It does not require that<br />

the diagonal entries <strong>of</strong> A are 0 (although this automatically follows from A T = −A when 2 is invertible in<br />

the ground ring over which the matrix is considered). Skew-symmetric matrices A whose diagonal entries<br />

are 0 are said to be “alternating”, <strong>and</strong> this property is checked by the is_alternating() method.<br />

EXAMPLES:<br />

sage: m = matrix(QQ, [[0,2], [-2,0]])<br />

sage: m.is_skew_symmetric()<br />

True<br />

sage: m = matrix(QQ, [[1,2], [2,1]])<br />

sage: m.is_skew_symmetric()<br />

False<br />

Skew-symmetric is not the same as alternating when 2 is a zero-divisor in the ground ring:<br />

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

sage: n.is_skew_symmetric()<br />

True<br />

76 Chapter 5. Base class for matrices, part 0

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

Saved successfully!

Ooh no, something went wrong!