Compute powers of matrix using diagonalization (#698)