I have a square, semi-positive matrix $A$ and I want to compute the **sum of the products** $a(i,j)a(j,i)$ for every $i$ and $j$. Is there any easy way to perform this computation that does not involve "for"?

Thanks