Problem Formulation
-------------------


under what conditions can we solve $\mathrm{trace}(\mathbf{AB})=0$ ? or more specifically, when will $\mathrm{trace}(\mathbf{AB})=0$ implies that $\mathrm{trace}(\mathbf{B})=0$. 


Related Art
-----------


This occurs to me when $\mathbf{A}$ was a Positive semidefinite matrix, and $\mathbf{B}$ was a symmetric matrix with a parameter $\lambda$. I want to solve a partial derivatives equations which constrains that $\mathrm{trace}[\mathbf{AB}(\lambda)] = 0$, i.e., 
\begin{equation}
\frac{\partial \mathcal{L}(i)}{\partial \gamma\_i} = 
\mathrm{Tr}\left[ (\mathbf{I}\_{d\_i} + \gamma\_i\mathbf{B}\_i\mathbf{s}\_i)^{-1}\mathbf{B}\_i\mathbf{s}\_i\right] - \mathbf{q}\_i^T(\gamma\_i^{-1}\mathbf{B}\_i^{-1} + \mathbf{s}\_i)^{-1}\frac{\mathbf{B}\_i^{-1}}{\gamma\_i^2}(\gamma\_i^{-1}\mathbf{B}\_i^{-1} + \mathbf{s}\_i)^{-1}\mathbf{q}\_i, 
\end{equation}
where $\mathbf{s}\_i$ and $\mathbf{B}\_i$ are symmetric PSD matrix, $\mathbf{q}\_i$ is a column vector, $\gamma\_i$ is a scalar, $\mathbf{I}\_d$ is an identity matrix with size $d$. I want to solve
\begin{equation}
\frac{\partial \mathcal{L}(i)}{\partial \gamma\_i} = 0.
\end{equation}
with $\gamma\_i$ derived in a closed-form. 


Using cyclic product properties of the trace norm, I could only go this far,
\begin{equation}
\frac{\partial \mathcal{L}(i)}{\partial \gamma\_i} =
\mathrm{Tr}\left[ (\mathbf{B}\_i^{-1} + \gamma\_i\mathbf{s}\_i)^{-1}\mathbf{B}\_i^{-1}(\mathbf{B}\_i^{-1} + \gamma\_i\mathbf{s}\_i)^{-1}\left( \mathbf{s}\_i + \gamma\_i\mathbf{s}\_i\mathbf{B}\_i\mathbf{s}\_i - \mathbf{q}\_i\mathbf{q}\_i^T \right) \right]
\end{equation}
I sensed that the closed form solution of $\gamma\_i$ might be related with
\begin{equation}
\mathrm{trace}\left( \mathbf{s}\_i + \gamma\_i\mathbf{s}\_i\mathbf{B}\_i\mathbf{s}\_i - \mathbf{q}\_i\mathbf{q}\_i^T \right) = 0.
\end{equation}


Counter Example
---------------


plus, I can also give a counter example. Let 
$$
\mathbf{A} = 
\begin{pmatrix} 
2 & 1 \\\
1 & 2
\end{pmatrix}, \quad
\mathbf{B} = 
\begin{pmatrix}
1+\lambda & -2 \\\
-2 & \lambda - 3
\end{pmatrix},
$$
where $\mathrm{trace}(\mathbf{AB})=0$ implies $\lambda=2$, $\mathrm{trace}(\mathbf{B})=0$ implies $\lambda=1$.



solving trace norm equality
Here is a result, which I think is interesting in this context (for reference see books on Lie algebras):


Theorem: Let $V$ be a finite-dimensional vector space over a field $K$ of characteristic zero. Let $E\subseteq F$ be
two linear subspaces of $End(V)$ and $M=\lbrace A \in End(V) \mid [A,F] \subseteq E\rbrace $.
Assume that $tr (AB)=0$ for all $A\in M$. Then $B$ is nilpotent with $tr(B)=tr(B^2)=\cdots = tr(B^n)=0$ for all $n$.


Edit: $[A,B]=AB-BA$ in $End(V)$.


