# Trace Sign of Matrices from Outer Products of Vectors

I’m investigating the properties of the trace of matrices that are formed by the outer products of vectors. Specifically, I’m interested in the sign of the trace for matrices constructed as the product of outer products of one or more vectors.

For example, consider a vector $$u$$. The matrix $$u \cdot u^T$$ is the outer product of $$u$$ with itself. The trace of this matrix, which is the sum of the squares of the elements of $$u$$, is always non-negative: $$\operatorname{Tr}(u \cdot u^T) = \sum u_i ^2$$.

Extending this to two vectors $$u$$ and $$v$$, the product matrix $$u \cdot u^T \cdot v \cdot v^T$$ also has a non-negative trace. If I’m not mistaken, the trace in this case is the sum of the element-wise products of the squares of the corresponding elements of $$u$$ and $$v$$, which, again, are non-negative. $$\operatorname{Tr}(u \cdot u^T \cdot v \cdot v^T) = \sum u_i ^2 \cdot v_i ^2$$.

These observations lead to a general question: For a set of vectors $${v_1, v_2, \ldots, v_n}$$, is the trace of the matrix formed by the product of their outer products (i.e., $$v_1 v_1^T v_2 v_2^T \cdot \ldots \cdot v_n v_n^T$$) always non-negative (and equal to $$\sum (v_1)_i^2 \ldots (v_n)_i^2$$? If so, can we provide a general proof of this?

No, $$\operatorname{Tr}(uu^Tvv^T)$$ is not equal to $$\sum_iu_i^2v_i^2$$. For a counterexample, consider $$u=(1,1)^T$$ and $$v=(1,-1)^T$$.
Matrix trace has the cyclic property that $$\operatorname{Tr}(AB)=\operatorname{Tr}(BA)$$. Thus $$\operatorname{Tr}(uu^Tvv^T) =\operatorname{Tr}(u^Tvv^Tu) =(u^Tv)(v^Tu) =(u^Tv)^2 =\left(\sum_iu_iv_i\right)^2,$$ which is nonnegative when $$u$$ and $$v$$ are real vectors, because it is a squared polynomial. This result does not generalise to three or more rank-one matrices. E.g. $$\operatorname{Tr}(uu^Tvv^Tww^T) =\operatorname{Tr}(u^Tvv^Tww^Tu) =(u^Tv)(v^Tw)(w^Tu)$$ is equal to $$-1$$ when $$u=(1,1)^T,\ v=(1,0)^T$$ and $$w=(1,-2)^T$$.