Let M be the set of all n by n matrices with integral entries. For A and B in M, how can I get an invertible matrix X in M with AX=XB in Sage.
I can partially solve that problem in GAP following method.
V={ X in Mn(QQ) | AX=XB } (V is a vector space over QQ) Basis(V)={B_1,B_2, ..., B_k} (I wonder which number k it is according to the changes of A and B.) Make X=a_1B_1 + ... +a_kB_k , a_i in some interval. Check two things which are X in Mn(ZZ) and the existence of the inverse of X in Mn(ZZ).
I can find such X for some easy matrices A,B.
How can I solve this problem in Sage?
Thanks.