Suppose that I have two matrices $A$ and $B$ which are both symmetric: $A=A^T, B=B^T$. Moreover, I know how to diagonalize both $A$ and $B$.
Now I would like to define $T=A^{1/2}BA^{1/2}$, which is also a symmetric matrix (in general, the commutator $[A,B]$ does not vanish). I then want to compute $\text{Tr}\left[\left(A^{1/2}BA^{1/2}\right)^n\right]$ for a positive integer $n$. My question is, can I use my knowledge of the diagonal form and/or eigenbasis of $A$ and $B$ to efficiently compute this trace? I think it isn't easy to compute the eigenvalues of $T$ with the available data so maybe this trace is also non-trivial to compute...