ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 15 Oct 2016 12:25:27 +0200Checking Similarity of Matrices over Finite Fieldshttps://ask.sagemath.org/question/25352/checking-similarity-of-matrices-over-finite-fields/ Hi,
There is a command in SAGE which allows us to check the similarity of two matrices over Q (or sth); is_similar()
But,
when trying to check two matrices' similarity over Finite Fields it usually gives the error:
"unable to compute Jordan canonical form for matrix"
I would be appreciated if someone can help me to construct a practical way to check the similarity of two matrices with entries in Finite Fields.
Thanks in advance,Sun, 28 Dec 2014 00:55:18 +0100https://ask.sagemath.org/question/25352/checking-similarity-of-matrices-over-finite-fields/Comment by FrédéricC for <p>Hi,
There is a command in SAGE which allows us to check the similarity of two matrices over Q (or sth); is_similar()</p>
<p>But,
when trying to check two matrices' similarity over Finite Fields it usually gives the error:
"unable to compute Jordan canonical form for matrix"</p>
<p>I would be appreciated if someone can help me to construct a practical way to check the similarity of two matrices with entries in Finite Fields.</p>
<p>Thanks in advance,</p>
https://ask.sagemath.org/question/25352/checking-similarity-of-matrices-over-finite-fields/?comment=35152#post-id-35152See https://trac.sagemath.org/ticket/18505Sat, 15 Oct 2016 12:25:27 +0200https://ask.sagemath.org/question/25352/checking-similarity-of-matrices-over-finite-fields/?comment=35152#post-id-35152Answer by FrédéricC for <p>Hi,
There is a command in SAGE which allows us to check the similarity of two matrices over Q (or sth); is_similar()</p>
<p>But,
when trying to check two matrices' similarity over Finite Fields it usually gives the error:
"unable to compute Jordan canonical form for matrix"</p>
<p>I would be appreciated if someone can help me to construct a practical way to check the similarity of two matrices with entries in Finite Fields.</p>
<p>Thanks in advance,</p>
https://ask.sagemath.org/question/25352/checking-similarity-of-matrices-over-finite-fields/?answer=25353#post-id-25353The problem is that some eigenvalues do not lie in the finite field. This prevents the existence of the Jordan form. You need to extend coefficients.
sage: M = matrix(GF(13),[[4,6],[5,9]])
sage: M.jordan_form()
RuntimeError: Some eigenvalue does not exist in Finite Field of size 13.
sage: K = M.parent().base_ring()
sage: L = K.extension(M.minimal_polynomial(),'a')
sage: ML = M.change_ring(L)
sage: ML.jordan_form()
[12*a| 0]
[----+----]
[ 0| a]
sage: ML.is_similar(ML**2)
FalseSun, 28 Dec 2014 08:28:21 +0100https://ask.sagemath.org/question/25352/checking-similarity-of-matrices-over-finite-fields/?answer=25353#post-id-25353