Due to space constraints, our earlier description of the mathematical principles behind the relevant operations was relatively brief. Therefore, in this article, we supplement some mathematical derivations regarding power iteration and the QR decomposition to establish a more complete theoretical picture. However, the derivations here still emphasize explanatory intuition rather than rigor, primarily to help everyone (including myself) organize our thoughts, so I ask for the understanding of expert readers.
Before beginning the derivations, we first need to introduce the concept of "coaxial equivalence". For matrices , if there exists a signature matrix satisfying , then and are said to be "coaxially equivalent", and each is a "coaxial matrix" of the other. Here, a "Signature matrix " refers to a diagonal matrix with diagonal entries of , that is, .
I should explain that I coined the term "coaxial" to describe this equivalence relation: from the perspective of coordinate systems, matrices satisfying the condition, , actually describe the same coordinate system, except that the choices of positive directions for certain axes differ. Some literature seems to call them "sign equivalent", but I feel this is not as intuitive as "coaxial".
The reason for introducing the concept of coaxiality is that many matrix decompositions are unique only in the sense of coaxial equivalence (which is also why I wonder how such a commonly used equivalence relation lacks a standard name). For example, in the QR decomposition, let matrix be of full rank, and let and be two QR decompositions of it. Then and are coaxial, and and are coaxial.
This uniqueness is not difficult to understand, because during Gram-Schmidt orthogonalization, we can arbitrarily flip the orthogonalized vectors without altering orthogonality. Standard textbooks usually require the diagonal elements of to be positive to express the uniqueness of the QR decomposition. This is also an approach, but it sometimes introduces unnecessary trouble. In addition, SVD's uniqueness also holds under coaxial equivalence.
In Implementing Muon with Streaming Power Iteration, Part 1: A First Encounter, we introduced power iteration by solving for eigenvectors one by one, and then switched directly to the parallel version under the assumption that it yields the same convergence result. Here, we start directly from the parallel version to prove its convergence.
Again, let the matrix , and assume it has full rank (rank ). Consider the power iteration
Suppose has the QR decomposition , then , and iterating step by step yields
Next, let 's SVD be , so , which, substituted into the equation above, yields
The result splits into three parts, and what we want to prove is that, in the coaxial sense, . It is known that are both orthogonal matrices, and by the closure property of upper triangular matrices, is an upper triangular matrix. If we can prove that tends to an upper triangular matrix, then by the uniqueness of the QR decomposition we obtain . Regarding , written in component form, it is
Assuming , then when , , meaning that 's lower triangular part tends to 0; in other words, tends to an upper triangular matrix, and the condition is proved. From this, we also see that the convergence rate of power iteration depends on the ratio of adjacent singular values: the larger is, the faster the convergence. Once equal singular values exist, power iteration fails, but in practice one can assume that the probability of two singular values being strictly equal is 0, thus circumventing this issue.
Let us think carefully about the entire proof process and understand what it is essentially doing.
First, looks complicated, but its sole purpose is merely being "an upper triangular matrix"—that is, what it actually equals does not matter at all, as long as it maintains the form of an upper triangular matrix. What truly plays the core role is that tends to an upper triangular matrix, which allows the preceding to be extracted by the QR decomposition.
What actually achieves this effect is really the step ! In other words, theoretically we have , meaning that all those earlier operations are theoretically redundant; it suffices to perform —or orthogonalization—just once at the very end. Of course, this equivalence has only theoretical value: directly computing causes numerical explosion/collapse, rendering the result unusable. Therefore, periodically executing (rather than only once at the end) fundamentally serves to maintain numerical stability.
We can also understand the repeated QR operations from the perspective of a "Preconditioner". A preconditioner refers to some preprocessing operations on the input, which theoretically do not alter the output, but are usually beneficial for numerical computation. For , right-multiplying by any full-rank upper triangular matrix does not change the result, namely , so any right-multiplied full-rank upper triangular matrix can be called a preconditioner of .
We know that itself can also be written in the form of right-multiplying by an upper triangular matrix, so itself is a preconditioner of . Therefore, we can insert into some , turning it into
Finally applying to both sides does not change the result. However, because each produces an orthogonal matrix, and right-multiplying by an orthogonal matrix poses almost no risk of numerical explosion, serves as a good preconditioner for itself.
From the perspective of preconditioners, we can also understand many variants of power iteration. For example, in the opening post Implementing Muon with Streaming Power Iteration, Part 1: A First Encounter, we used the version:
The two on the left and right are equal, because applying to a matrix is equivalent to right-multiplying by a diagonal matrix:
A diagonal matrix is a special case of an upper triangular matrix, so is also a preconditioner of , and it does not change the result. For the same reason, we can also move one step outward, which likewise does not change 's result
In addition, the main protagonists of Implementing Muon with Streaming Power Iteration, Part 2: Acceleration and Implementing Muon with Streaming Power Iteration, Part 3: Refinement are power iterations with double :
Based on the discussion in these two sections, it is easy to prove that applying to an extra step of theoretically also does not alter the result of .
We have repeatedly used words like "in theory" because many results can only be obtained on the basis of infinite-precision, exact , whereas in practical computations, is of finite precision, and for efficiency we usually also employ the less accurate "SCQR (Shifted Cholesky QR)", so analyzing the cumulative effect of errors is very necessary.
As for SCQR, having read the past few posts, you should no longer find it unfamiliar; it divides the QR decomposition of matrix into two steps: 1. perform a Cholesky decomposition on to obtain , and 2. through obtain the orthogonal matrix . If , then SCQR is equivalent to exact QR; however, almost always fails in practical computations because the condition number is too large, so we set an appropriate , which introduces errors.
Fortunately, such errors do not accumulate! Whether it is or , the result of their Cholesky decomposition is always an upper triangular matrix, and then is multiplied on the right by the inverse of this upper triangular matrix. We know that right-multiplying by an upper triangular matrix does not change the result of . Therefore, if we disregard matrix multiplication errors, SCQR can be considered "lossless" to itself.
In other words, as long as the final step switches to exact , then no matter how many inexact SCQR steps were performed before, the result is still exact. Conversely, the total error is equivalent to the error of a single-step SCQR (the last step), rather than accumulating. Also relying on this principle is the "SCQR2" acceleration trick we mentioned in Implementing Muon with Streaming Power Iteration, Part 2: Acceleration.
Conversely, if some transformations we propose cannot be written in the form of "right-multiplying by an upper triangular matrix", they will lossily destroy the information of the original matrix, accumulating errors over long-term iterations until complete failure. In the previous post, Implementing Muon with Streaming Power Iteration, Part 3: Refinement, the simplification scheme proposed by @Ji_Ha_Kim that we mentioned is a classic counterexample.
Finally, let us briefly review "Cholesky decomposition". Its purpose is to represent a given symmetric positive-definite matrix in the form of , where is a lower triangular matrix. Then, denoting , we obtain the upper triangular matrix form .
Cholesky decomposition is fast because it has an analytical solution that can be computed recursively directly. Specifically, from the following equality
, equating corresponding entries term by term, one can solve for the recursive formulas
Cholesky QR is one of the classic applications of the Cholesky decomposition. It is similar to Gram-Schmidt orthogonalization, but allows us to skip the orthogonalization process and obtain the triangular matrix directly . They also face the same numerical difficulties: Gram-Schmidt orthogonalization proceeds vector by vector, and once it encounters linearly dependent vectors or zero vectors, the orthogonalization cannot proceed further. In terms of singular values, this manifests as an effective rank that is low or a condition number that is large, and in such cases, the Cholesky decomposition is likewise prone to failure.
Another classic application of the Cholesky decomposition is inverting symmetric positive-definite matrices. For example, to solve the equation , where is symmetric positive-definite, we can first decompose it into , and then turn it into , which only requires solving two triangular systems, each step being fairly efficient. In particular, @Ji_Ha_Kim 's proposed rational iteration for computing computes the inverse matrix based on this very idea.
This post has primarily provided supplementary discussions on some of the mathematical derivations for streaming power iteration, including the convergence of power iteration, preconditioning for the QR decomposition, and a brief introduction to the Cholesky decomposition, in the hope of helping everyone better understand the principles behind this method.