0

I have a matrix equation which is of the form (X * A) $\odot$ X. Is there any way at all to represent this as an equation that can consist of any matrix operators besides the Hadamard product itself. I have read similar queries but the answers involve either a vectorisation or a Kronecker product. I would like to know if there is a way that does not involve either of these two methods. The closest answer I have for this is in Express Hadamard product as a normal matrix product where someone mentioned it is impossible to do so. Any information or advice on this issue is appreciated.

Just to provide more information, the resultant matrix of the aforementioned matrix equation will have, at each element, the value $$ x_{i,j} * [x_{i+1,j} - x_{i-1,j}] $$ where $x_{i,j}$ is the element of X at row i and column j. For this equation, my A matrix consists of -1 and +1 values at alternating rows(except boundary values of course). However, if this equation can be represented as any matrix form besides the one I mentioned above, I am willing to accept that as well. I just need to represent a matrix with the above equation in each element as some form of linear matrix equation.

  • 1
    Every linear map between two matrix spaces can be expressed as a sum of matrix products, but whether it is worth doing so is quite debatable. – user1551 Jul 06 '23 at 00:15
  • Ah so it is possible? Could you please tell me how? At least for the specific problem I have mentioned? (Assuming all matrices are real-valued) – Robby Ram Jul 06 '23 at 00:25
  • 1
    This post shows how you can replace Hadamard products with double-contraction products and a 6th order tensor. It sounds complicated but it actually simplifies some calculations, e.g. gradients. – greg Jul 29 '23 at 15:28

1 Answers1

1

Let $\{e_1,e_2,\ldots,e_n\}$ be the standard basis of $\mathbb R^n$ and $E_{ij}=e_ie_j^T$, the matrix whose only nonzero element is a $1$ at the $(i,j)$-th position. For any $X,Y\in\mathbb R^{n\times n}$, we have $$ \begin{aligned} Y\odot X &=\sum_{i=1}^n\sum_{j=1}^ny_{ij}x_{ij}E_{ij}\\ &=\sum_{i=1}^n\sum_{j=1}^ny_{ij}x_{ij}e_ie_j^T\\ &=\sum_{i=1}^n\sum_{j=1}^ne_i(y_{ij})(x_{ij})e_j^T\\ &=\sum_{i=1}^n\sum_{j=1}^ne_i(e_i^TYe_j)(e_i^TXe_j)e_j^T\\ &=\sum_{i=1}^n\sum_{j=1}^n(e_ie_i^T)Y(e_je_i^T)X(e_je_j^T)\\ &=\sum_{i=1}^n\sum_{j=1}^nE_{ii}YE_{ji}XE_{jj}.\\ \end{aligned} $$ In particular, $(XA)\odot X=\sum_{i=1}^n\sum_{j=1}^nE_{ii}XAE_{ji}XE_{jj}$.

user1551
  • 149,263
  • Ah I was afraid this would be the only solution (besides a Kronecker product or some vectorisation approach of course). I came to this conclusion as well but since I do not have a very mathematically sound background I was hoping there was something fundamental I was missing. Thank you for your prompt and informed response. Sadly I am a very new member and do not have the reputation to upvote this answer, but know that you have saved me from pulling an all-nighter. Thank you once again. – Robby Ram Jul 06 '23 at 07:56