The operation KroneckerProduct[A, IdentityMatrix[m]]
expands the matrix A
in the following way (depending on order of A
and m
):
$\left( \begin{array}{cc} a & b \\ c & d \\ \end{array} \right)\to \left( \begin{array}{cccc} a & 0 & b & 0 \\ 0 & a & 0 & b \\ c & 0 & d & 0 \\ 0 & c & 0 & d \\ \end{array} \right)$
Is there a way to code the inverse operation that would shrink ("simplify") a matrix this way?
Like
$ \left( \begin{array}{cccc} a & 0 & b & 0 \\ 0 & a & 0 & b \\ c & 0 & d & 0 \\ 0 & c & 0 & d \\ \end{array} \right)\to\left( \begin{array}{cc} a & b \\ c & d \\ \end{array} \right)$
and
$\left( \begin{array}{cccc} a & b & 0 & 0 \\ c & d & 0 & 0 \\ 0 & 0 & a & b \\ 0 & 0 & c & d \\ \end{array} \right)\to \left( \begin{array}{cc} a & b \\ c & d \\ \end{array} \right)$
I also would like if it could (optionally) shrink the matrices using complex numbers this way:
$\left( \begin{array}{cccc} a & b & f & e \\ -b & a & -e & f \\ g & h & d & c \\ -h & g & -c & d \\ \end{array} \right)\to \left( \begin{array}{cc} a+i b & f+i e \\ g+i h & d+i c \\ \end{array} \right)$
Of course, not all matrices would be shrinkable.
B[[1;;;;m,1;;;;m]]
do what you want? $\endgroup$B = KroneckerProduct[A, IdentityMatrix[m]]
of course. $\endgroup${{a}}
... $\endgroup$