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

True<br />

sage: [A[:i,:i].determinant() for i in range(1,A.nrows()+1)]<br />

[2, 2, 6]<br />

TESTS:<br />

If the base ring lacks a conjugate method, it will be assumed to not be Hermitian <strong>and</strong> thus symmetric.<br />

If the base ring does not make sense as a subfield <strong>of</strong> the reals, then this routine will fail since comparison<br />

to zero is meaningless.<br />

sage: F. = FiniteField(5^3)<br />

sage: a.conjugate()<br />

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

...<br />

AttributeError: ’sage.rings.finite_rings.element_givaro.FiniteField_givaroElement’<br />

object has no attribute ’conjugate’<br />

sage: A = matrix(F,<br />

... [[ a^2 + 2*a, 4*a^2 + 3*a + 4, 3*a^2 + a, 2*a^2 + 2*a + 1],<br />

... [4*a^2 + 3*a + 4, 4*a^2 + 2, 3*a, 2*a^2 + 4*a + 2],<br />

... [ 3*a^2 + a, 3*a, 3*a^2 + 2, 3*a^2 + 2*a + 3],<br />

... [2*a^2 + 2*a + 1, 2*a^2 + 4*a + 2, 3*a^2 + 2*a + 3, 3*a^2 + 2*a + 4]])<br />

sage: A.is_positive_definite()<br />

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

...<br />

TypeError: cannot convert computations from<br />

Finite Field in a <strong>of</strong> size 5^3 into real numbers<br />

AUTHOR:<br />

•Rob Beezer (2012-05-24)<br />

is_scalar(a=None)<br />

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

INPUT<br />

•base_ring element a, which is chosen as self[0][0] if a = None<br />

OUTPUT<br />

•whether self is a scalar matrix (in fact the scalar matrix aI if a is input)<br />

EXAMPLES:<br />

sage: m = matrix(QQ,2,range(4))<br />

sage: m.is_scalar(5)<br />

False<br />

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

sage: m.is_scalar(5)<br />

True<br />

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

sage: m.is_scalar(1)<br />

True<br />

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

sage: m.is_scalar(1)<br />

False<br />

is_similar(other, transformation=False)<br />

Returns True if self <strong>and</strong> other are similar, i.e. related by a change-<strong>of</strong>-basis matrix.<br />

INPUT:<br />

191

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

Saved successfully!

Ooh no, something went wrong!