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

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

...<br />

ValueError: cannot add a multiple <strong>of</strong> a row to itself<br />

sage: E = elementary_matrix(ZZ, 5, col1=3, scale=0)<br />

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

...<br />

ValueError: scale parameter <strong>of</strong> column <strong>of</strong> elementary matrix must be non-zero<br />

AUTHOR:<br />

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

sage.matrix.constructor.identity_matrix(ring, n=0, sparse=False)<br />

This function is available as identity_matrix(...) <strong>and</strong> matrix.identity(...).<br />

Return the n × n identity matrix over the given ring.<br />

The default ring is the integers.<br />

EXAMPLES:<br />

sage: M = identity_matrix(QQ, 2); M<br />

[1 0]<br />

[0 1]<br />

sage: M.parent()<br />

Full MatrixSpace <strong>of</strong> 2 by 2 dense matrices over Rational Field<br />

sage: M = identity_matrix(2); M<br />

[1 0]<br />

[0 1]<br />

sage: M.parent()<br />

Full MatrixSpace <strong>of</strong> 2 by 2 dense matrices over Integer Ring<br />

sage: M.is_mutable()<br />

True<br />

sage: M = identity_matrix(3, sparse=True); M<br />

[1 0 0]<br />

[0 1 0]<br />

[0 0 1]<br />

sage: M.parent()<br />

Full MatrixSpace <strong>of</strong> 3 by 3 sparse matrices over Integer Ring<br />

sage: M.is_mutable()<br />

True<br />

sage.matrix.constructor.ith_to_zero_rotation_matrix(v, i, ring=None)<br />

This function is available as ith_to_zero_rotation_matrix(...) <strong>and</strong> matrix.ith_to_zero_rotation(...).<br />

Return a rotation matrix that sends the i-th coordinates <strong>of</strong> the vector v to zero by doing a rotation with the (i-1)-th<br />

coordinate.<br />

INPUT:<br />

•v‘ - vector<br />

•i - integer<br />

•ring - ring (optional, default: None) <strong>of</strong> the resulting matrix<br />

OUTPUT:<br />

A matrix<br />

EXAMPLES:<br />

36 Chapter 2. Matrix Constructor

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

Saved successfully!

Ooh no, something went wrong!