# Solve matrix equations involving vectorization and Kronecker product

I want to find solutions for matrices $$A\in \mathbb{R}^{m\times n}$$ and $$B\in \mathbb{R}^{n\times m}$$ in the following equations:

$$\left\{ \begin{matrix} A^TM_1 = A^T(AB\odot M_2) \\ M_1B^T = (AB\odot M_2) B^T \end{matrix} \right.,$$ where $$M_1,M_2\in \mathbb{R}^{m\times m}$$ are known invertible matrices, and $$\odot$$ represents Hardamard product. Through vectorization we can have the following equations: $$\left\{ \begin{matrix} (I\otimes A^T) \operatorname{vec}(M_1) = (I \otimes A^T)\operatorname{diag}(\operatorname{vec}(M_2)) (I \otimes A)\operatorname{vec}(B) \\ (B\otimes I) \operatorname{vec}(M_1) = (B\otimes I)\operatorname{diag}(\operatorname{vec}(M_2)) (B^T\otimes I)\operatorname{vec}(A) \end{matrix} \right.,$$ where $$\otimes$$ represents Kronecker product, $$\operatorname{diag}()$$ denotes the diagonal matrix. However, I'm stuck on this step. We get $$\operatorname{vec}(B)$$ in the first equation, but how to transform it into $$(B\otimes I)$$?

• Combine the equations \eqalign{ &(AB\odot M_2) = M_1 \\ &AB = (M_1\oslash M_2) \\ } now pick any method (LU, QR, etc) to find acceptable factors $A,B$
– greg
Apr 21 at 17:27
• @greg Well, $A$ is not a square matrix, so I don't think you can simply remove the $A^T$ on both sides. Apr 22 at 11:40

To expand on my comment, reduce the two equations to a single equation $$AB \;=\; C \;=\; (M_1\oslash M_2)$$ To solve this equation, randomly initialize $$B\:$$ then iterate using alternating pseudoinverses \eqalign{ &B \;\;= &B_0 \\ &k \;\;= &0 \\ &{\rm repeat} \\ &&A_{k+1} = CB_k^+ \\ &&B_{k+1} = A_{k+1}^+C \\ &&k = k+{\tt1} \\ &{\rm until}&\|C-A_kB_k\| \le 10^{-12} \\ } If $$m\le n$$ this will converge in a single iteration (assuming that a solution exists).
Each $$B_0$$ usually leads to a different solution.
Since $$AB=(AZ)(Z^{-1}B)$$ for any invertible $$Z$$, an infinite number of solutions are possible.