Suppose that we are given a random, symmetric matrix $A$, and a random vector $q$. For concreteness, assume the dimensions of $q$ and $A$ are both $1,000$. I would like to use the Lanczos algorithm to compute the tridiagonal matrix, $T$, which is uniquely defined by $A$ and $q$. I don't necessarily need access to the entirety of $T$, but I want to understand any systematic errors which appear in the algorithm due to finite-precision arithmetic.
So far, I have computed the first $100$ rows and columns of $T$ by two methods. The first uses high-precision arithmetic: I instantiate $A$ and $q$ with a huge number of digits of accuracy, and carry out the Lanczos algorithm as though numerical precision is effectively infinite. This should generate essentially exact results, and I have checked that orthogonality and normalization of Ritz vectors is maintained in this process. So far, so good.
My second approach uses standard machine precision, and in order to counter the loss of orthogonality among Ritz vectors, I explicitly re-orthogonalize each vector with respect to previously encountered vectors using the Gram-Schmidt procedure. I thought this would yield the same result as method (1), but in general it does not: I have found that after the first 50 or so iterations (this depends slightly on the initial matrix/vector), there is a significant divergence between the results of these two methods. I don't understand why this is the case; my understanding was that the loss of accuracy in the Lanczos algorithm was primarily attributable to the loss of orthogonality among these vectors.
So, my question: when is the tridiagonal matrix $T$, generated by standard precision arithmetic, reliable? Why isn't complete re-orthogonalization of the generated vectors sufficient?