Let A∈Rn×n be a symmetric matrix with eigendecomposition A=∑i=1nλiuiuiT, where λi are the eigenvalues and ui are the orthonormal eigenvectors of A.
Recall the matrix function
A natural approach is to combine the implicit trace estimation algorithms discussed earlier in this chapter with black-box methods for approximating x↦xTf(A)x or x↦f(A)x.
Recall, the Lanczos algorithm produces an orthonormal basis Q∈Rn×k for the Krylov subspace Kk(A,x) and a symmetric tridiagonal matrix T∈Rk×k such that T=QTAQ.
The output of the Lanczos method can then be used to approximate f(A)x and xTf(A)x.
This requires k−1 matrix-vector products with A.
It is well-known that the accuracy of these approximations is related to how well f(x) can be approximation by polynomials on the interval [λn,λ1].
In particular, note that when f(x) is a low-degree polynomial, the approximations are exact.