Is the trace of the product of two positive semidefinite matrices always nonnegative? Is $\mbox{tr}(XY) \geq 0$ for all $X, Y \in \Bbb S_+$?
 A: Let $n \times n$ matrices $\rm A$ and $\rm B$ be symmetric and positive semidefinite. Hence, there exists an $n \times r$ matrix $\rm Q$ such that $\rm B = Q Q^\top$, and
$$\mbox{tr} \left( {\rm A} {\rm B} \right) = \mbox{tr} \left( {\rm A} {\rm Q} {\rm Q}^\top \right) = \mbox{tr} \left( {\rm Q}^\top {\rm A} {\rm Q} \right) = \sum_{i=1}^r \underbrace{{\rm q}_i^\top {\rm A} \, {\rm q}_i}_{\geq 0} \color{blue}{\geq 0}$$
where ${\rm q}_i$ is the $i$-th column of $\rm Q$ and ${\rm q}_i^\top {\rm A} \, {\rm q}_i \geq 0$ follows from the positive semidefiniteness of $\rm A$.
A: The other direction also holds: if $X$ satisfies $\operatorname{tr}(XY) \geq 0$ for all $Y \in \mathbb{S}^{n}_{+}$, then $X \in \mathbb{S}^{n}_{+}$.
Suppose $X \notin \mathbb{S}^{n}_{+}$, in particular $\exists v \in \mathbb{R}^{n}$ such that $v^{\top}Xv < 0$. Let $Y = vv^{\top}$, then $\operatorname{tr}(XY) = \operatorname{tr}(Xvv^{\top}) = \operatorname{tr}(v^{\top}Xv) = v^{\top}Xv < 0$.
A: Yes, because $\mathrm{tr}(XY)=\mathrm{tr}(X\sqrt Y\sqrt Y)=\mathrm{tr}(\sqrt Y X\sqrt Y)\geq 0$.
Positive semidefinite matrices have positive semidefinite square roots.  The trace satisfies $\mathrm{tr}(AB)=\mathrm{tr}(BA)$.  If $A$ and $X$ are positive semidefinite, then so is $AXA$.  The trace of a positive semidefinite matrix is nonnegative.
