1
$\begingroup$

Given the following term: $$\sum_{i<j} A_{i,j} x_i A_{j,i} x_j$$

(with $A$ a square matrix and $x$ a vector) is there a nice explicit matrix expression?

I've tried: $$\sum_{i<j} A_{i,j} x_i A_{j,i} x_j = \frac{1}{2}\sum_{i,j} A_{i,j} x_i A_{j,i} x_j - \sum_{i} A_{i,i}^2 x_i^2$$

as well as the identity $\sum_{i,j}(A B)_{i,j} = tr(A B)$.

Although it looks simple, I couldn't find an expression that doesn't involve a $\sum$.

$\endgroup$
1
  • $\begingroup$ Just a possible idea: Maybe some expression involving $x^\top A x$. $\endgroup$ Jun 28, 2021 at 10:07

1 Answer 1

1
$\begingroup$

If you allow something like $D(x)$ to denote the diagonal matrix with the entries of the column vector $x$ on the diagonal, so that $$ D(\pmatrix{2\\6}) = \pmatrix{2 & 0 \\ 0 & 6}, $$ then your second formula seems to be 90% of the way there --- I think that you get $$ S = \frac12 x^t AA^T x - \left(\operatorname{tr}(D(X)A)\right)^2 $$ ...if I've managed to read the indices correctly.

$\endgroup$
2
  • $\begingroup$ Thank you! But isn't $(tr(D(x) A)^2 = (\sum_i x_i A_{ii})^2 \neq \sum_i x_i^2 A_{ii}^2 $ $\endgroup$
    – black
    Jul 2, 2021 at 9:00
  • $\begingroup$ Yep --- you're right. You get all the terms on the right, but I managed to ignore all the cross terms of the form $x_iA_{ii} x_j A_{jj}$. Looks to me as if something to do with tensor-products and/or outer products might need to come into play here, and I've never been any good with those, alas. $\endgroup$ Jul 2, 2021 at 10:02

You must log in to answer this question.

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