Solving Quadratic Matrix Equation involving Hadamard/Element-wise Product

hadamard-productlinear algebrapositive-semidefinite

I have the following equation:

$$x^T M x = (x \circ b)^T P (x \circ b) $$

where

  • $x, b \in \mathbb{R}^D$ are vectors
  • $M, P \in \mathbb{R}^{D \times D}$ are matrices
  • $b, P$ are known
  • $\circ$ denotes the element-wise (Hadamard) product)
  • The equation holds for all $x$.

How can I solve this equation for $M$?

If it helps, I know that M and P are both symmetric positive semi-definite matrices.

Best Answer

As WimC pointed out in the comments above, $x \cdot b$ can be written as $xB$ or $Bx$ where $B=diag(b)$. Consequently:

$$x^T M x = x^T B^T P B x$$

and therefore

$$M = B^T P B$$

Related Question