Why is Tr$(A (\vec{1}\vec{1}^T)B (\vec{1}\vec{1}^T)) = \mathrm{Tr}(A (\vec{1}\vec{1}^T))\mathrm{Tr}(B (\vec{1}\vec{1}^T))$ for all matrices $A,B$?

81 Views Asked by At

Suppose $(\vec1 \vec 1^T)$ denote the matrix of ones. I noticed while doing numerics that $\mathrm{Tr}(A (\vec{1}\vec{1}^T)B (\vec{1}\vec{1}^T)) = \mathrm{Tr}(A (\vec{1}\vec{1}^T))\mathrm{Tr}(B (\vec{1}\vec{1}^T))$ for all matrices $A,B$ I was working on. Why is that? Can we prove it easily?