# Trace of a the inverse of a complex matrix

I require the following $${\rm Tr}({\bf H} + \omega{\bf I})^{-1}$$ where $$\bf H$$ is Hermitian, $$\omega$$ is a complex number with a small imaginary component $$(\Im \omega \approx 1\times 10^{-5})$$ and $$\bf I$$ is the unit matrix. $$\rm Tr$$ indicates a trace is required

Unfortunately these matrices are $$45\times 45$$ and are to be numerically integrated ($$\bf H$$ is a function of two variables) thus I was wondering if there was a cheaper way to obtain the trace, i.e. without needing to do a full inversion.

Let $$n=45$$ and let $$\lambda_1,...., \lambda_n$$ the (real) eigenvalues of $$H$$. Since $$H$$ is diagonalisable, we have

$$H=P^{-1}DP$$, where $$D=diag(\lambda_1,...., \lambda_n).$$

Hence

$$H+ \omega I=P^{-1}D_{\omega}P$$, where $$D_{\omega}=diag(\lambda_1+\omega,...., \lambda_n+\omega).$$

Therefore $$(H+ \omega I)^{-1}=P^{-1}D_{\omega}^{-1}P$$, hence

$${\rm Tr}((H+ \omega I)^{-1})={\rm Tr}(D_{\omega}^{-1})= \sum_{k=1}^n\frac{1}{\lambda_k+\omega}.$$

• Hi Fred, thanks for your answer, I just wanted to get some clarification: I am using the Tux Eigen package and it quotes that the computational cost to obtain the eigenvalues only, is $4n^3/3$. I can't find information as to the cost of inversion. I believe in this case it would use LU decomposition with partial pivoting. Are you able to indicate a performance gain, in $\mathcal{O} (n)$ notation? Many thanks Jan 25, 2019 at 11:32