Pseudo-algorithm for the orthogonal iteration algorithm:

while not_converged:
    Qk = A * Qk
    Qk, Rk = qr(Qk)

Consider:

converges to (up to the rotation in the complex plane ). So the eigenvalues of appear along the diagonal of .

is initially a dense matrix. As the algorithm converges, it becomes increasingly upper triangular. The eigenvalues appear on the diagonal ordered from largest to smallest.

Note that we only converge to the Schur decomposition, not the eigendecomposition.