Why the Order in an Orthogonal Diagonalization Can Change
An orthogonal diagonalization writes a real symmetric matrix as \(\mathbf{A}=\mathbf{Q}\mathbf{\Lambda}\mathbf{Q}^{\top}\), where \(\mathbf{Q}\) is orthogonal and the diagonal entries of \(\mathbf{\Lambda}\) are eigenvalues of \(\mathbf{A}\). The order of those diagonal entries is not fixed. But each entry is paired with a particular column of \(\mathbf{Q}\): the \(j\)th diagonal entry belongs with the \(j\)th eigenvector column. If you change the order of the eigenvalues, you must change the column order in the same way.
Here, \(\mathbf{A}\) is an \(n\times n\) real symmetric matrix, \(\mathbf{Q}\) is an \(n\times n\) real orthogonal matrix, and \(\mathbf{\Lambda}\) is diagonal. Orthogonality means \(\mathbf{Q}^{\top}\mathbf{Q}=\mathbf{I}_n\). Write the columns of \(\mathbf{Q}\) as \(\mathbf{q}_1,\dots,\mathbf{q}_n\), and the diagonal entries of \(\mathbf{\Lambda}\) as \(\lambda_1,\dots,\lambda_n\). The column \(\mathbf{q}_j\) is a unit eigenvector for \(\lambda_j\), so \(\mathbf{A}\mathbf{q}_j=\lambda_j\mathbf{q}_j\). This pairing is what the reordering must preserve.
For example, if \(\pi(1)=2,\pi(2)=3,\pi(3)=1\), then the new first column is the old second column, the new second is the old third, and the new third is the old first. The corresponding diagonal entries must be put in that same order. The transpose \(\mathbf{P}^{\top}\) reverses the permutation: its columns are the standard basis vectors in the inverse order.
The Reordering Rule
Proof. The columns of \(\mathbf{P}\) are the standard basis vectors in a rearranged order. Each has length \(1\), and distinct columns have dot product \(0\). Therefore \(\mathbf{P}^{\top}\mathbf{P}=\mathbf{I}_n\). Since \(\mathbf{P}\) is square, its columns also contain every standard basis vector, so \(\mathbf{P}\mathbf{P}^{\top}=\mathbf{I}_n\). Hence \(\mathbf{Q}'^{\top}\mathbf{Q}'=\mathbf{P}^{\top}\mathbf{Q}^{\top}\mathbf{Q}\mathbf{P}=\mathbf{P}^{\top}\mathbf{P}=\mathbf{I}_n\), and \(\mathbf{Q}'\) is orthogonal. The \(j\)th column of \(\mathbf{Q}\mathbf{P}\) is \(\mathbf{q}_{\pi(j)}\). Multiplying \(\mathbf{\Lambda}\) by the corresponding standard basis vectors on the two sides shows that the \(j\)th diagonal entry of \(\mathbf{P}^{\top}\mathbf{\Lambda}\mathbf{P}\) is \(\lambda_{\pi(j)}\), with all off-diagonal entries zero. Finally, using \(\mathbf{P}\mathbf{P}^{\top}=\mathbf{I}_n\), we obtain \(\mathbf{Q}'\mathbf{\Lambda}'\mathbf{Q}'^{\top}=\mathbf{Q}\mathbf{P}\mathbf{P}^{\top}\mathbf{\Lambda}\mathbf{P}\mathbf{P}^{\top}\mathbf{Q}^{\top}=\mathbf{Q}\mathbf{\Lambda}\mathbf{Q}^{\top}=\mathbf{A}\). Thus the reordered factors give the same matrix. \(\square\)
This rule also preserves each eigenvalue–eigenvector pairing. For the \(j\)th new column, \(\mathbf{q}'_j=\mathbf{q}_{\pi(j)}\), and the corresponding diagonal entry is \(\lambda'_j=\lambda_{\pi(j)}\). Consequently, \(\mathbf{A}\mathbf{q}'_j=\mathbf{A}\mathbf{q}_{\pi(j)}=\lambda_{\pi(j)}\mathbf{q}_{\pi(j)}=\lambda'_j\mathbf{q}'_j\). No eigenvector has been assigned a different eigenvalue; only the positions in the lists have changed.
Worked Example: Put the Larger Eigenvalue First
Start with an orthogonal diagonalization whose eigenvalues are \(2\) and \(5\), and reorder it so that \(5\) comes first. Take
The columns of \(\mathbf{Q}\) are orthonormal: each has squared length \(\tfrac12+\tfrac12=1\), and their dot product is \(\tfrac12-\tfrac12=0\). First compute the matrix represented by the original factors:
To swap the two positions, use \(\pi(1)=2,\pi(2)=1\), with \(\mathbf{P}=\begin{bmatrix}0&1\\1&0\end{bmatrix}\). Then
Multiplying the reordered factors gives
Check the eigenpairs: the first new column is \(\mathbf{q}'_1=(-1,1)^{\top}/\sqrt{2}\). Multiplying by \(\mathbf{A}\) gives \(\mathbf{A}\mathbf{q}'_1=5\mathbf{q}'_1\). The second new column is \(\mathbf{q}'_2=(1,1)^{\top}/\sqrt{2}\), and \(\mathbf{A}\mathbf{q}'_2=2\mathbf{q}'_2\). The columns and diagonal entries match in their new order.
Sorting a Three-Eigenvalue Example
In practice, one often wants the diagonal entries in increasing or decreasing order. The procedure is simply to choose the corresponding permutation of indices and apply it to both factors. For instance, if the original order is \((4,-1,2)\), increasing order requires the index order \((2,3,1)\), not merely a new diagonal matrix with sorted entries.
Worked Example: Sort Three Eigenvalues in Increasing Order
Let the orthonormal columns of \(\mathbf{Q}\) be \(\mathbf{q}_1=(1,1,0)^{\top}/\sqrt{2}\), \(\mathbf{q}_2=(1,-1,0)^{\top}/\sqrt{2}\), and \(\mathbf{q}_3=(0,0,1)^{\top}\), with \(\mathbf{\Lambda}=\operatorname{diag}(4,-1,2)\). In matrix form,
These columns have unit length and pairwise dot products \(0\), so \(\mathbf{Q}\) is orthogonal. Multiplication gives the original matrix:
The increasing order is \((-1,2,4)\), so the index order is \((2,3,1)\). The permutation matrix has columns \(\mathbf{e}_2,\mathbf{e}_3,\mathbf{e}_1\), and the matched reordered factors are
To check the product, the first reordered column contributes \(-\mathbf{q}_2\mathbf{q}_2^{\top}\), the second contributes \(2\mathbf{q}_3\mathbf{q}_3^{\top}\), and the third contributes \(4\mathbf{q}_1\mathbf{q}_1^{\top}\). Computing those terms gives
Check the matching: \(\mathbf{A}\mathbf{q}_2=-\mathbf{q}_2\), \(\mathbf{A}\mathbf{q}_3=2\mathbf{q}_3\), and \(\mathbf{A}\mathbf{q}_1=4\mathbf{q}_1\). These are exactly the three columns and diagonal entries in \(\mathbf{Q}'\) and \(\mathbf{\Lambda}'\).
Repeated Eigenvalues and Ties
A repeated eigenvalue does not change the reordering rule. If two diagonal entries are equal, swapping them leaves the diagonal matrix numerically unchanged, but the columns of \(\mathbf{Q}\) still move. Those columns are both eigenvectors for that same eigenvalue. More generally, when sorting eigenvalues with ties, any order among equal entries is allowed as long as the associated columns follow the same order.
Worked Example: Swapping Columns for a Repeated Eigenvalue
Use the same orthogonal matrix \(\mathbf{Q}\) as in the preceding example, but take \(\mathbf{\Lambda}=\operatorname{diag}(3,3,1)\). The first two eigenvalues are equal. The original product is
Swap the first two columns using \(\mathbf{P}=\begin{bmatrix}0&1&0\\1&0&0\\0&0&1\end{bmatrix}\). The reordered factors are
The diagonal matrix appears unchanged because its first two entries agree. The product check is still important: the reordered columns are orthonormal, and multiplication yields
Check the eigenpairs: each of the first two columns of \(\mathbf{Q}'\) is mapped by \(\mathbf{A}\) to three times itself, and the third column is mapped to itself. The repeated eigenvalue permits either order for its two columns, but not a mismatch with a different eigenvalue.
Common Mistake: Sorting Only the Diagonal
A tempting but incorrect step is to sort the diagonal entries of \(\mathbf{\Lambda}\) while leaving \(\mathbf{Q}\) untouched. In the three-eigenvalue example, changing \(\operatorname{diag}(4,-1,2)\) to \(\operatorname{diag}(-1,2,4)\) without changing \(\mathbf{Q}\) assigns \(-1\) to \(\mathbf{q}_1\), \(2\) to \(\mathbf{q}_2\), and \(4\) to \(\mathbf{q}_3\). The resulting product is
which is not the original matrix \(\begin{bmatrix}\tfrac32&\tfrac52&0\\\tfrac52&\tfrac32&0\\0&0&2\end{bmatrix}\). The correction is to reorder both factors: use \(\mathbf{Q}'=\mathbf{Q}\mathbf{P}\) and \(\mathbf{\Lambda}'=\mathbf{P}^{\top}\mathbf{\Lambda}\mathbf{P}\) for the same permutation matrix. In an orthogonal diagonalization, the order is flexible, but the eigenvalue–eigenvector pairing is not.
When you need a particular order, a reliable check is to write down the old index selected for each new position. If the new order is \((\pi(1),\dots,\pi(n))\), place \(\mathbf{q}_{\pi(j)}\) in column \(j\) and \(\lambda_{\pi(j)}\) in diagonal position \(j\). Then verify the factorization or check each eigenpair. This avoids relying on visual intuition when there are several entries or repeated values.
Check Your Understanding
For each question, keep track of which old index supplies every new column and diagonal entry.
- If the eigenvalues are listed as \((6,1,4)\), what index order puts them in decreasing order? Write the corresponding reordered diagonal.
- For the index order \((3,1,2)\), write the permutation matrix and state the order of the columns in \(\mathbf{Q}\mathbf{P}\).
- Explain why \(\mathbf{Q}\mathbf{P}\) remains orthogonal when \(\mathbf{Q}\) is orthogonal and \(\mathbf{P}\) is a permutation matrix.
- Suppose \(\lambda_1=\lambda_2\). What happens to \(\mathbf{\Lambda}\) and \(\mathbf{Q}\) when the first two positions are swapped?
- In one sentence, identify the error in sorting the eigenvalues but leaving the eigenvector columns in their original order.