The QR algorithm is one of the most popular diagonalization algorithms. In this post, we compare it with several variations of the power iteration. Throughout this post, we only consider positive-defined hermitian matrices. If a matrix is not positively defined, one can always apply a shift: A→A+sI,s=|min{λi,i=1,2,⋯}|.
QR algorithm
Recall the QR decomposition (QR factorization) matrix A factorizes A into the matrix product of a orthogonal matrix Q and a upper triangle matrix R, i.e. A=QR. QR decomposition can be seen as the reorthogonalization of the column vectors of A. Namely, column vectors ai(i=1,⋯,n) of A=[a1,a2,⋯,an] are orthogonalized to Q=[q1,q2,⋯,qn] such that ai∈span(q1,q2,⋯,qi). Based on QR decomposition, QR algorithm to diagonalize a matrix A reads:- A0=A;
- Ak−1→QkRk (QR decomposition);
- Ak=RkQk.
Note that after procedures (2) and (3) Ak=Q†kAk−1Qk. Hence Ak≃Ak−1≃Ak−2≃⋯A0=A. There is a theorem to guarantee that under certain conditions, the sequence converges to diagonal matrix. We won't discuss the theorem here.
Power iteration
Power iteration is fairly simple. Choose a random vector v=∑iαixi where xi(i=1,2,⋯,n) is eigenvector of A. ThenAkv=∑iαiλkixi. Therefore, if k is sufficiently large, λm≡max{λi,i=1,2,⋯,n} dominates, so Akv→λkmxm. In practice, the resulted vector each step is normalized.
- v0= random unit vector ;
- vk=A⋅vk−1;
- vk←vk/‖vk‖.
There are two issues in the power iteration. First of all, if the largest eigen-pair (eigenvalue and eigenvector) is degenerate, the iterated vector can only converge to a vector of the eigen-space. Secondly, it can only generate the largest eigen-pair .
simultaneous power iteration
In order to overcome the first issue, more than one vector can be used simultaneously in iteration. The method is known as simultaneous power iteration. The algorithm can be described as following:- V0=[v(0)1,v(0)2,⋯,v(0)m]v(0)i is random vector ,i=1,2,⋯,m;m≤n;
- Vk=A⋅Vk−1;
- v(k)i←v(k)i/‖v(k)i‖i=1,2,⋯m.
orthogonal power iteration
Simultaneous power iteration does not resolve the second issue. In principle, after obtaining the first eigenvector, it can be subtracted from the entire space. Then perform the power iteration for the rest subspace, the second largest eigen-pair can be obtained. However, this method is never practical. Because any numerical error may add the subtracted eigenvector back. In order to keep the calculated eigen-vector off, we can re-orthogonalize the vectors after each iteration. Notice that QR decomposition as described above can be used for the orthogonalization. This iteration scheme is known as orthogonal power iteration. The algorithm is sketched below:- V0 is a n×n random matrix ;
- Vk−1→QkRk ( QR decomposition) ;
- Vk=AQk.
Power iteration vs. QR algorithm
Now let's compare orthogonal power iteration and QR algorithm. In orthogonal power iteration, define Ak≡Q†kVk=Q†kAQk, Uk≡Q†k−1Qk. It can be seen- Uk is orthogonal;
- Ak−1=Q†k−1QkRk=UkRk;
- Ak=Q†kQk−1Ak−1Q†k−1Qk=U†kAk−1Uk.
In fact, Ak−1=UkRk is a QR decomposition of Ak−1. That is to say, in orthogonal power iteration, Vk−1 is QR-factorized, whereas in QR algorithm, Ak−1 is QR-factorized. These two methods are equivalent. The operations on Ak yields a sequence identical to those in QR algorithm, if we further set Q0=I⟹V0=A. The benefit of QR algorithm is that matrices Uk and Ak are exactly what we need.
This comparison shows that QR algorithm is actually equivalent to some variation of the power iteration. Therefore we could expect it has the similar performance (convergence rate, memory consumption etc.) with the power iteration.
No comments:
Post a Comment