# Checking conjugacy of two matrices

1. I want to check whether or not two matrices are conjugate. I need to check conjugacy for two matrices in $SL(2,\mathbb{Z})$. How to do it ? How to do it for any general ring or field ? (Notice that I just want to verify whether two given matrices are conjugate or not, I don't need the actual matrices; meaning that say $X$ and $Y$ are conjugates and $AXA^{-1}=Y$. I just want to know if or not $X$ and $Y$ are conjugates, I don't need the matrix $A$)

2. Extending the previous question, say $AXA^{-1}=Y$. Then we can solve the system of linear equations $AX=YA$ to find out $A$. But is there any command which can directly find $A$ ?

edit retag close merge delete

Sort by » oldest newest most voted
1. You can look at the is_similar method for matrices, see this page for the documentation and examples.

2. You can get the transformation matrix A by setting the transformation parameter to True. Note that, since you are working with integer matrices, the transformation matrix will be in the algebraic field QQbar, you can get it back to ZZ as follows:

sage: A = X.is_similar(Y, transformation=True)[1].change_ring(ZZ)

more