fix bugs in arnoldi and ritz
add unit test for ritz