Solve this nonlinear matrix equation?

For $M$ and $N$ two invertible square matrices of the same size $n$, consider the equation $$\forall i,j, \quad M_{ij}(M^{-1})_{ji} = N_{ij}(N^{-1})_{ji}\ .$$ Assuming we know $M$, we want to find all matrices $N$ that obey this equation. Obvious solutions are $$N_{ij} = \lambda_i \mu_j M_{ij}\ , \\ N_{ij} = \lambda_i \mu_j (M^{-1})_{ji}\ ,$$ for arbitrary vectors $\lambda_i$ and $\mu_j$.

But what are all the solutions?

• By checking what happenswith elementary transforms of $M$, the problem reduces to $M=I$. Nov 9 '17 at 8:38
• Could you please be more specific? Reducing the problem to $M=I$ (or $M$ diagonal) would help a lot, but I do not see how to do this. Nov 9 '17 at 10:56
• Actually, matrices that have zero coefficients, such that $M=I$, allow for more solutions, such as $N$ being triangular. This shows that the problem most probably cannot be easily reduced to $M=I$. Nov 9 '17 at 14:47
• There are also Hadamard matrices... Nov 9 '17 at 17:26
• Hadamard matrices are a nice idea, but we need two independent such matrices, and this exists only for certain matrix sizes, if I understand correctly. A related idea is to consider more general orthogonal matrices, then the equation becomes $M_{ij} = \epsilon_{ij} N_{ij}$ with $\epsilon_{ij}\in\{1,-1\}$, Nov 9 '17 at 20:21