I'm trying to calculate $\text{tr}(\exp(A)) $ for matrix $A$, and I found several topics, but not sure if I've get it all right. So I wonder if this is a correct way of doing this.
This is matrix $A$, $$ \begin{bmatrix} 0 & -1 & 1 \\ -1 & 0 & 1 \\ 1 & 1 & 0 \\ \end{bmatrix} $$ Following the answer in here, I calculated the eigenvalues, two of which are complex numbers,
$$\ \lambda_1 = 1.52 , \lambda_2= -0.76+0.85 i , \lambda_3= -0.76-0.85 i \\ \ tr(e^A) = e^{1.52} + e^{-0.76+0.85 i} + e^{-0.76-0.85 i} \\ \ $$
As suggested here, I've written the following for the complex parts
$$\ \ e^{-0.76+0.85 i} + e^{-0.76-0.85 i}= e^{-0.76}.e^{0.85i}+e^{-0.76}.e^{-0.85i}\\ =e^{-0.76}(\cos0.85 + i \sin 0.85+\cos-0.85+i\sin-0.85) = e^{-0.76}.2\cos(0.85) \ $$
So finally we have, $\text{tr}(\exp(A)) = e^{1.52}+e^{-0.76}.2\cos(0.85) $
Thanks in advance!