Is there a necessary and sufficient condition for exp(AB) = exp(BA) where $A,B\in\mathbb{C}^{n\times n}$
Notice that AB does not have to equal to BA. What I can prove now is that det(exp(AB))=det(exp(BA)) since tr(AB)=tr(AB) implies exp(tr(AB))=exp(tr(BA)), which is sufficient that det(exp(AB)) = det(exp(BA)). Note that exp(tr(A))=det(exp(A)). This is a corollary of Jacobi's formula.
Thanks a lot!!
Consider a nonsingular matrix $X$. It will have various logarithms (i.e. matrices whose exponential is $X$): let two of them be $Y$ and $Z$, and suppose $Y$ and $Z$ are similar. Thus there is a nonsingular matrix $A$ such that $Z = A^{-1} Y A$. Take $B = A^{-1} Y$, so $Z = BA$ and $Y = AB$, and $\exp(AB) = \exp(BA)$.
Conversely, any case where $A$ is invertible will arise in this way, taking $X = \exp(AB)$, $Y = AB$ and $Z = BA$.