I am working on a problem where the following equation came up


$${\bf X}\_1{\bf A}{\bf X}\_2{\bf A}^T{\bf X}\_3{\bf A}-{\bf X}\_4={\bf A}$$


where ${\bf A}$ is an arbitrary $n\times n$ and ${\bf X}\_i$s are unknown diagonal real matrices.
My question is if it is feasible and if there is a computationally tractable way to solve it.



Feasibility of a matrix equation
Looking at it entry-by-entry, you have $n^2$ equations in $4n$ variables. However, there is some symmetry here since multiplying X1, X2, X3 respectively by scalars whose product is 1 leaves the result unchanged. So there are really just $4n-2$ degrees of freedom rather than 4n. If $n \ge 4$ we have $n^2 > 4n - 2$ so I would expect there to be no solutions in 
general. If $n \le 3$ we have $n^2 < 4n - 2$ and I would expect there to be infinitely many solutions. Groebner basis methods may be able to find actual solutions if n is small. 


