Divide-and-conquer eigenvalue algorithm

From HandWiki

Divide-and-conquer eigenvalue algorithms are a class of eigenvalue algorithms for Hermitian or real symmetric matrices that have recently (circa 1990s) become competitive in terms of stability and efficiency with more traditional algorithms such as the QR algorithm. The basic concept behind these algorithms is the divide-and-conquer approach from computer science. An eigenvalue problem is divided into two problems of roughly half the size, each of these are solved recursively, and the eigenvalues of the original problem are computed from the results of these smaller problems. Here we present the simplest version of a divide-and-conquer algorithm, similar to the one originally proposed by Cuppen in 1981. Many details that lie outside the scope of this article will be omitted; however, without considering these details, the algorithm is not fully stable.

Background

As with most eigenvalue algorithms for Hermitian matrices, divide-and-conquer begins with a reduction to tridiagonal form. For an [math]\displaystyle{ m \times m }[/math] matrix, the standard method for this, via Householder reflections, takes [math]\displaystyle{ \frac{4}{3}m^{3} }[/math] floating point operations, or [math]\displaystyle{ \frac{8}{3}m^{3} }[/math] if eigenvectors are needed as well. There are other algorithms, such as the Arnoldi iteration, which may do better for certain classes of matrices; we will not consider this further here.

In certain cases, it is possible to deflate an eigenvalue problem into smaller problems. Consider a block diagonal matrix

[math]\displaystyle{ T = \begin{bmatrix} T_{1} & 0 \\ 0 & T_{2}\end{bmatrix}. }[/math]

The eigenvalues and eigenvectors of [math]\displaystyle{ T }[/math] are simply those of [math]\displaystyle{ T_{1} }[/math] and [math]\displaystyle{ T_{2} }[/math], and it will almost always be faster to solve these two smaller problems than to solve the original problem all at once. This technique can be used to improve the efficiency of many eigenvalue algorithms, but it has special significance to divide-and-conquer.

For the rest of this article, we will assume the input to the divide-and-conquer algorithm is an [math]\displaystyle{ m \times m }[/math] real symmetric tridiagonal matrix [math]\displaystyle{ T }[/math]. Although the algorithm can be modified for Hermitian matrices, we do not give the details here.

Divide

The divide part of the divide-and-conquer algorithm comes from the realization that a tridiagonal matrix is "almost" block diagonal.

Almost block diagonal.png

The size of submatrix [math]\displaystyle{ T_{1} }[/math] we will call [math]\displaystyle{ n \times n }[/math], and then [math]\displaystyle{ T_{2} }[/math] is [math]\displaystyle{ (m - n) \times (m - n) }[/math]. Note that the remark about [math]\displaystyle{ T }[/math] being almost block diagonal is true regardless of how [math]\displaystyle{ n }[/math] is chosen (i.e., there are many ways to so decompose the matrix). However, it makes sense, from an efficiency standpoint, to choose [math]\displaystyle{ n \approx m/2 }[/math].

We write [math]\displaystyle{ T }[/math] as a block diagonal matrix, plus a rank-1 correction:

Block diagonal plus correction.png

The only difference between [math]\displaystyle{ T_{1} }[/math] and [math]\displaystyle{ \hat{T}_{1} }[/math] is that the lower right entry [math]\displaystyle{ t_{nn} }[/math] in [math]\displaystyle{ \hat{T}_{1} }[/math] has been replaced with [math]\displaystyle{ t_{nn} - \beta }[/math] and similarly, in [math]\displaystyle{ \hat{T}_{2} }[/math] the top left entry [math]\displaystyle{ t_{n+1,n+1} }[/math] has been replaced with [math]\displaystyle{ t_{n+1,n+1} - \beta }[/math].

The remainder of the divide step is to solve for the eigenvalues (and if desired the eigenvectors) of [math]\displaystyle{ \hat{T}_{1} }[/math] and [math]\displaystyle{ \hat{T}_{2} }[/math], that is to find the diagonalizations [math]\displaystyle{ \hat{T}_{1} = Q_{1} D_{1} Q_{1}^{T} }[/math] and [math]\displaystyle{ \hat{T}_{2} = Q_{2} D_{2} Q_{2}^{T} }[/math]. This can be accomplished with recursive calls to the divide-and-conquer algorithm, although practical implementations often switch to the QR algorithm for small enough submatrices.

Conquer

The conquer part of the algorithm is the unintuitive part. Given the diagonalizations of the submatrices, calculated above, how do we find the diagonalization of the original matrix?

First, define [math]\displaystyle{ z^{T} = (q_{1}^{T},q_{2}^{T}) }[/math], where [math]\displaystyle{ q_{1}^{T} }[/math] is the last row of [math]\displaystyle{ Q_{1} }[/math] and [math]\displaystyle{ q_{2}^{T} }[/math] is the first row of [math]\displaystyle{ Q_{2} }[/math]. It is now elementary to show that

[math]\displaystyle{ T = \begin{bmatrix} Q_{1} & \\ & Q_{2} \end{bmatrix} \left( \begin{bmatrix} D_{1} & \\ & D_{2} \end{bmatrix} + \beta z z^{T} \right) \begin{bmatrix} Q_{1}^{T} & \\ & Q_{2}^{T} \end{bmatrix} }[/math]

The remaining task has been reduced to finding the eigenvalues of a diagonal matrix plus a rank-one correction. Before showing how to do this, let us simplify the notation. We are looking for the eigenvalues of the matrix [math]\displaystyle{ D + w w^{T} }[/math], where [math]\displaystyle{ D }[/math] is diagonal with distinct entries and [math]\displaystyle{ w }[/math] is any vector with nonzero entries.

The case of a zero entry is simple, since if wi is zero, ([math]\displaystyle{ e_i }[/math],di) is an eigenpair ([math]\displaystyle{ e_i }[/math] is in the standard basis) of [math]\displaystyle{ D + w w^{T} }[/math] since [math]\displaystyle{ (D + w w^{T})e_i = De_i = d_i e_i }[/math].

If [math]\displaystyle{ \lambda }[/math] is an eigenvalue, we have:

[math]\displaystyle{ (D + w w^{T})q = \lambda q }[/math]

where [math]\displaystyle{ q }[/math] is the corresponding eigenvector. Now

[math]\displaystyle{ (D - \lambda I)q + w(w^{T}q) = 0 }[/math]
[math]\displaystyle{ q + (D - \lambda I)^{-1} w(w^{T}q) = 0 }[/math]
[math]\displaystyle{ w^{T}q + w^{T}(D - \lambda I)^{-1} w(w^{T}q) = 0 }[/math]

Keep in mind that [math]\displaystyle{ w^{T}q }[/math] is a nonzero scalar. Neither [math]\displaystyle{ w }[/math] nor [math]\displaystyle{ q }[/math] are zero. If [math]\displaystyle{ w^{T}q }[/math] were to be zero, [math]\displaystyle{ q }[/math] would be an eigenvector of [math]\displaystyle{ D }[/math] by [math]\displaystyle{ (D + w w^{T})q = \lambda q }[/math]. If that were the case, [math]\displaystyle{ q }[/math] would contain only one nonzero position since [math]\displaystyle{ D }[/math] is distinct diagonal and thus the inner product [math]\displaystyle{ w^{T}q }[/math] can not be zero after all. Therefore, we have:

[math]\displaystyle{ 1 + w^{T}(D - \lambda I)^{-1} w = 0 }[/math]

or written as a scalar equation,

[math]\displaystyle{ 1 + \sum_{j=1}^{m} \frac{w_{j}^{2}}{d_{j} - \lambda} = 0. }[/math]

This equation is known as the secular equation. The problem has therefore been reduced to finding the roots of the rational function defined by the left-hand side of this equation.

All general eigenvalue algorithms must be iterative, and the divide-and-conquer algorithm is no different. Solving the nonlinear secular equation requires an iterative technique, such as the Newton–Raphson method. However, each root can be found in O(1) iterations, each of which requires [math]\displaystyle{ \Theta(m) }[/math] flops (for an [math]\displaystyle{ m }[/math]-degree rational function), making the cost of the iterative part of this algorithm [math]\displaystyle{ \Theta(m^{2}) }[/math].

Analysis

As is common for divide and conquer algorithms, we will use the master theorem for divide-and-conquer recurrences to analyze the running time. Remember that above we stated we choose [math]\displaystyle{ n \approx m/2 }[/math]. We can write the recurrence relation:

[math]\displaystyle{ T(m) = 2 \times T\left(\frac{m}{2}\right) + \Theta(m^{2}) }[/math]

In the notation of the Master theorem, [math]\displaystyle{ a = b = 2 }[/math] and thus [math]\displaystyle{ \log_{b} a = 1 }[/math]. Clearly, [math]\displaystyle{ \Theta(m^{2}) = \Omega(m^{1}) }[/math], so we have

[math]\displaystyle{ T(m) = \Theta(m^{2}) }[/math]

Remember that above we pointed out that reducing a Hermitian matrix to tridiagonal form takes [math]\displaystyle{ \frac{4}{3}m^{3} }[/math] flops. This dwarfs the running time of the divide-and-conquer part, and at this point it is not clear what advantage the divide-and-conquer algorithm offers over the QR algorithm (which also takes [math]\displaystyle{ \Theta(m^{2}) }[/math] flops for tridiagonal matrices).

The advantage of divide-and-conquer comes when eigenvectors are needed as well. If this is the case, reduction to tridiagonal form takes [math]\displaystyle{ \frac{8}{3}m^{3} }[/math], but the second part of the algorithm takes [math]\displaystyle{ \Theta(m^{3}) }[/math] as well. For the QR algorithm with a reasonable target precision, this is [math]\displaystyle{ \approx 6 m^{3} }[/math], whereas for divide-and-conquer it is [math]\displaystyle{ \approx \frac{4}{3}m^{3} }[/math]. The reason for this improvement is that in divide-and-conquer, the [math]\displaystyle{ \Theta(m^{3}) }[/math] part of the algorithm (multiplying [math]\displaystyle{ Q }[/math] matrices) is separate from the iteration, whereas in QR, this must occur in every iterative step. Adding the [math]\displaystyle{ \frac{8}{3}m^{3} }[/math] flops for the reduction, the total improvement is from [math]\displaystyle{ \approx 9 m^{3} }[/math] to [math]\displaystyle{ \approx 4 m^{3} }[/math] flops.

Practical use of the divide-and-conquer algorithm has shown that in most realistic eigenvalue problems, the algorithm actually does better than this. The reason is that very often the matrices [math]\displaystyle{ Q }[/math] and the vectors [math]\displaystyle{ z }[/math] tend to be numerically sparse, meaning that they have many entries with values smaller than the floating point precision, allowing for numerical deflation, i.e. breaking the problem into uncoupled subproblems.

Variants and implementation

The algorithm presented here is the simplest version. In many practical implementations, more complicated rank-1 corrections are used to guarantee stability; some variants even use rank-2 corrections.[citation needed]

There exist specialized root-finding techniques for rational functions that may do better than the Newton-Raphson method in terms of both performance and stability. These can be used to improve the iterative part of the divide-and-conquer algorithm.

The divide-and-conquer algorithm is readily parallelized, and linear algebra computing packages such as LAPACK contain high-quality parallel implementations.[citation needed]

References