# Linear transformation of a block diagonal matrix

Given two full rank matrices $\mathbf{X}$ and $\mathbf{Y}$ of size $4 \times 4$. Each elements of the matrix are non-zero (randomly chosen). We can find a linear transformation matrix $\mathbf{A}$ such that $\mathbf{Y = AX}$. The solution will be $\mathbf{A = Y X^{-1}}$. Now a constraint is added that the matrix $\mathbf{A}$ is block diagonal with two blocks and each block of size $2 \times 2$. Also, the column vectors in $\mathbf{X}$ and $\mathbf{Y}$ can be chosen from subspaces of size $2$. (Each columns are chosen from different subspaces - That is eight subspaces in total). These subspaces are given say, $S_i$ for $i = 1,2,\ldots,8$. How to choose the columns vectors so that it is possible to find a block diagonal $\mathbf{A}$ matrix?

ps: some mathematical term or concept related to this or some geometrical interpretation of this would be of much help.

Thank you.

-
Apparently I'm missing something. If you want $\mathbf{Y = AX}$ and $\mathbf Y$ and $\mathbf X$ are already determined, then it's not very likely for $\mathbf A$ to be block-diagonal... what's your actual problem? – J. M. Sep 13 '11 at 11:34
Thanks. you are right. i will modify the problem and clearly state it. – karthik Sep 13 '11 at 11:45

Now a constraint is added that the matrix $A$ is block diagonal with two blocks and each block of size $2 \times 2$. Can one still find a linear transformation matrix $A$ such that $Y=AX$?
What happens if $X$ is the identity and $Y$ does not have blocks of size $2 \times 2$?
Using matrix inversion lemma, partition $X,Y$ according to $A$ and write down the inverse of $X=\begin{bmatrix} Q&S\\R&T\end{bmatrix}$ by defining $\nabla := (Q-ST^{-1}R)^{-1}$: $$X^{-1} = \begin{bmatrix} \nabla & -\nabla ST^{-1} \\ -T^{-1}R\nabla & T^{-1}R\nabla ST^{-1}+T^{-1} \end{bmatrix}$$ Then, in a quite ugly fashion you can obtain solvability conditions from $$\begin{bmatrix}A_{1} &0\\0&A_{2}\end{bmatrix} = \begin{bmatrix}\star &M\\N &\star \end{bmatrix}$$ where $\star$ denotes the blocks that we are not interested and \begin{align} M &= \left(-Y_{11}\nabla S + Y_{12}(T^{-1}R\nabla S+I)\right)T^{-1}\\ N &= (Y_{21}-Y_{22}T^{-1}R)\nabla \end{align} From $M=0$ and $N=0$, you can characterize the matrices which would satisfy the $AX = Y$. Note that $T,\nabla$ are invertible, hence you have $$Y_{11}\nabla S = Y_{12}(T^{-1}R\nabla S+I)$$ and $$Y_{21} = Y_{22}T^{-1}R$$ you can obtain two more from by applying the matrix inversion lemma to the other diagonal block and you can simply solve the resulting equations when $X$ is given.