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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<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 complex subfield <strong>of</strong> the complex numbers.<br />

sage: C. = CyclotomicField(5)<br />

sage: A = matrix(C, [[ -z^3 - 2*z, -z^3 - 1, 2*z^3 - 2*z^2 + 2*z,<br />

... [ z^3 - 2*z^2 + 1, -z^3 + 2*z^2 - z - 1, -1,<br />

... [-1/2*z^3 - 2*z^2 + z + 1, -z^3 + z - 2, -2*z^3 + 1/2*z^2, 2<br />

sage: G, M = A.gram_schmidt(orthonormal=False)<br />

sage: G<br />

[ -z^3 - 2*z<br />

[ 155/139*z^3 - 161/139*z^2 + 31/139*z + 13/139 -175/139*z<br />

[-10359/19841*z^3 - 36739/39682*z^2 + 24961/39682*z - 11879/39682 -28209/39682*z^3 - 3671/1<br />

sage: M<br />

[ 1<br />

[ 14/139*z^3 + 47/139*z^2 + 145/139*z + 95/139<br />

[ -7/278*z^3 + 199/278*z^2 + 183/139*z + 175/278 -3785/39682*z^3 + 3346/19841*z<br />

sage: M*G - A<br />

[0 0 0 0]<br />

[0 0 0 0]<br />

[0 0 0 0]<br />

sage: G*G.conjugate().transpose()<br />

[ 15*z^3 + 15*z^2 + 28<br />

[ 0 463/139*z^3 + 463/139*z^<br />

[ 0<br />

sage: G.row_space() == A.row_space()<br />

True<br />

A slightly edited legacy example.<br />

sage: A = matrix(ZZ, 3, [-1, 2, 5, -11, 1, 1, 1, -1, -3]); A<br />

[ -1 2 5]<br />

[-11 1 1]<br />

[ 1 -1 -3]<br />

sage: G, mu = A.gram_schmidt()<br />

sage: G<br />

[ -1 2 5]<br />

[ -52/5 -1/5 -2]<br />

[ 2/187 36/187 -14/187]<br />

sage: mu<br />

[ 1 0 0]<br />

[ 3/5 1 0]<br />

[ -3/5 -7/187 1]<br />

sage: G.row(0) * G.row(1)<br />

0<br />

sage: G.row(0) * G.row(2)<br />

0<br />

sage: G.row(1) * G.row(2)<br />

0<br />

The relation between mu <strong>and</strong> A is as follows.<br />

sage: mu*G == A<br />

True<br />

hadamard_bound()<br />

Return an int n such that the absolute value <strong>of</strong> the determinant <strong>of</strong> this matrix is at most 10 n .<br />

This is got using both the row norms <strong>and</strong> the column norms.<br />

This function only makes sense when the base field can be coerced to the real double field RDF or the<br />

MPFR Real Field with 53-bits precision.<br />

178 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!