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}.$