TITLE: Orthogonality of positive (semi-)definite matrices
QUESTION [7 upvotes]: Given positive semidefinite matrices $A,B \succeq 0$, $A, B \in \mathbb{R}^{n \times n}$, if we have $$\langle A, B \rangle = 0,$$ where $\langle \cdot, \cdot \rangle$ denotes the Frobenius inner product, then 

What are tight necessary conditions of ranks of $A, B$? For example, $\mbox{rank} (A) + \mbox{rank}(B) \leq n$? How to prove that?
What can be say about the orthogonality of the eigenvectors of $A$ and $B$? For example, are they pairwise orthogonal?

REPLY [9 votes]: If $A$ and $B$ are positive semidefinite and $A^{1/2}$ and $B^{1/2}$ their positive semidefinite square roots,
$$\text{Tr}(AB) = \text{Tr}(A^{1/2} B A^{1/2})  = \text{Tr}((B^{1/2} A^{1/2})^T B^{1/2} A^{1/2})$$
and this is $0$ if and only if $B^{1/2} A^{1/2} = 0$.
That in turn is equivalent to $\text{Ran}(A) \subseteq \text{Ker}(B)$.
So indeed $\text{rank}(A) + \text{rank}(B) \le n$, and this bound is tight.
Moreover, the eigenvectors of $A$ for nonzero eigenvalues are in $\text{Ker}(B)$ and therefore are orthogonal to the eigenvectors of $B$ for nonzero eigenvalues.