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

...<br />

Free module <strong>of</strong> degree 7 <strong>and</strong> rank 3 over Integer Ring<br />

Echelon basis matrix:<br />

[ 1 12 3 14 -3 -10 1]<br />

[ 0 35 0 25 -1 -31 17]<br />

[ 0 0 7 12 -3 -1 -8]<br />

sage: set_verbose(0)<br />

sage: D == S<br />

True<br />

Over Principal Ideal Domains:<br />

Kernels can be computed using Smith normal form. Only the default algorithm is available, <strong>and</strong> the ‘pivot’<br />

basis format is not available.<br />

sage: R. = QQ[]<br />

sage: A = matrix(R, [[ 1, y, 1+y^2],<br />

... [y^3, y^2, 2*y^3]])<br />

sage: E = A.right_kernel_matrix(algorithm=’default’, basis=’echelon’); E<br />

[-1 -y 1]<br />

sage: A*E.transpose() == zero_matrix(ZZ, 2, 1)<br />

True<br />

It can be computationally expensive to determine if an integral domain is a principal ideal domain. The<br />

Smith normal form routine can fail for non-PIDs, as in this example.<br />

sage: D. = ZZ[]<br />

sage: A = matrix(D, 2, 2, [[x^2 - x, -x + 5],<br />

... [x^2 - 8, -x + 2]])<br />

sage: A.right_kernel_matrix()<br />

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

...<br />

ArithmeticError: Ideal Ideal (x^2 - x, x^2 - 8) <strong>of</strong> Univariate Polynomial Ring in x over Inte<br />

We test that the domain code is called for domains that lack any extra structure.<br />

sage: R. = QQ[]<br />

sage: A = matrix(R, [[ 1, y, 1+y^2],<br />

... [y^3, y^2, 2*y^3]])<br />

sage: set_verbose(1)<br />

sage: A.right_kernel(algorithm=’default’, basis=’echelon’)<br />

verbose ...<br />

verbose 1 () computing right kernel matrix over a domain for 2x3 matrix<br />

verbose 1 () done computing right kernel matrix over a domain for 2x3 matrix<br />

...<br />

Free module <strong>of</strong> degree 3 <strong>and</strong> rank 1 over Univariate Polynomial Ring in y over Rational Field<br />

Echelon basis matrix:<br />

[-1 -y 1]<br />

sage: set_verbose(0)<br />

Trivial Cases:<br />

We test two trivial cases. Any possible values for the keywords (algorithm, basis) will return identical<br />

results.<br />

sage: A = matrix(ZZ, 0, 2)<br />

sage: A.right_kernel_matrix()<br />

[1 0]<br />

[0 1]<br />

sage: A = matrix(FiniteField(7), 2, 0)<br />

247

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

Saved successfully!

Ooh no, something went wrong!