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

sage: t.maxspin(v)<br />

[(1, 0, 0), (0, 1, 2), (15, 18, 21)]<br />

sage: k = t.kernel(); k<br />

Vector space <strong>of</strong> degree 3 <strong>and</strong> dimension 1 over Rational Field<br />

Basis matrix:<br />

[ 1 -2 1]<br />

sage: t.maxspin(k.0)<br />

[(1, -2, 1)]<br />

minimal_polynomial(var=’x’, **kwds)<br />

This is a synonym for self.minpoly<br />

EXAMPLES:<br />

sage: a = matrix(QQ, 4, range(16))<br />

sage: a.minimal_polynomial(’z’)<br />

z^3 - 30*z^2 - 80*z<br />

sage: a.minpoly()<br />

x^3 - 30*x^2 - 80*x<br />

minors(k)<br />

Return the list <strong>of</strong> all k × k minors <strong>of</strong> self.<br />

Let A be an m × n matrix <strong>and</strong> k an integer with 0 ≤ k, k ≤ m <strong>and</strong> k ≤ n. A k × k minor <strong>of</strong> A is the<br />

determinant <strong>of</strong> a k × k matrix obtained from A by deleting m − k rows <strong>and</strong> n − k columns. There are no<br />

k × k minors <strong>of</strong> A if k is larger than either m or n.<br />

The returned list is sorted in lexicographical row major ordering, e.g., if A is a 3×3 matrix then the minors<br />

returned are with these rows/columns: [ [0, 1]x[0, 1], [0, 1]x[0, 2], [0, 1]x[1, 2], [0, 2]x[0, 1], [0, 2]x[0, 2],<br />

[0, 2]x[1, 2], [1, 2]x[0, 1], [1, 2]x[0, 2], [1, 2]x[1, 2] ].<br />

INPUT:<br />

•k – integer<br />

EXAMPLES:<br />

sage: A = Matrix(ZZ,2,3,[1,2,3,4,5,6]); A<br />

[1 2 3]<br />

[4 5 6]<br />

sage: A.minors(2)<br />

[-3, -6, -3]<br />

sage: A.minors(1)<br />

[1, 2, 3, 4, 5, 6]<br />

sage: A.minors(0)<br />

[1]<br />

sage: A.minors(5)<br />

[]<br />

sage: k = GF(37)<br />

sage: P. = PolynomialRing(k)<br />

sage: A = Matrix(P,2,3,[x0*x1, x0, x1, x2, x2 + 16, x2 + 5*x1 ])<br />

sage: A.minors(2)<br />

[x0*x1*x2 + 16*x0*x1 - x0*x2, 5*x0*x1^2 + x0*x1*x2 - x1*x2, 5*x0*x1 + x0*x2 - x1*x2 - 16*x1]<br />

minpoly(var=’x’, **kwds)<br />

Return the minimal polynomial <strong>of</strong> self.<br />

This uses a simplistic - <strong>and</strong> potentially very very slow - algorithm that involves computing kernels to<br />

determine the powers <strong>of</strong> the factors <strong>of</strong> the charpoly that divide the minpoly.<br />

214 Chapter 7. Base class for matrices, part 2

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

Saved successfully!

Ooh no, something went wrong!