I have the following problem:
Given two 2D real positive-definite symmetric matrices $M_1$ and $M_2$, find a matrix $T$ such that $ M_2=TM_1T^t$
Clearly, the solution is not unique, but I don't care too much about that. All I need is a well-defined solution - something like a principal branch.
To be concrete, let's say I have some $T_{input}$, and I generate $M_1$ randomly and calculate $M_2=TM_1T^t$. I want a function $T_{output}=f(M_1,M_2)$ that will give me the same result (which is not necessarily $T_{input}$) regardless of my choice of $M_1$.
My thoughts: For a symmetric positive definite matrix $A$, the principal square root of the matrix is uniquely defined, ans is also symmetric. One solution of of the problem is thus $T=\sqrt{M_2}\left(\sqrt{M_1}\right)^{-1}\ .$ It is easily seen that this is a solution. Since $\sqrt{M_1}\sqrt{M_1}=M_1$, we have $\left(\sqrt{M_1}\right)^{-1}M_1\left(\sqrt{M_1}\right)^{-1}=I\ ,$ and thus $ \begin{align} TM_1T^t&=\sqrt{M_2}\left(\sqrt{M_1}\right)^{-1}\ M_1\ \left(\sqrt{M_1}\right)^{-1} \sqrt{M_2}\\ &=\sqrt{M_2}\ I \ \sqrt{M_2}=M_2\\ \end{align} $
But this solution depends on the choice of $M_1$. Any suggestions will be greatly appreciated.