# How unique is "the" matrix that conjugates a specified pair?

Let $$A$$ and $$B$$ be two fixed similar matrices, and $$X$$ and $$Y$$ be matrices such that $$A=XBX^{-1}$$ and $$A=YBY^{-1}$$. Clearly we cannot conclude that $$X=Y$$ since for instance $$X$$ could be a scalar multiple of $$Y$$. Indeed, we know that if $$X$$ and $$Y$$ are any two matrices such that $$Y^{-1}X$$ commutes with $$B$$, then $$YBY^{-1} = YB(Y^{-1}X)X^{-1} = Y(Y^{-1}X)BX^{-1} =XBX^{-1}.$$

Question: Is this the worst that can happen? That strikes me as unlikely— I see no obvious reason that the set of "similarity matrices for $$(A,B)$$" couldn't be even larger. Assuming this is true, is there a nice characterization of this set? (If not, have its properties been studied by folks before?)

Motivation: I have a module homomorphism $$T:\Bbb Z^n\to \Bbb Z^n$$ which is naturally expressed in a specialized basis $$(f_i)$$, and I also computed its action with respect to the standard basis $$(e_i)$$. I extended it to a linear map $$\Bbb Q^n\to\Bbb Q^n$$ and computed its rational canonical form $$R$$.

In the abstracted notation above, the $$A$$ that I care about is $$[T]_{(f_i)}$$ and the $$B$$ that I care about is $$R$$. Using a particular (naive) algorithm, I can compute a particular choice of conjugating matrix to get $$A$$ to be in rational canonical form; that is the $$X$$ that I care about. The $$Y$$ that I care about is what this algorithm spits out if I first do a change of basis to $$[T]_{(e_i)}$$.

In doing so, I observed a phenomenon that, because I was wrapped up in some problem-specific details, I found very counterintuitive at the time: there is a prime number $$p$$ which shows up in the denominators of the entries in $$Y$$ but does not appear in any denominators of the entries in $$X$$. Considering the objection from the first paragraph, I am less mystified. But this got me to wonder if anything useful can be recovered from this general situation.

• I just saw math.stackexchange.com/questions/275746/…; this looks like the same question. Feel free to delete this for decluttering purposes, or keep it for searchability purposes; I don't care to dig through meta to find out what the trend of the moment is. May 11 '19 at 17:40
• Answer: no, this isn't the worst which can happen. We sometimes have more freedom to chose from such conjugating matrices (examples for $3\times 3$-matrices already show this). Are you working in $M_n(\Bbb Q)$, or in $M_n(\Bbb Z)$? A trivial example is $A=B=I$. Then you can choose any invertible $X$. May 11 '19 at 18:10