# Finding a transformation between two matrices

1. May 10, 2013

### epsi00

How do we go about finding the transformation that was used to go from one matrix to another ( provided of course that the two are linked by a transformation) in general if all we have is two matrices.

2. May 10, 2013

### HallsofIvy

Staff Emeritus
IF two matrices are equivalent, that is, A= P^{-1}BP or, equivalently PA= BP, for some matrix P, then they have the same eigenvalues and the corresponding eigenvectors correspond to the same vectors written in different bases. P is the matrix giving the transformation from one basis to another.

3. May 12, 2013

HallsofIvy answered the question for the specific case that the two matrices are equivalent, and is probably what epsi00 is looking for. If so, read no further.

However, could it be that epsi00 is asking a more general and basic question, that is, given an n x m matrix A and a n x p matrix B such that A and B are not necessarily equivalent, how does one find the m x p matrix C such that AC = B? That is, how to find C = A-1B?

4. May 12, 2013

### AlephZero

In general, you can't. An obvious counterexample is if A = 0 and B ≠ 0.

Also your notation of A-1 does't mean anything if A is not square.

A good way to do it numerically would be find the singular value decomposition of $A = U \Sigma V^T$ and then $C = V \Sigma^{-1} U^T B$. That works for rectangular as well as square matrices. If some of the singular values are zero, there will not be a solution for an arbitrary matrix C, but you can find a least-squares solution that minimizes ||AC-B||. If the minimum is zero for a particular matrix C, the least-squares solution is exact.

5. May 12, 2013