# Finding a well-defined solution to a matrix equation

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.

-
This was asked at MO... –  Ｊ. Ｍ. Jul 12 '12 at 11:57
@J.M.: As I understand the question, that MO question is a different question, but I might be misunderstanding. –  joriki Jul 12 '12 at 13:17
They are the same to me, @joriki. The $\mathbf A$ and $\mathbf B$ matrices in the MO question would correspond to the $\mathbf M_1$ and $\mathbf M_2$ matrices in OP's question. –  Ｊ. Ｍ. Jul 12 '12 at 13:25
@J.M.: I don't see the requirement "I want a function $T_{output}=f(M_1,M_2)$ that will give me the same result regardless of my choice of $M_1$" in the MO question. I'm not entirely sure I understand that requirement correctly, but under my understanding (see my answer), this is a crucial constraint that makes a solution impossible. –  joriki Jul 12 '12 at 13:31
@joriki, you're right; that certainly throws a wrench into things... –  Ｊ. Ｍ. Jul 12 '12 at 13:34

Let me restate the question, because I'm not entirely sure I understand it correctly. As I understand it, you want a function that takes $M$ and $TMT^\top$ and returns a matrix $S$ that depends only on $T$ and not on $M$, such that $SMS^\top=TMT^\top$.

This is impossible. Given $T$, since $SMS^\top=TMT^\top$ for all positive-definite symmetric $M$, we have

$$T^{-1}SMS^\top T^\top{}^{-1}=(T^{-1}S)M(T^{-1}S)^\top=M$$

for all positive-definite symmetric $M$. In particular, for $M=I$, we have $(T^{-1}S)(T^{-1}S)^\top=I$, so $T^{-1}S$ is orthogonal. Thus we have

$$(T^{-1}S)M=M(T^{-1}S)$$

for all positive-definite symmetric $M$. But the only matrices that commute with all positive-definite symmetric matrices are multiples of the identity. Thus $S=\pm T$. So your function would have to return $T$ (up to a sign), which it can't, since different $T$s can lead to the same inputs.

-
You correctly understood my question, and answered me. I don't like the answer though, because it means that I need to work harder now in my research... :( Thanks! –  yohBS Jul 12 '12 at 13:43