I have been stuck the last few days on the resolution of an equation I built for a phenomenon's modelling. Let $D_O$ and $D_H$ be square, diagonal, $n \times n$-sized matrices. Let also $H$, $O$, $W$ and $X$ be square, $n \times n$ (but not diagonal) matrices.

I want to find $H$ satisfying the following equation :

$H^T = W D_H X + D_H (W \circ H) + D_O (W \circ O)$

$A \circ B$ being the Hadamard product of $A \text{ and } B$.

What's been blocking me is the $H^T$, that complicates the resolution since I struggle to only keep one form of $H$.

I only could go a bit further than what's above :

$ \begin{align} H^T &= W D_H X + D_H (W \circ H) + D_O (W \circ O)\\ H^T &= W D_H X + (D_H W )\circ H + (D_O W) \circ O\\ H^T - (D_H W )\circ H &= W D_H X + (D_O W) \circ O \end{align}$

And this is where I'm stuck. Applying the inverse of the Hadamard on $H^T$ only seems to complicate things. I have seen answers on other threads involving the Kronecker product, but the way it works confused me a bit.

Thank you

  • $\begingroup$ What do you mean by $A \times B$? Is that ordinary matrix multiplication? Note that matrix multiplication is more typically denoted without any symbol in between, as in $AB$. $\endgroup$ Commented May 8, 2020 at 15:32
  • $\begingroup$ Yes indeed that's "classic" matrix multiplication. I'll remove the 'x' for multiplication, it's true that it brings confusion where it is not needed. $\endgroup$ Commented May 8, 2020 at 15:49

1 Answer 1


Vectorizing your equation leads to a conventional system of equations on a vector of entries. Let $\otimes$ denote the Kronecker product. Note that

  • $\operatorname{vec}(AXB) = (B^T \otimes A)\operatorname{vec}(X)$,
  • $\operatorname{vec}(B \circ X) = \operatorname{diag}(\operatorname{vec}(B)) \operatorname{vec}(X)$,
  • $\operatorname{vec}(X^T) = P\operatorname{vec}(X)$,

where $P$ denotes the permutation matrix $$ P = \sum_{i=1}^n \sum_{j=1}^n (e_j \otimes e_i)(e_i \otimes e_j)^T = \sum_{i=1}^n \sum_{j=1}^n \operatorname{vec}(E_{ij})[\operatorname{vec}(E_{ji})]^T. $$

With that, we find that vectorizing both sides of your equation yields $$ H^T = W \times D_H \times X + D_O \times (W \circ O) \implies\\ H^T - D_H \times (W \circ H) = W \times D_H \times X + D_O \times (W \circ O) \implies\\ P\operatorname{vec}(H) - (I_n \otimes D_H)\operatorname{diag}(\operatorname{vec}(W))\operatorname{vec}(H) = \operatorname{vec}[W \times D_H \times X + D_O \times (W \circ O)] \implies\\ [P - (I_n \otimes D_H)\operatorname{diag}(\operatorname{vec}(W))]\operatorname{vec}(H) = \operatorname{vec}[W \times D_H \times X + D_O \times (W \circ O)]. $$ Now, simply solve for $\operatorname{vec}(H)$, then "unvectorize".

  • $\begingroup$ I saw your solution on another post involving the Hadamard product. You should get a "Hadamard expert" badge ! Anyway you solved my problem, thanks a lot $\endgroup$ Commented May 8, 2020 at 16:57
  • $\begingroup$ @TheFamousRat I guess you mean this one. You're welcome! $\endgroup$ Commented May 8, 2020 at 17:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .