An inequality for positive semidefinite matrices If $A$ and $B$ are positive semidefinite matrices, then
$0 ≤ {\rm tr}AB ≤ {\rm tr} A\,{\rm tr }B$.
I was wondering what are the sufficient and necessary conditions for the equality to hold ?
 A: we will give a characterisation by using the spectrum of $A$.
First we will use the inner product induced by the Frobenius norm, defined on $L(H)$ by : $\langle A,B\rangle=\operatorname{Tr}(AB^*)$ then ($A$ and $B$ are positive semidefinite) Cauchy Schwarz inequality implies that :
$$
0 \leq \langle A,B\rangle^2 \leq \langle A,A\rangle \langle B,B\rangle
\\
0 \leq \operatorname{Tr}(A B)^2 \leq \operatorname{Tr}(A^2) \operatorname{Tr}(B^2) \leq \operatorname{Tr}(A)^2 \operatorname{Tr}(B)^2
$$ 
So if we have the equality it implies that we have equality in Cauchy Schwarz inequality and this implies that $B=\alpha A$ for a scalar $\alpha$.
In particular 
$$
\alpha\operatorname{Tr}(A^2)=\operatorname{Tr}(AB)=\operatorname{Tr}(A)\operatorname{Tr}(B)=\alpha\operatorname{Tr}(A)^2
$$
we denote by $(a_i)_{i\leq n}$  the spectrum of $A$, so spectral theorem give :
$$
Tr(A)=\sum_{i\leq n}a_i \; \textrm{ and } \; Tr(A^2)=\sum_{i\leq n}a_i^2  
$$
so we have equality if :
$$
\left(\sum_{i\leq n}a_i\right)^2=\sum_{i\leq n}a_i^2 \Longleftrightarrow \sum_{i\neq j\leq n}a_i a_j=0
$$
But $A$  is positive semidefinite so the spectrum of $A$ is non-negative then :
$$
\forall i,j\leq n \qquad i\neq j \qquad \qquad a_i a_j=0
$$
we have so 2 cases :
1.
$\exists k\leq n $ such that $a_k\neq 0$. In this case we have :
$$
\forall i\leq n \; \; i\neq k  \qquad \qquad a_i=0
$$
2.
$\forall i\leq n$ $a_i=0$. This is the trivial case and then :
$$
A= B=0
$$
So the set of solution is :
$$
\left\{(tU^*P_1 U,\alpha  U^*P_1 U), \textrm{ Where } \alpha , t\geq 0, \; U \in O_n,\;  P_1 \textrm { is a one dimensional projection }    \right\}
$$
