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

... [3*a + 5, a + 4, 5*a + 6]])<br />

sage: A.is_similar(B)<br />

True<br />

sage: B.is_similar(A)<br />

True<br />

sage: _, T = A.is_similar(B, transformation=True)<br />

sage: T<br />

[ 1 0 0]<br />

[6*a + 1 4*a + 3 4*a + 2]<br />

[6*a + 3 3*a + 5 3*a + 6]<br />

sage: A == T.inverse()*B*T<br />

True<br />

Two matrices with different sets <strong>of</strong> eigenvalues, so they cannot possibly be similar.<br />

sage: A = matrix(QQ, [[ 2, 3, -3, -6],<br />

... [ 0, 1, -2, -8],<br />

... [-3, -3, 4, 3],<br />

... [-1, -2, 2, 6]])<br />

sage: B = matrix(QQ, [[ 1, 1, 2, 4],<br />

... [-1, 2, -3, -7],<br />

... [-2, 3, -4, -7],<br />

... [ 0, -1, 0, 0]])<br />

sage: A.eigenvalues() == B.eigenvalues()<br />

False<br />

sage: A.is_similar(B, transformation=True)<br />

(False, None)<br />

Similarity is an equivalence relation, so this routine computes a representative <strong>of</strong> the equivalence class<br />

for each matrix, the Jordan form, as provided by jordan_form(). The matrices below have identical<br />

eigenvalues (as evidenced by equal characteristic polynomials), but slightly different Jordan forms, <strong>and</strong><br />

hence are not similar.<br />

sage: A = matrix(QQ, [[ 19, -7, -29],<br />

... [-16, 11, 30],<br />

... [ 15, -7, -25]])<br />

sage: B = matrix(QQ, [[-38, -63, 42],<br />

... [ 14, 25, -14],<br />

... [-14, -21, 18]])<br />

sage: A.charpoly() == B.charpoly()<br />

True<br />

sage: A.jordan_form()<br />

[-3| 0 0]<br />

[--+-----]<br />

[ 0| 4 1]<br />

[ 0| 0 4]<br />

sage: B.jordan_form()<br />

[-3| 0| 0]<br />

[--+--+--]<br />

[ 0| 4| 0]<br />

[--+--+--]<br />

[ 0| 0| 4]<br />

sage: A.is_similar(B)<br />

False<br />

Obtaining the Jordan form requires computing the eigenvalues <strong>of</strong> the matrix, which may not lie in the<br />

field used for entries <strong>of</strong> the matrix. So the routine first checks the characteristic polynomials - if they are<br />

unequal, then the matrices cannot be similar. However, when the characteristic polynomials are equal, we<br />

must examine the Jordan form. In this case, the method may fail, EVEN when the matrices are similar.<br />

193

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

Saved successfully!

Ooh no, something went wrong!