207
Subspace methods for linear, nonlinear, and eigen problems Diederik R. Fokkema

Diederik Fokkema - Thesis

Embed Size (px)

Citation preview

Page 1: Diederik Fokkema - Thesis

Subspace methods forlinear, nonlinear, andeigen problems

Diederik R. Fokkema

Page 2: Diederik Fokkema - Thesis
Page 3: Diederik Fokkema - Thesis

Subspace methods for linear,nonlinear, and eigen problems

Deelruimte methoden voor lineaire,niet-lineaire, en eigen problemen

(met een samenvatting in het Nederlands)

Proefschrift

ter verkrijging van de graad van doctor aan de Univer-siteit Utrecht op gezag van de Rector Magnificus, Prof.Dr. J.A. van Ginkel, ingevolge het besluit van het Collegevan Decanen in het openbaar te verdedigen op dinsdag29 oktober 1996 des middags te 14.30 uur

door

Diederik Redbad Fokkema

geboren op 3 maart 1966, te Amsterdam

Page 4: Diederik Fokkema - Thesis

promotor: Prof. dr. H.A. Van der Vorstco-promotor: dr. G. L.G. Sleijpen

Faculteit der Wiskunde en Informatica

ISBN 90-393-1097-1

Page 5: Diederik Fokkema - Thesis

a small step for man

a BiCGstab for mankind

Page 6: Diederik Fokkema - Thesis
Page 7: Diederik Fokkema - Thesis

Preface

This thesis could not have been written without the help of many people.In particular, I wish to thank Henk Van der Vorst and Gerard Sleijpen forproviding a unique environment for doing research. Their doors were alwaysopen and we had many inspiring discussions.

Then there are my former colleagues: Arno van Duin, my roommate fortwo days a week, Karin Oudshoorn and Maarten Schipper, from the roomnext door, and Martin van Gijzen from one floor up. I spent many enjoyablehours with them, drinking coffee, having lunch, discussing mathematics andlife itself. They made my stay in Utrecht a very pleasant one.

Furthermore, I’m grateful to Prof. A.O. H. Axelsson, Prof. C. Brezinsky,dr. M. Gutknecht, and Prof. A. E.O. Veldman for reading the manuscript andfor their patience while waiting for the final version.

I also want to thank my family and my friends in Amsterdam: “We moetennog maar eens wat dingen doen in de Wildeman”.

Finally, I wish to thank my wife Eline who had to endure a great deal whileI was working on this thesis. She gave me unconditional support.

Zurich, September 1996 Diederik Fokkema

Page 8: Diederik Fokkema - Thesis
Page 9: Diederik Fokkema - Thesis

Contents

Preface v

Contents x

List of Algorithms xi

Introduction 1

1 Nested Krylov methods and preserving the orthogonality 191.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191.2 Consequences of inner orthogonalization . . . . . . . . . . . . . 231.3 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

1.3.1 GCR and GMRESR . . . . . . . . . . . . . . . . . . . . 271.3.2 GCRO with GMRES as inner iteration . . . . . . . . . 27

1.4 Truncation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281.4.1 A strategy for truncation . . . . . . . . . . . . . . . . . 281.4.2 Dropping a vector . . . . . . . . . . . . . . . . . . . . . 301.4.3 Assembly of two vectors . . . . . . . . . . . . . . . . . . 30

1.5 Numerical experiments . . . . . . . . . . . . . . . . . . . . . . . 311.5.1 Problem 1 . . . . . . . . . . . . . . . . . . . . . . . . . . 321.5.2 Problem 2 . . . . . . . . . . . . . . . . . . . . . . . . . . 331.5.3 Problem 3 . . . . . . . . . . . . . . . . . . . . . . . . . . 35

1.6 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

2 BiCGstab(`) for linear equations 412.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412.2 Theoretical justification of BiCGstab(`) . . . . . . . . . . . . . 442.3 The BiCGstab(`) algorithm . . . . . . . . . . . . . . . . . . . . 47

2.3.1 The computation of the Bi-CG iteration coefficients . . 472.3.2 The construction of the BiCGstab(`) algorithm . . . . . 482.3.3 The Bi-CG part . . . . . . . . . . . . . . . . . . . . . . 512.3.4 The MR part . . . . . . . . . . . . . . . . . . . . . . . . 52

Page 10: Diederik Fokkema - Thesis

viii Contents

2.3.5 The computational cost and memory requirements . . . 552.3.6 Remarks on the implementation of the algorithm . . . . 562.3.7 Variants . . . . . . . . . . . . . . . . . . . . . . . . . . . 572.3.8 The stability . . . . . . . . . . . . . . . . . . . . . . . . 58

2.4 The preconditioned BiCGstab(`) algorithm . . . . . . . . . . . 592.5 Numerical examples . . . . . . . . . . . . . . . . . . . . . . . . 59

2.5.1 Example 1 . . . . . . . . . . . . . . . . . . . . . . . . . . 602.5.2 Example 2 . . . . . . . . . . . . . . . . . . . . . . . . . . 612.5.3 Example 3 . . . . . . . . . . . . . . . . . . . . . . . . . . 632.5.4 Example 4 . . . . . . . . . . . . . . . . . . . . . . . . . . 64

2.6 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

3 Enhanced implementation of BiCGstab(`) 673.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 673.2 Maintaining the convergence . . . . . . . . . . . . . . . . . . . . 703.3 Reliable updates . . . . . . . . . . . . . . . . . . . . . . . . . . 723.4 Description of FORTRAN code . . . . . . . . . . . . . . . . . . 733.5 Numerical experiments . . . . . . . . . . . . . . . . . . . . . . . 83

3.5.1 Example 1 . . . . . . . . . . . . . . . . . . . . . . . . . . 833.5.2 Example 2 . . . . . . . . . . . . . . . . . . . . . . . . . . 83

3.6 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

4 Generalized conjugate gradient squared 874.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 874.2 Bi-CG and CGS . . . . . . . . . . . . . . . . . . . . . . . . . . 904.3 Disadvantages of squaring the iteration polynomial . . . . . . . 914.4 Generalized CGS: methods of CGS type . . . . . . . . . . . . . 934.5 Well known methods of CGS type . . . . . . . . . . . . . . . . 95

4.5.1 CGS: using the Bi-CG polynomials . . . . . . . . . . . . 954.5.2 Bi-CGSTAB: using products of optimal first degree factors 95

4.6 New methods of CGS type . . . . . . . . . . . . . . . . . . . . . 964.6.1 CGS2: using related Bi-CG polynomials . . . . . . . . . 974.6.2 Shifted CGS: using delayed Bi-CG polynomials . . . . . 98

4.7 Numerical examples . . . . . . . . . . . . . . . . . . . . . . . . 1004.7.1 Characteristics of CGS2 . . . . . . . . . . . . . . . . . . 1004.7.2 Characteristics of Shifted CGS . . . . . . . . . . . . . . 1014.7.3 CGS2 as linear solver in a Newton scheme . . . . . . . . 1044.7.4 Shifted CGS as linear solver in a Newton scheme . . . . 107

4.8 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109

Page 11: Diederik Fokkema - Thesis

Contents ix

5 Accelerated Inexact Newton schemes 1115.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1115.2 Inexact Newton methods . . . . . . . . . . . . . . . . . . . . . . 1135.3 Accelerating Inexact Newton methods . . . . . . . . . . . . . . 113

5.3.1 Acceleration in the linear case . . . . . . . . . . . . . . . 1145.3.2 Acceleration in the nonlinear case . . . . . . . . . . . . 115

5.4 Computational considerations . . . . . . . . . . . . . . . . . . . 1175.4.1 Restart . . . . . . . . . . . . . . . . . . . . . . . . . . . 1175.4.2 Update . . . . . . . . . . . . . . . . . . . . . . . . . . . 1195.4.3 The projected problem . . . . . . . . . . . . . . . . . . . 1195.4.4 Expanding the search subspace . . . . . . . . . . . . . . 120

5.5 How linear solvers fit in the AIN framework . . . . . . . . . . 1205.5.1 GCR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1205.5.2 FOM and GMRES . . . . . . . . . . . . . . . . . . . . . 1205.5.3 GMRESR . . . . . . . . . . . . . . . . . . . . . . . . . . 120

5.6 AIN schemes for mildly nonlinear problems . . . . . . . . . . . 1205.6.1 Arnoldi’s method . . . . . . . . . . . . . . . . . . . . . . 1225.6.2 Davidson’s method . . . . . . . . . . . . . . . . . . . . . 1225.6.3 Jacobi-Davidson . . . . . . . . . . . . . . . . . . . . . . 123

5.7 AIN schemes for general nonlinear problems . . . . . . . . . . 1235.8 Numerical experiments . . . . . . . . . . . . . . . . . . . . . . . 124

5.8.1 A 1D Burgers’ equation . . . . . . . . . . . . . . . . . . 1255.8.2 The Bratu problem . . . . . . . . . . . . . . . . . . . . . 1265.8.3 The driven cavity problem . . . . . . . . . . . . . . . . . 127

5.9 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130

6 Jacobi-Davidson style QR and QZ algorithms 1336.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1336.2 The standard eigenproblem . . . . . . . . . . . . . . . . . . . . 136

6.2.1 Jacobi-Davidson . . . . . . . . . . . . . . . . . . . . . . 1366.2.2 Practical selection and implicit restart . . . . . . . . . . 1376.2.3 JDQR . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1406.2.4 Preconditioning . . . . . . . . . . . . . . . . . . . . . . . 1426.2.5 The selection of Ritz pairs . . . . . . . . . . . . . . . . . 1456.2.6 Notes on the speed of convergence . . . . . . . . . . . . 1496.2.7 The quality of the deflated preconditioner . . . . . . . . 150

6.3 The generalized eigenproblem . . . . . . . . . . . . . . . . . . . 1516.3.1 Jacobi-Davidson . . . . . . . . . . . . . . . . . . . . . . 1516.3.2 Practical selection and implicit restart . . . . . . . . . . 1566.3.3 JDQZ . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1576.3.4 Preconditioning . . . . . . . . . . . . . . . . . . . . . . . 1586.3.5 The selection of Petrov pairs . . . . . . . . . . . . . . . 159

Page 12: Diederik Fokkema - Thesis

x Contents

6.4 Numerical experiments . . . . . . . . . . . . . . . . . . . . . . . 1636.4.1 The influence of the correction equation . . . . . . . . . 1656.4.2 The effect of preconditioning . . . . . . . . . . . . . . . 1656.4.3 Multiple eigenvalues . . . . . . . . . . . . . . . . . . . . 1676.4.4 Harmonic Ritz values . . . . . . . . . . . . . . . . . . . 1686.4.5 Tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . 1706.4.6 The influence of Qk and Zk in the correction equation . 1716.4.7 More multiple eigenvalues . . . . . . . . . . . . . . . . . 1736.4.8 Harmonic Ritz values for generalized problems . . . . . 175

6.5 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1776.A Modified Gram-Schmidt . . . . . . . . . . . . . . . . . . . . . . 1796.B Sorting the Schur form . . . . . . . . . . . . . . . . . . . . . . . 1796.C Sorting the generalized Schur form . . . . . . . . . . . . . . . . 180

References 183

Summary 189

Samenvatting 191

Curriculum vitae 193

Page 13: Diederik Fokkema - Thesis

List of Algorithms

1.1 GCR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201.2 GMRESR(m) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201.3 Generic GCRO . . . . . . . . . . . . . . . . . . . . . . . . . . . 231.4 Efficient GCRO(m) with GMRES . . . . . . . . . . . . . . . . . 29

2.1 Bi-CG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442.2 BiCGstab(`) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

3.1 Preconditioned BiCGstab(`) . . . . . . . . . . . . . . . . . . . . 693.2 Convex combination . . . . . . . . . . . . . . . . . . . . . . . . 723.3 Enhanced preconditioned BiCGstab(`) . . . . . . . . . . . . . . 74

4.1 Bi-CG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 924.2 CGS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 924.3 GCGS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 964.4 Bi-CGSTAB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 974.5 CGS2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99

5.1 Inexact Newton . . . . . . . . . . . . . . . . . . . . . . . . . . . 1145.2 Jacobi Iteration . . . . . . . . . . . . . . . . . . . . . . . . . . . 1145.3 Accelerated Inexact Newton . . . . . . . . . . . . . . . . . . . . 118

6.1 JD with restart . . . . . . . . . . . . . . . . . . . . . . . . . . . 1396.2 Preconditioned JDQR, part 1 . . . . . . . . . . . . . . . . . . . 1466.3 Preconditioned JDQR, part 2 . . . . . . . . . . . . . . . . . . . 1476.4 Preconditioned JDQZ, part 1 . . . . . . . . . . . . . . . . . . . 1606.5 Preconditioned JDQZ, part 2 . . . . . . . . . . . . . . . . . . . 161

Page 14: Diederik Fokkema - Thesis

xii List of Algorithms

Page 15: Diederik Fokkema - Thesis

Introduction

This thesis concerns iterative subspace methods for linear-, nonlinear-, andeigenproblems, which appear frequently in many different areas of science,including chemistry, economics, engineering, and physics. In these disciplines,studying the behavior of some kind of phenomenon generally involves a set of(non)linear partial differential equations that has to be solved.

Subspace methods are suitable for solving these, sometimes large, prob-lems efficiently and are particular useful when direct solution methods are notfeasible, due to memory limitations, excessive use of CPU-time, or when justno explicit solution formula exists. They may also be an alternative for directmethods when only an approximate solution is wanted. In that case subspacemethods may be more efficient.

In this introduction we will briefly sketch the ideas behind subspace meth-ods. We will discuss some well-known existing subspace methods for partic-ular classes of problems and point out some of their weaknesses. Identifyingthese weaknesses is one step in the direction towards methods with improvedproperties. We will also discuss some recent developments in relation to thechapters in this thesis. Each of the chapters consists of a paper and can beread separately.

The general idea. Subspace methods compute iteratively an approxi-mate solution for a given problem. They generate a basis for a subspace ofincreasing dimension and determine the best solution in this subspace. Thisleads to a much smaller problem that resembles the original large problem.To increase the dimension of the subspace often a suitable nearby system issolved. With the solution of this nearby system (preconditioner, or correctionequation) the subspace is expanded and the process is repeated until conver-gence.

In this setting, keystones to an efficient and fast converging method for aparticular problem involve the following aspects:

• the computation of a suitable basis for the subspace,• the choice of preconditioner, or the correction equation.

The identification of an approximate solution in the subspace is often a minorproblem, but we will also consider this aspect.

Page 16: Diederik Fokkema - Thesis

2 Introduction

In the following, we will comment on these aspects for the different classesof problems, addressed in this thesis..

Subspace methods for linear problems. In Chapter 1–4 we presentsubspace methods for linear problems

Ax = b,

in which A is a, usually large and sparse, nonsingular (n× n)-matrix and b agiven n-vector. Starting from an initial guess x0, the objective is to computean approximate solution xk for which the residual rk = b − Axk is small insome sense.

Many iterative method belong to the class of so-called Krylov subspacemethods. The methods in this class have in common that they computeapproximate solution xk for which xk − x0 belongs to the Krylov subspaceKk(A; r0) of order k spanned by r0, Ar0, . . . , Ak−1r0.

One of the simplest schemes in this class, is the following standard Richard-son type of method:

Set k = −1 and choose an initial approximation x0.Set r0 = b−Ax0 and repeat until rk is small enough:

k = k + 1xk+1 = xk + rkrk+1 = rk −Ark

This iterative scheme converges linearly with a rate proportional to thespectral radius of (I−A), provided it is smaller than 1. Unfortunately, for mostlinear systems, this value is either very close to 1, or larger. The convergenceproperties are poor and the main reason for this is that the solution is staticallyupdated.

More sophisticated Krylov methods with better convergence properties up-date the solution dynamically. With a suitable linear combination of all thebasis vectors, they exploit the whole Krylov subspace. We can subdivide theclass of these methods as follows:

• The Galerkin methods: Construct xk for which the residual rk is or-thogonal to Kk(A; r0);• The minimal residual methods: Construct xk for which the residual‖rk‖2 is minimal;• The Petrov-Galerkin methods: Construct xk for which the residual rk

is orthogonal to some other suitable k-dimensional subspace.

An example of a Galerkin method is Lanczos’ method [57] for symmetricmatrices. Starting with v1 = r0/‖r0‖2, the method constructs a sequence oforthogonal basis vectors v2, v3, . . . for the Krylov subspace using a three-term

Page 17: Diederik Fokkema - Thesis

Subspace methods for linear problems 3

recurrence. Denoting Vk = [v1, v2, . . . , vk] we can formulate the relations interms of matrices as:

AVk = VkTk + tk+1,kvk+1eTk ,

where Tk = (ti,j) is a symmetric tridiagonal (k× k)-matrix. The approximatesolution is xk = x0 + Vkyk, where yk follows from the Galerkin condition

0 = V Tk (b−Axk) = V T

k (r0 −AVkyk)

= V Tk (r0 − VkTkyk)

= ‖r0‖2e1 − Tkyk.

The latter equation can be solved easily with standard techniques for tridiag-onal matrices, see, e.g., LAPACK [1].

When the matrix A is in addition positive definite, we can use the Choleskydecomposition of Tk to split the three-term recurrence into a coupled two-termrecurrence for the solution of the tridiagonal system and update the solutionon the fly! This elegant procedure is the famous Conjugate Gradients method(CG) [51]. It has very nice properties: it is remarkably stable, it minimizesthe A-norm of the error, and the memory requirements and the computationalcosts are constant per iteration.

For general unsymmetric problems the Generalized Minimal Residual (GM-RES) [82] is probably the most famous. It follows the minimal residual ap-proach, as the name already suggests. The method is based on Arnoldi’smethod [2] for the construction of an orthogonal basis v1, v2, . . . , vk for theKrylov subspace of order k:

v1 = r0/‖r0‖2for j = 1, 2, . . . , k

v = Avj

for i = 1, 2, . . . , jhi,j = (v, vj)v = v − hi,jvj

endhi+1,j = ‖v‖2vj+1 = v/hi+1,j

end

In terms of matrices this can be expressed as

AVk = VkHk + hk+1,kvk+1eTk ,

where Hk is an (k × k) upper Hessenberg matrix, or as

AVk = Vk+1Hk,

Page 18: Diederik Fokkema - Thesis

4 Introduction

where

Hk =[

Hk

hk+1,keTk

].

Using this relation, the minimal residual solution xk = Vkyk now follows fromminimizing

‖b−Axk‖2 = ‖r0 −AVkyk‖2= ‖r0 − Vk+1Hkyk‖2= ‖V T

k+1(r0 − Vk+1Hkyk)‖2= ‖ ‖r0‖2e1 − Hkyk ‖2.

Using Givens rotations the last minimization problem can be solved easily.The methods has also nice properties: it converges monotonically and cannot breakdown before the solution is found. However, GMRES has to uselong recursions and needs all basis vectors throughout the process [35]. Thisleads to increasing memory needs and to increasing computational overheadper iteration step. A simple solution to overcome this problem is to restartGMRES with the most recent approximation as an initial guess after, say, miteration steps. Unfortunately, by doing this GMRES loses its optimality, see,e.g., [104].

Another method for the unsymmetric linear problem is the bi-Lanczosmethod [57] and it is of Petrov-Galerkin type. This method avoids long recur-sions by generating bi-orthogonal bases for Kk(A; r0) and Kk(AT ; r0), wherer0 is some arbitrary, but fixed, vector. More specifically, bi-Lanczos constructsbi-orthogonal bases Vk and Wk for Kk(A; r0) and Kk(AT ; r0), respectively,using three-term recursions such that

AVk = VkTk + tk+1,kvkeTk ,

ATWk = WkTk + tk+1,kwkeTk , and

WTk Vk = Dk,

where Tk is a tridiagonal (k × k)-matrix and Dk a diagonal (k × k)-matrix.The approximate solution is xk = x0 +Vkyk, where yk follows from the Petrov-Galerkin condition with respect to Kk(AT ; r0)

0 = WTk (b−Axk) = WT

k (r0 −AVkyk)

= WTk (r0 − VkTkyk)

= WTk Vk(‖r0‖2e1 − Tkyk)

= Dk(‖r0‖2e1 − Tkyk).

Page 19: Diederik Fokkema - Thesis

The minimal residual approach 5

We have assumed that this procedure can be carried out, but this is not alwaysthe case: the three-term recursion breaks down when a diagonal element di ofDk becomes zero. In the literature this event is referred to as the “Lanczos”breakdown. In finite precision arithmetic an exact breakdown is unlikely, buta near breakdown, i.e., di ≈ 0, may lead to numerical instabilities. Theseinstabilities can be repaired to a large extend by using so-called look-aheadtechniques [72, 41, 48]. The idea is to construct block bi-orthogonal bases.

With the help of an LU decomposition of Tk without pivoting, the bi-Lanczos procedure can be implemented, similar to CG, very efficiently withshort recursions and the use of only the last 2 basis vectors of both subspaces.The resulting method is known as Bi-Conjugate Gradient (Bi-CG) [36]. Aproblem here is that the LU decomposition not always exists in which case wehave another breakdown: the “pivot” breakdown.

Apart from the possible (near) breakdowns, Bi-CG has another few draw-backs:

• two matrix multiplications are necessary for each iteration step, sincetwo Krylov subspaces are involved;• AT is needed which may not be readily available;• the method may involve large intermediate residual vectors that may

spoil the accuracy of the approximate solution [91].

In summary, the unsymmetric case gives rise to different problems. ForGMRES the dimension of the subspace must be limited to restrict computa-tional overhead; for Bi-CG, the non-orthogonality may lead to stability prob-lems.

For more details on Krylov subspace methods for linear problems, see,e.g., [11, 44, 86].

In the past decade, much research has been done in order to improve onGMRES and Bi-CG, with respect to the above mentioned problems, and manynew variants have been proposed.

In the following we highlight some of the most important developments.We will distinguish between methods that are based on the minimal resid-ual approach (GMRES), and methods that are based on the Petrov-Galerkinapproach (Bi-CG). We will use this expose to frame our new contributions.

The minimal residual approach. Recently, in [5, 81] and [105] severalminimal residual methods have been proposed in which the idea of building apure Krylov subspace is abandoned. Instead, a subspace is built with (possibly)different “preconditioners” per iteration step.

The methods consist of an inner and an outer iteration scheme. First, asuitable linear system is (approximately) solved to find an expansion vector(the inner iteration). Then, the subspace is expanded and the minimal residualsolution is determined with respect to this new subspace (the outer iteration).

Page 20: Diederik Fokkema - Thesis

6 Introduction

For the inner iteration one can use, for example, the same method as in theouter iteration (nesting), some appropriate approximate inverse, or even someother (preconditioned) iterative method. The only restriction is that the inneriteration should produce an expansion vector with which in the outer iterationthe residual is reduced; otherwise the methods break down.

Because the subspace (hopefully) contains better components of the so-lution (with respect to the pure Krylov subspace), the size of the subspacenecessary to find an acceptable solution can be kept smaller, and consequentlythe memory requirements and the computational overhead are more favorable.

The variants presented in [5] are based on the Generalized Conjugate Gradi-ent solver (GENCG), see also [3]. The method in [81] is very similar to GMRESand is called Flexible GMRES (FGMRES). The method in [105] (GMRESR)is based on GCR [34] and constructs (in exact arithmetic) the same iterates asone of the methods presented in [5] provided the same preconditioner is usedin each iteration.

However, compared with GMRESR, the methods in [5] are more expen-sive per iteration in terms of inner products, vector updates, and/or matrixmultiplications. For example, one algorithm needs two matrix multiplicationsper step, the other about twice as many inner products and 50% more vectorupdates. Moreover, the algorithm in [5] uses standard Gram-Schmidt, whichpotentially may lead to numerical instabilities, in contrast to GMRESR, whichuses Modified Gram-Schmidt.

FGMRES builds a subspace that is different from the one in GMRESRor GENCG. The difference is that in FGMRES the linear system in the in-ner iteration involves the last basis vector of the (outer) subspace, whereasin GMRESR or GENCG the linear system involves the most recent residual.Working with the last residual offers better opportunities to control the break-down possibility, see [105].

Moreover, FGMRES is not as flexible as GMRESR or GENCG if one wantsto reduce the size of the subspace for efficiency reasons (truncation). Thereason for this is that FGMRES relies on the Arnoldi recursion relations fordetermining the approximate solution, and these are destroyed if the basis forthe subspace is changed.

For many linear systems the methods work quite well and are more efficientthan restarted (variants) of GMRES. However, there are cases where the speedof convergence is still unsatisfactory. One of the reasons for this is that theinner iterations “know” nothing about the outer subspace and so it mighthappen that the inner iteration produces a poor expansion vector, i.e., a vectorthat does not help to reduce the residual very much. If one is not careful, thisphenomenon might repeat itself in the next iterations and thus the speed ofconvergence deteriorates. In such a situation one may consider to change thepreconditioner, but this is not always feasible.

Page 21: Diederik Fokkema - Thesis

The minimal residual approach 7

In Chapter 1 we propose a strategy to transfer information from the outeriteration to the inner iteration. This may help to overcome the deteriorationof the convergence speed.

Even though the mentioned methods are designed to keep the dimensionof the subspace limited, it may happen that the size still exceeds availablecomputer resources. We will also present a truncation strategy that helps todiscard parts of the subspace and that appears to affect the speed of conver-gence not too much.

We have chosen to apply our ideas to GMRESR, since this is the mostflexible one of the methods mentioned before.

Below we give the abstract of Chapter 1.

Chapter 1

Nested Krylov methods and preserving the orthogonality

Abstract. Recently the GMRESR [105] inner-outer iteration scheme forthe solution of linear systems of equations has been proposed by Van derVorst and Vuik. Similar methods have been proposed by Axelsson and Vas-silevski [5], and Saad (FGMRES) [81]. The outer iteration is GCR, whichminimizes the residual over a given subspace. The inner iteration is GMRES,which at each step computes an expansion for the subspace by approximatelysolving a correction equation. However, the optimality of the approximationover the outer subspace is ignored in the inner iteration. This leads to subop-timal corrections to the solution in the outer iteration, as parts of the outersubspace may reenter in the inner iteration process. Therefore we propose topreserve the orthogonality relations of GCR also in the inner iteration. Thisgives optimal corrections, however, it involves working with a singular, non-symmetric operator. We will discuss some important properties and we willshow by experiments, that in terms of matrix vector products this modifica-tion (almost) always leads to better convergence. However, because we domore orthogonalizations, it does not always give an improved performance inCPU-time. Furthermore, we will discuss an efficient implementation as wellas truncation possibilities of the outer GCR process. Of course, we can alsouse other iteration schemes than GMRES as the inner method. Methods withshort recurrences like Bi-CGSTAB seem especially interesting. The experi-mental results indicate that, especially for such methods, it is advantageous topreserve the orthogonality in the inner iteration.

Part of this paper was published as: E. De Sturler and D. R. Fokkema, NestedKrylov methods and preserving the orthogonality, in Sixth Copper Mountain Conference onMultigrid Methods, N. D. Melson, T. A. Manteuffel, and S. F. McCormick, eds., vol. Part 1of NASA Conference Publication 3324, NASA, 1993, pp. 111–126.

Page 22: Diederik Fokkema - Thesis

8 Introduction

The Petrov-Galerkin approach. The research concerning variants ofBi-CG has focused mainly on the (possibly inefficient) multiplication with AT ,the breakdown possibilities, and on the irregular convergence.

Below we discuss some recent important contributions with respect to theseproblems.

The quasi minimal residual approach. A recent method, the Quasi MinimalResidual method (QMR) [41] attacks the last two problems and has beendesigned to cure the two (near) breakdown possibilities of Bi-CG and to smoothdown the irregular convergence. QMR is based on the look-ahead version of thebi-Lanczos algorithm [72], combined with a “quasi” minimal residual approachapproach. The method works as follows.

Suppose, for simplicity, that no look-ahead is necessary. Recall that thebi-Lanczos algorithm produces bi-orthogonal bases Vk and Wk such that:

AVk = VkTk + tk+1,kvkeTk ,

ATWk = WkTk + tk+1,kwkeTk , and

WTk Vk = Dk.

Denoting

Tk =[

Tk

tk+1,keTk

],

we have thatAVk = Vk+1Tk.

It follows that for the norm of the residual rk we have the following expression:

‖b−Axk‖2 = ‖r0 −AVkyk‖2= ‖r0 − Vk+1Tkyk‖2.= ‖Vk+1(‖r0‖2e1 − Tkyk)‖2.

Ideally, we would like to choose yk such that ‖rk‖2 is minimal. However, thiswould require much effort because in general Vk+1 is not orthogonal. TheQMR iterates now follow from minimizing the quasi residual

‖zk‖2 = ‖‖r0‖2e1 − Tkyk‖2,

ignoring the fact that Vk+1 is not orthogonal. This does not truly minimizethe residual, which explains the prefix “quasi”. In fact one can show that [41]

σmin(Vk+1)‖zk‖2 ≤ ‖rQMRk ‖2 ≤

√k + 1‖zk‖2.

Page 23: Diederik Fokkema - Thesis

The Petrov-Galerkin approach 9

The Bi-CG iterates can be recovered from the QMR process and the methodexhibits smooth convergence, but essentially the convergence speed is the sameas for Bi-CG [24]. It can be proven that:

‖rBi-CGk ‖=

‖zQMRk ‖2√

1− (‖zQMRk ‖2/‖zQMR

k−1 ‖2)2,

and thus whenever QMR has a local significant reduction for the quasi resid-uals, then the corresponding residual norm for Bi-CG is comparable.

Attempts to eliminate the necessity of multiplications with AT in the QMRapproach can be found in, for instance, [39, 18, 42]. However, no look-aheadstrategies to overcome the possible Lanczos breakdowns are incorporated,which may be a disadvantage with respect to QMR.

The composite step approach. In [10, 9] a different approach is followed. Afairly simple modification to Bi-CG is proposed to cure the (near) pivot break-down. This is done by incorporating a so-called “composite step”. The idea isto skip over one step of the Bi-CG method explicitly when the correspondingiterate is not well-defined.

The polynomial approach. In [15, 16] and also [47] the breakdown problemis tackled from the point of view of polynomials. Since xk − x0 belongs to theKrylov subspace spanned by r0, Ar0, . . . , Ak−1r0 it follows that

xk − x0 = −α1r0 − · · · − αkAk−1r0,

which means that

rk = r0 + α1Ar0 + · · ·+ αkAkr0

= φk(A)r0

for the polynomialφk(t) = 1 + α1t+ · · ·+ αkt

k.

And thus, the Bi-CG algorithm can be linked with the theory of formal orthog-onal polynomials with respect to a particular linear functional. Breakdownsin the Bi-CG algorithm naturally translate to breakdowns in the generation ofsuch polynomials and visa versa. The rich theory of formal orthogonal polyno-mials then provides means to construct breakdown-free algorithms, e.g., MRZ,the method of recursive zoom [15].

The hybrid approach. In [93] the polynomial point of view was also takenand it led to the Conjugate Gradient Squared method (CGS). CGS uses (im-plicitly) the square of the Bi-CG polynomial φk and constructs, with shortrecursions, approximate solutions xk with corresponding residual

rk = φk(A)2r0.

Page 24: Diederik Fokkema - Thesis

10 Introduction

A remarkable fact is that CGS does not need multiplications with AT , in con-trast to Bi-CG. Moreover, for many problems CGS is about twice as efficientas Bi-CG and therefore the method has become quite popular. However, themethod is also notorious for its irregular convergence behavior with large in-termediate residuals, which may spoil the accuracy of the solution and maydeteriorate the speed of convergence. Moreover, since it is based on the Bi-CGpolynomial it may suffer from the same breakdowns.

In [102] another approach was taken in an attempt to smooth the conver-gence of CGS. Instead of using the square of the Bi-CG polynomial φk, aproduct of polynomials of the form ψkφk was taken. More precisely, ψk waschosen as

ψk(t) = (1− ω1t)(1− ω2t) · · · (1− ωkt),

with coefficient ωi such that ‖ri‖2 is minimal with respect to ωi. The resultingmethod is known as Bi-CGSTAB and it exhibits smooth and fast convergencebehavior for many problems. However, in addition to the Bi-CG breakdowns,it may suffer from another (near) breakdown possibility, namely when ωi is(almost) equal to zero.

CGS and Bi-CGSTAB belong to the so-called class of Hybrid Bi-CG meth-ods. They are called hybrid because their residuals rk can be formally writtenas

rk = ψk(A)φk(A)r0,

in which ψk ∈ P1k , the space of all polynomials p of degree ≤ k with p(0) = 1,

and φk is the Bi-CG polynomial. In CGS the polynomial ψk is chosen as theBi-CG polynomial φk. In Bi-CGSTAB it is chosen as a product of locallyminimizing polynomials of degree 1.

CGS and Bi-CGSTAB are certainly improvements over Bi-CG for manyproblems, and they can compete with GMRES and its variants. Unfortunatelythey also introduce new weaknesses: CGS may converge even more irregularly;and Bi-CGSTAB may suffer from one additional breakdown possibility.

In Chapter 2–4 we explore the possibilities for selecting other polynomialsψk to improve on Bi-CG and on the above mentioned problems.

Below we give the abstracts of the Chapters 2–4.

Chapter 2

BiCGstab(`) for linear equations involving unsymmetricmatrices with complex spectrum

Abstract. For the solution of classes of linear systems of equations arisingfrom realistic problems, the Bi-CGSTAB algorithm [102] is attractive. Un-fortunately, for some relevant problems, where, for instance, Bi-CG performs

Page 25: Diederik Fokkema - Thesis

The Petrov-Galerkin approach 11

well, the convergence of Bi-CGSTAB stagnates. This was observed specificallyin the case of discretized advection dominated PDE’s. The stagnation is dueto the fact that for this type of equations the matrix has almost pure imagi-nary eigenvalues. With his BiCGStab2 algorithm Gutknecht [49] attempted toavoid this stagnation. Here, we generalize the Bi-CGSTAB algorithm further,and overcome some shortcomings of BiCGStab2. The new algorithm combinesGMRES(`) and Bi-CG.

Published as: G. L. G. Sleijpen and D. R. Fokkema, BiCGstab(`) for linear equationsinvolving matrices with complex spectrum, Electronic Transactions on Numerical Analysis, 1(1993), pp. 11–32.

Chapter 3

Enhanced implementation of BiCGstab(`) for solving linearsystems of equations

Abstract. In this paper, we present a FORTRAN implementation of theBiCGstab(`) algorithm [85]. The implementation is based on the power basisvariant of BiCGstab(`). This variant is enhanced with a more stable way ofdetermination of the iteration coefficients and with a more reliable updatestrategy for the residuals [91, 88]. These enhancements improve the accuracyand rate of convergence at almost no additional computational costs.

Published as: D. R. Fokkema, Enhanced implementation of BiCGstab(`) for solvinglinear systems of equations, Preprint 976, Department of Mathematics, Utrecht University,Utrecht, The Netherlands, 1996.

Chapter 4

Generalized conjugate gradient squared

Abstract. The Conjugate Gradient Squared (CGS) is an iterative methodfor solving nonsymmetric linear systems of equations. However, during theiteration large residual norms may appear, which may lead to inaccurate ap-proximate solutions or may even deteriorate the convergence rate. Instead ofsquaring the Bi-CG polynomial as in CGS, we propose to consider productsof two nearby Bi-CG polynomials which leads to generalized CGS methods, ofwhich CGS is just a particular case. This approach allows the construction ofmethods that converge less irregularly than CGS and that improve on otherconvergence properties as well. Here, we are interested in a property that gotless attention in literature: we concentrate on retaining the excellent approx-imation qualities of CGS with respect to components of the solution in thedirection of eigenvectors associated with extreme eigenvalues. This property

Page 26: Diederik Fokkema - Thesis

12 Introduction

seems to be important in connection with Newton’s scheme for nonlinear equa-tions: our numerical experiments show that the number of Newton steps maydecrease significantly when using a generalized CGS method as linear solverfor the Newton correction equations.

Published as: D. R. Fokkema, G. L. G. Sleijpen, and H. A. Van der Vorst, Gen-eralized conjugate gradient squared, J. Comput. Appl. Math., 71 (1996), pp. 125–146.

Subspace methods for nonlinear problems. In Chapter 5 we dis-cuss a class of methods for general nonlinear problems. The methods in thisclass are suitable for computing approximate solutions of the general nonlinearproblem

F (x) = 0.

A well known method for the nonlinear problem is the Inexact Newton method [31,69]. This method corrects its current approximation with the (approximate)solution of a linear problem involving the Jacobian. More precisely, for a givenapproximate solution xk, an approximation pk for the error ∆x = x − xk isobtained through the linear approximation

F (xk) + Jk∆x ≈ F (xk + ∆x) = F (x) = 0,

where Jk = F ′(xk), the Jacobian of F in xk. That is, the correction equation

Jk∆x = −F (xk)

is solved approximately with approximate solution pk and the new approximatesolution is updated as

xk+1 = xk + pk.

The described procedure is then repeated until convergence.For a sufficiently good initial guess, the speed of convergence is asymp-

totically quadratical when the correction equation is solved exactly. Whenusing only an approximation, the speed of convergence depends on how goodthe correction equation is solved. It can be controlled through forcing termsηk [30]: for some sequence (ηk) let pk be such that

‖F (xk) + Jkpk‖2‖F (xk)‖2

≤ ηk.

If ηk → 0, then the speed of convergence is typically superlinear, and ifηk ≤ c‖F (xk)‖2, then it is typically quadratic. However, in practice it maybe difficult to fulfill one of these requirements, in which case the speed ofconvergence is typically linear at most.

The observation that Inexact Newton is a 1-dimensional subspace method,leads to the idea of using subspaces of higher dimension. By using largersubspaces one may hope that the speed of convergence increases.

Page 27: Diederik Fokkema - Thesis

Subspace methods for nonlinear problems 13

For example, in [4] nonlinear versions of the Generalized Conjugate Gra-dient are described that construct the update as a linear combination of thecurrent correction pk and all previously computed corrections p1, p2, . . . , pk−1,such that

‖F (xk+1)‖2 = ‖F (xk +k∑

i=1

αipi)‖2

is minimal.In [17] another so-called model trust region approach is proposed. The

update is taken from the Krylov subspace Vk, generated by k steps of GMRES,as pk = Vky, where y is the point on the dogleg curve for which ‖y‖2 = τ , thetrust region size: y is an approximation for

miny‖F (xk + Vky)‖2.

Many choices are possible and in Chapter 5 we describe a framework that,amongst others, contains the above described methods. The framework helpsto identify new, possibly more efficient, methods for solving general nonlinearproblems.

Below we give the abstract of Chapter 5.

Chapter 5

Accelerated Inexact Newton schemes for large systems ofnonlinear equations

Abstract. Classical iteration methods for linear systems, such as JacobiIteration, can be accelerated considerably by Krylov subspace methods likeGMRES. In this paper, we describe how Inexact Newton methods for non-linear problems can be accelerated in a similar way and how this leads to ageneral framework that includes many well known techniques for solving linearand nonlinear systems, as well as new ones. Inexact Newton methods are fre-quently used in practice to avoid the expensive exact solution of the large linearsystem arising in the (possibly also inexact) linearization step of Newton’s pro-cess. Our framework includes acceleration techniques for the “linear steps” aswell as for the “nonlinear steps” in Newton’s process. The described class ofmethods, the AIN (Accelerated Inexact Newton) methods, contains methodslike GMRES and GMRESR for linear systems, Arnoldi and Jacobi-Davidsonfor linear eigenproblems, and many variants of Newton’s method, like DampedNewton, for general nonlinear problems. As numerical experiments suggest,the AIN approach may be useful for the construction of efficient schemes for

Page 28: Diederik Fokkema - Thesis

14 Introduction

solving nonlinear problems.

Published as: D. R. Fokkema, G. L. G. Sleijpen, and H. A. Van der Vorst, Ac-celerated inexact Newton schemes for large systems of nonlinear equations, Preprint 918,Department of Mathematics, Utrecht University, Utrecht, The Netherlands, July 1995. Toappear in SIAM J. Sci. Comput..

Subspace methods for eigenproblems. In Chapter 6 we present twoalgorithms, one for computing a few solutions of the standard eigenproblem

Ax = λx,

and one for the generalized eigenproblem

βAx = αBx.

A very simple method for computing the dominant eigenvalue λmax of a sym-metric matrix is the Power method. By dominant we mean that |λmax| |λi|,where λi are all the other eigenvalues.

Starting with some vector v1, the method iterates with powers of A appliedto v1. The ratio of the norm of the last two iterates converges to the absolutevalue of the dominant eigenvalue:

‖Akv1‖2‖Ak−1v1‖2

→ |λmax|

For convergence it is necessary that v1 has a component in the direction ofthe dominant eigenvector. This seems like a restriction, but in practice, usingfinite precision arithmetic, rounding errors provide such a component sooneror later. The speed of convergence depends on how well |λmax| is separatedfrom the absolute value of the other eigenvalues.

A more sophisticated method for the standard eigenproblem is the methodof Arnoldi [2]. It uses a Krylov subspace as we have seen before in GMRES, andit suffers from the same restriction on the size of the subspace. Restarting maybe a solution, but one should realize that by restarting valuable informationis lost and that convergence may be set back. Moreover, identifying a suitablerestart vector is not a trivial task [80, 83].

The method of Arnoldi constructs an orthogonal basis Vk such that

AVk = VkHk + vk+1hk+1,keTk ,

where Hk is a (k × k) upper Hessenberg matrix. The matrix Hk can be seenas the projection of A onto Kk(A; v1), i.e.,

V Tk AVk = Hk.

Page 29: Diederik Fokkema - Thesis

Subspace methods for eigenproblems 15

The dimension of the matrix Hk is in general much smaller than that of A.Hence, the eigenpairs of Hk can be computed easily using standard techniquesavailable from, for instance, LAPACK [1].

If (θ, y) is an eigenpair of Hk, then the Ritz pair (θ, s), with s = Vky, istaken as an approximation to an eigenpair of A. θ is called a Ritz value withrespect to Vk, and s is the corresponding Ritz vector.

It is well known that the speed of convergence of Ritz values is usuallyfaster to exterior eigenvalues than to interior ones [98, 99]. The approxima-tion of interior eigenvalues may be a problem, but this can be overcome byusing so-called Shift-and-Invert [80] variants of Arnoldi’s method. In thesekind of methods the basis is built with the operator (A− σI)−1, which favorseigenvalues in the neighborhood of σ.

For the generalized eigenproblem there exists no method that is similarto the Arnoldi method for the standard eigenproblem. However, a variant ofShift-and-Invert Arnoldi does exist and the method constructs a basis using(A− σB)−1B [80].

Another, more general, method for the generalized eigenproblem is theRational Krylov Subspace method (RKS) [77, 78], which works with operatorsof the form

(δkA− γkB)−1(σkA− ρkB).

This operator may vary from iteration to iteration, in contrast to Shift-and-Invert Arnoldi, and the coefficients may be chosen such that convergence isimproved for eigenvalues in specific regions of the complex plane.

However, a problem associated with these kind of methods is that theyneed the inversion of a matrix, which may be costly or even infeasible for largematrices.

Recently, papers like [94, 58, 83] have renewed interest in Arnoldi basedalgorithms. In these papers it is tried to overcome Arnoldi’s main problem, i.e.,convergence problems due to the limited size of the subspace, by incorporatingsophisticated restart strategies.

The method in [83] applies Chebychev polynomials to the restarting vectorin an attempt to damp unwanted components. This approach is helpful whencomputing a few exterior eigenvalues.

The Implicit Restarted Arnoldi (IRA) method, proposed in [94] and refinedin [58], follows another approach and uses an implicit shifted QR [38, 95]mechanism to eliminate unwanted Ritz values from the Arnoldi subspace. Itdoes so without the need for explicitly restarting the Arnoldi process, and thusavoids expensive matrix multiplications. The method is based on the followingobservations.

Suppose we have a k-dimensional basis for the Krylov subspace with Arnoldi’sorthogonalization method, i.e., we have a (n× k)-matrix Vk and a (k+ 1)× k

Page 30: Diederik Fokkema - Thesis

16 Introduction

Hessenberg matrix Hk such that

AVk = Vk+1Hk.

One step of the shifted QR method with shift µ on Hk yields

Hk − µI = QkRk, H+k−1 := RkQk−1 + µI,

where Qk−1 is the k × (k − 1) upper block of the (k + 1) × k orthogonalHessenberg matrix Qk and Rk is k × k upper triangular. Then H+

k−1 is also ak × (k − 1) Hessenberg matrix and

QkH+k−1 = HkQk−1.

With V +k−1 = VkQk−1 we see that

AV +k−1 = AVkQk−1 = Vk+1HkQk−1 = Vk+1QkH

+k−1 = V +

k H+k−1,

which is an Arnoldi factorization of order k − 1. Further

(A− µI)Vk = Vk+1(Hk − µI) = Vk+1QkRk = V +k Rk.

Since Rk is upper triangular, this shows that

(A− µI)v1 = γv+1 ,

which means that the columns of V +k−1 form an orthonormal basis of a new

Krylov subspace of order k−1 generated by (A−µI)v1. This approach can berepeated: if ψ(λ) = (λ−µ1) · · · (λ−µp) then applying the shifted QR steps withshifts µ1, µ2, . . . , µp yields an Arnoldi factorization AV ++

k−p = Vk−p+1H++k−p with

orthogonal matrix V ++k−p containing the orthogonal basis vectors of a Krylov

subspace of order k − p generated by ψ(A)v1. Observe that the new Arnoldifactorization can be formed without additional matrix vector multiplications(by A) or inner products. The number of vector updates can be limited byforming the (k× (k− p)) orthogonal transformation matrix first, before trans-forming Vk into V ++

k−p.In [94] it is then suggested to apply the above sketched procedure p times

to a (k + p)-dimensional basis, using different unwanted Ritz values of Hk

as shifts, thereby reducing it to a k-dimensional basis and filtering out the punwanted Ritz values. The procedure is used iteratively through a repeatedexpansion and reduction of the subspace until convergence.

Numerical experiments in [59] show that this method is effective. The papercompares state-of-the-art software based on Arnoldi and “subspace iterations”methods, see, e.g., [97, 8, 33], which are generalizations of the power methodand often suitable for computing dominant eigenvalues.

Page 31: Diederik Fokkema - Thesis

Subspace methods for eigenproblems 17

Another method for the standard eigenproblem is the method of Lanc-zos [56]. The method reduces the matrix A to a tridiagonal matrix Tk similarto the bi-Lanczos method for linear problems. Consequently, it shares the samekind of problems, but there is more. For one thing, there exists no efficientand reliable algorithm for computing eigenvalues of large unsymmetric tridiag-onal matrices, in contrast to the symmetric case. This restricts the size of thesubspaces. Also problematic is the appearance of so-called ghost eigenvaluesduring the computations. This undesirable phenomenon is caused by the lossof bi-orthogonality among the subspaces, which goes hand in hand with theconvergence of Ritz values, when three-term recursions are used.

In [25, 23] it is tried to overcome this problem by heuristics to identify theghost eigenvalues. The idea is that components of the starting vector play anessential role in the computation of desired eigenvalue approximations. It issuggested to compare Ritz values of the tridiagonal (k × k)-matrix Tk withRitz values of its lower (k−1)× (k−1) part. The latter matrix can be seen asthe projection of A onto the subspace from which the starting vector has beenremoved. Since information is missing in this projection, the ghost eigenvaluescan now be identified: they appear as Ritz values of both matrices.In [7] a different approach is followed. There, selective reorthogonalization ofthe subspaces is used to avoid the ghost eigenvalues [27]. The methods arequite useful if one wants to compute large (exterior) parts of the spectrum.

Just as for the Arnoldi and subspace iteration methods, there exist general-izations of Lanczos type methods for the generalized eigenproblem. However,they need the inversion of a matrix too, which may make them expensive forlarge problems.

For more details, we refer to the cited papers and the classical referencesfor eigenvalue problems [109, 71]. More recent books that discuss some ofstate-of-the-art algorithms are, e.g., [80, 20].

A very recent method for solving eigenproblems is the Jacobi-Davidsonmethod presented in [90]. The proposed method no longer uses a Krylov sub-space. Instead, a subspace is generated by considering an optimal correctionequation. The method works as follows.

Suppose we have an orthogonal subspace Vk and a Ritz pair (θ, s), withresidual

r = As− θs.

A correction for s is computed by solving

(I − ss∗)(A− θI)(I − ss∗)∆s = −r,

for ∆s ⊥ s. This equation is motivated by the fact that, if θ is replaced bythe exact eigenvalue λ, then s + ∆s is the corresponding eigenvector. This

Page 32: Diederik Fokkema - Thesis

18 Introduction

correction is used for expansion of the subspace and the procedure is repeateduntil convergence.

Solving exactly this correction equation yields asymptotically quadraticalconvergence for unsymmetric problems and cubical convergence for symmetricmatrices. In practice however, it may be more efficient, to solve it approxi-mately by, for example, an iterative method.

Extensions to the generalized eigenproblem and to higher order polynomialeigenproblems have been suggested in [84].

In Chapter 6 we extend the Jacobi-Davidson approach both for the standardeigenproblem as well as for the generalized eigenproblem with a restart strategyto make it more suitable for the computation of several eigenvalues. Theextension is based on the reduction of the subspace to a partial Schur form.

The abstract of Chapter 6 is given below.

Chapter 6

Jacobi-Davidson style QR and QZ algorithms for the partialreduction of matrix pencils

Abstract. The Jacobi-Davidson subspace subspace iteration method offerspossibilities for solving a variety of eigenproblems. In practice one has to ap-ply restarts because of memory limitations, in order to restrict computationaloverhead, and also if one wants to compute several eigenvalues. In general,restarting has negative effects on the convergence of subspace methods. Wewill show how effective restarts can be incorporated in the Jacobi-Davidsonsubspace methods, very similar to the implicit restart procedure for the Arnoldiprocess. We will present two algorithms, JDQR for the standard eigenproblem,and JDQZ for the generalized eigenproblem, that are based on the iterativeconstruction of the (generalized) partial Schur form with the Jacobi-Davidsonsubspace approach. The algorithms are suitable for the efficient computationof several (even multiple) eigenvalues, and the corresponding eigenvectors, neara user-specified target value in the complex plane.

Published as: D. R. Fokkema, G. L. G. Sleijpen, and H. A. Van der Vorst, Jacobi-Davidson style QR and QZ algorithms for the partial reduction of matrix pencils, Preprint941, Department of Mathematics, Utrecht University, Utrecht, The Netherlands, 1996. Toappear in SIAM J. Sci. Comput..

Page 33: Diederik Fokkema - Thesis

Chapter 1

NESTED KRYLOV METHODS AND PRESERVING THEORTHOGONALITY

DIEDERIK R. FOKKEMA

Abstract. Recently the GMRESR [105] inner-outer iteration scheme for the solution oflinear systems of equations has been proposed by Van der Vorst and Vuik. Similar methodshave been proposed by Axelsson and Vassilevski [5], and Saad (FGMRES) [81]. The outeriteration is GCR, which minimizes the residual over a given subspace. The inner iterationis GMRES, which at each step computes an expansion for the subspace by approximatelysolving a correction equation. However, the optimality of the approximation over the outersubspace is ignored in the inner iteration. This leads to suboptimal corrections to thesolution in the outer iteration, as parts of the outer subspace may reenter in the inneriteration process. Therefore we propose to preserve the orthogonality relations of GCR alsoin the inner iteration. This gives optimal corrections, however, it involves working with asingular, nonsymmetric operator. We will discuss some important properties and we willshow by experiments, that in terms of matrix vector products this modification (almost)always leads to better convergence. However, because we do more orthogonalizations, itdoes not always give an improved performance in CPU-time. Furthermore, we will discussan efficient implementation as well as truncation possibilities of the outer GCR process. Ofcourse, we can also use other iteration schemes than GMRES as the inner method. Methodswith short recurrences like Bi-CGSTAB seem especially interesting. The experimental resultsindicate that, especially for such methods, it is advantageous to preserve the orthogonalityin the inner iteration.

Key words. Nonsymmetric linear systems, Iterative solvers, Krylov subspace, GMRES,GMRESR, Bi-CGSTAB, Truncation

AMS subject classifications. 65F10

1.1. Introduction. For the solution of systems of linear equations theso-called Krylov subspace methods are very popular. However, for generalmatrices no Krylov method can satisfy a global optimality requirement andhave short recurrences [35]. Therefore, either restarted or truncated versionsof optimal methods, such as GMRES(m) [82], may be used. Alternatively, onemay use methods with short recurrences, which do not satisfy a global opti-mality requirement, such as Bi-CG [36], Bi-CGSTAB [102], BiCGstab(`) [85],

This work was supported in part by a NCF/Cray Research University Grant CRG 92.03

Page 34: Diederik Fokkema - Thesis

20 Chapter 1. Nested Krylov methods and preserving the orthogonality

Choose x0 and tolr0 = b−Ax0

k = 0while ‖rk‖2 > tol do

k = k + 1uk = rk−1

ck = Auk

for i = 1, . . . , k − 1doαi,k = cTi ckck = ck − αi,kciuk = uk − αi,kui

enddoαk,k = ‖ck‖2uk = uk/αk,k

ck = ck/αk,k

γk = cTk rk−1

xk = xk−1 + γkuk

rk = rk−1 − γkckendwhile

Alg. 1.1. GCR

Choose x0, m, and tolr0 = b−Ax0

k = 0while ‖rk‖2 > tol do

k = k + 1uk = Pm,k(A)rk−1

ck = Auk

for i = 1, . . . , k − 1 doαi,k = cTi ckck = ck − αi,kciuk = uk − αi,kui

enddoαk,k = ‖ck‖2uk = uk/αk,k

ck = ck/αk,k

γk = cTk rk−1

xk = xk−1 + γkuk

rk = rk−1 − γkckendwhile

Pm,k(A) indicates the GMRESpolynomial, that is implicitly con-structed in m steps of GMRES,when solving the correction equa-tion Aek−1 = rk−1.

Alg. 1.2. GMRESR(m)

CGS [93] or QMR [41]. Recently Van der Vorst and Vuik introduced a newtype of method, GMRESR [105], see Alg. 1.2, which is a nested GMRESmethod.

The GMRESR algorithm is based upon GCR [34], see Alg. 1.1. For a giveninitial guess x0, both GCR and GMRESR compute approximate solutions xk,such that xk − x0 ∈ spanu1, u2, . . . , uk and ‖rk‖2 = ‖b−Axk‖2 is minimal.The difference lies in the choice of the direction vectors uk. GCR sets uk simplyto the residual rk−1, while GMRESR sets uk to the approximate solutionas produced by m steps of GMRES, when solving the correction equationAek−1 = rk−1 (represented by Pm,k(A)rk−1 in Alg. 1.2). For efficiency andstability reasons, the basis Uk = [u1, u2, . . . , uk] for the direction vectors isused, and constructed such that Ck = [Au1, Au2, . . . , Auk] is orthogonal. Inmore detail, the algorithms can be explained as follows.

Page 35: Diederik Fokkema - Thesis

Section 1.1. Introduction 21

Assume we are given the system of equations Ax = b, where A is a real,nonsingular, linear (n× n)-matrix and b is a n-vector. Let Uk and Ck be two(n× k)-matrices for which

(1.1) Ck = AUk, CTk Ck = Ik,

and let x0 be an initial guess. For xk − x0 ∈ spanUk the minimizationproblem

(1.2) ‖b−Axk‖2 = minx∈spanUk

‖r0 −Ax‖2.

is solved byxk = x0 + UkC

Tk r0

and rk = b−Axk satisfies

(1.3) rk = r0 − CkCTk r0, rk ⊥ spanCk.

In fact we have constructed the inverse of the restriction of A to spanUkonto spanCk. This inverse is given by

A−1CkCTk = UkC

Tk .

This principle underlies the GCR method. In GCR the matrices Uk and Ck areconstructed such that spanUk is equal to the Krylov subspace Kk(A; r0) =spanr0, Ar0, . . . , Ak−1r0. Provided GCR does not break down, i.e., if ck 6⊥rk−1, it is a finite method and at step k it solves the minimization prob-lem (1.2).

But obviously, we may construct other matrices Uk and Ck: replacing rk−1

in the step uk = rk−1 (in GCR) by any other vector, results in an algorithmthat still solves (1.2). The spanUk will be different from Kk(A; r0), of course.The optimal, but infeasible, choice would be uk = ek−1, where ek−1 is theerror x−xk−1. Fortunately, we can find approximations to ek−1, by using therelation

(1.4) Aek−1 = rk−1.

Any method which gives an approximate solution to this correction equationcan be used to find acceptable choices for uk. In the GMRESR algorithm msteps of GMRES are chosen to find such an approximation.

However, since we already have an optimal xk−1, such that rk−1 is orthogo-nal to spanCk−1, we need also an approximation uk (to ek−1), such that Auk

is orthogonal to spanCk−1. Such an approximation is computed explicitly bythe orthogonalization loop in the outer GCR iteration. Because in GMRESR

Page 36: Diederik Fokkema - Thesis

22 Chapter 1. Nested Krylov methods and preserving the orthogonality

this is not taken into account in the inner GMRES iteration, a less than opti-mal minimization problem is solved, leading to suboptimal corrections to theresidual.

Another disadvantage of GMRESR is that the inner iteration is essentially arestarted GMRES. It therefore also displays some of the problems of restartedGMRES. Most notably it can have the tendency to stagnate (see also ournumerical experiments in Section 1.5).

From this we infer, that it might be more favorable to preserve the orthog-onality of the correction to the residual also in the inner GMRES iteration.

Combining (1.3) and (1.4) leads to the following observation

Aek−1 = (I − Ck−1CTk−1)Aek−1

= A(I − Uk−1CTk−1A)ek−1

= (I − Ck−1CTk−1)A(I − Uk−1C

Tk−1A)ek−1

= rk−1.

Denoting Pk = CkCTk and Qk = UkC

Tk A, we can formulate the projected

correction equation: solve ek−1 ⊥ ATCk−1 such that

(1.5)

ek−1 = (I −Qk−1)ek−1, and(I − Pk−1)A(I −Qk−1)ek−1 = rk−1.

If uk is an approximate solution orthogonal to ATCk−1 then (I−Qk−1)uk = uk

and Auk is a proper correction to the residual.The resulting variant GCRO of the GMRESR iteration scheme, which has

an improved performance for many problems (see also our numerical experi-ments in Section 1.5), is given in Alg. 1.3. Note that the outer orthogonal-izations are not necessary anymore.

In the next section we will discuss the implications of the projections, whenusing GMRES as the inner method. We will see that this leads to an optimalapproximation over the space spanned by both the outer and the inner iterationvectors. It also introduces a potential problem: the possibility of breakdownin the generation of the Krylov space in the inner iteration, since we iteratewith a singular operator. It will turn out, however, that such a breakdown notonly can never happen before a specific (generally large) number of iterations,but is also easily repaired.

In Section 1.3 we will present an efficient implementation of GCRO withGMRES as an inner method. In Section 1.4 we will propose a truncation strat-egy for the outer GCR iteration and discuss its implementation. In Section 1.5we will discuss results of some numerical experiments. Some concluding re-marks are in Section 1.6.

Page 37: Diederik Fokkema - Thesis

Section 1.2. Consequences of inner orthogonalization 23

Choose x0 and tolr0 = b−Ax0

U0 = [ ]; C0 = [ ];k = 0while ‖rk‖2 > tol do

k = k + 1Solve uk (approximately) from:

uk = (I − Uk−1CTk−1A)uk and

(I − Ck−1CTk−1)A(I − Uk−1C

Tk−1A)uk = rk−1

ck = Auk

αk,k = ‖ck‖2uk = uk/αk,k, Uk = [Uk−1, uk];ck = ck/αk,k, Ck = [Ck−1, ck];γk = cTk rk−1

xk = xk−1 + γkuk

rk = rk−1 − γkckendwhile

Alg. 1.3. Generic GCRO

1.2. Consequences of inner orthogonalization. This section involvesa theoretical discussion of optimality, the possibility of breakdown, and thecontinuation after breakdown. For the theorems, we will only give a shortindication of the proofs or omit them completely. The proofs can be foundin [28]. Throughout the rest of this article we will use the following notations:

• By Ak we denote the operator defined as Ak ≡ (I − Pk)A(I −Qk)• By Vm = [v1, . . . , vm] we denote the orthonormal matrix generated bym steps of Arnoldi with Ak and such that v1 = rk/‖rk‖2.

Observe that, since AQk = PkA, the following relations hold

Ak = (I − Pk)A(I −Qk) = (I − Pk)A = A(I −Qk).

By construction, the inner GMRES process delivers the optimal correction tothe approximate solution xk+1 over the “global” space spanUk+1, Vm). Thisis formulated in the next theorem.

Theorem 1.1 The Arnoldi process in the inner GMRES iteration defines therelation AkVm = Vm+1Hm, with Hm an ((m+1)×m)-Hessenberg matrix. Lety be defined by

(1.6) y : miny∈Rm

‖rk −AkVmy‖2 = miny∈Rm

‖rk − Vm+1Hmy‖2.

Page 38: Diederik Fokkema - Thesis

24 Chapter 1. Nested Krylov methods and preserving the orthogonality

Then the minimal residual solution of the inner GMRES iteration, ((I −Qk)Vmy), gives the outer approximation

(1.7) xk+1 = xk + (I −Qk)Vmy,

which is also the solution to the “global” minimization problem

(1.8) xk+1 : minx∈spanUk,Vm

‖b−Ax‖2.

Remark 1.1 From this theorem it follows, that the residual computed in theinner GMRES iteration equals the residual of the outer GCR iteration: rk+1 =rk − AkVmy. Apparently, uk+1 = ((I − Qk)Vmy) and ck+1 = AkVmy. Ob-serve, that AkVmy is easily computed from the relation AkVmy = Vm+1Hmy.Additionally, as a result of using GMRES in the inner iteration, the norm ofthe residual rk+1 as well as the norm of ck (αk,k) are already known at noextra computational costs (cf. [82]). It even follows that γk = cTk rk = αk,k.Consequently, the outer GCR iteration becomes very simple.

We will now consider the possibility of breakdown, when generating aKrylov space with a singular, nonsymmetric operator. Although GMRES isstill optimal in the sense that at each iteration it delivers the minimum resid-ual solution over the generated Krylov subspace, the generation of the Krylovsubspace itself, from a singular operator, may terminate too early. The follow-ing simple example shows, that this may happen before the solution is found,even when the solution and the right hand side are both in the range of thegiven (singular) operator and in the orthogonal complement of its null-space.

Define the matrix A = (e2 e3 e4 0), where ei denotes the i-th Cartesianbasis vector. Note that A = (I − e1eT

1 )(e2 e3 e4 e1), which is the same type ofoperator as Ak, an orthogonal projection times a nonsingular operator. Nowconsider the system of equations Ax = e3. Then GMRES (or any other Krylovmethod) will search for a solution in the space

spane3, Ae3, A2e3, . . . = spane3, e4, 0, 0, . . . .

So we have a breakdown of the Krylov space and the solution is not containedin it.

In the remainder of this section we will show that a breakdown in the innerGMRES method cannot occur, before the total number of iterations exceedsthe dimension of the Krylov space K(A; r0). This means that, in practice, abreakdown will be rare. Furthermore, we will show how such a breakdown canbe overcome.

We will now define breakdown of the Krylov space for the inner GMRESiteration more formally.

Page 39: Diederik Fokkema - Thesis

Section 1.2. Consequences of inner orthogonalization 25

Definition 1.1 We say to have a breakdown of the Krylov subspace in the in-ner GMRES iteration if Akvm ∈ spanVm, since this implies we can no longerexpand the Krylov subspace. We call it a lucky breakdown if v1 ∈ spanAkVm,because we then have found the solution (the inverse of A is known over thespace spanAkVm). We call it a true breakdown if v1 6∈ spanAkVm, becausethen the solution is not contained in the Krylov subspace.

The following theorem relates true breakdown to the invariance of the sequenceof subspaces in the inner method for the operator Ak. Part four indicates, thatit is always known, whether a breakdown is true or lucky.

Theorem 1.2 The following statements are equivalent:1. A true breakdown occurs in the inner GMRES iteration at step m2. spanAkVm−1 is an invariant subspace of Ak

3. Akvm ∈ spanAkVm−14. AkVm = VmHm, and Hm is a singular (m×m)matrix.

From Theorem 1.1, one can already conclude that a true breakdown occursif and only if Ak is singular over Km(Ak; rk). From the definition of Ak weknow nullAk = spanUk. We will make this more explicit in the followingtheorem, which relates true breakdown to the intersection of the inner searchspace and the outer search space.

Theorem 1.3 A true breakdown occurs if and only if

spanVm ∩ spanUk 6= 0.

The following theorem indicates, that no true breakdown in the inner GMRESiteration can occur, before the total number of iterations exceeds the dimensionof the Krylov space K(A; r0).

Theorem 1.4 Let m = dim(K(A; r0)) and let l be such that rk = Pl(A)r0 forsome polynomial Pl of degree l. Then

dim(Kj+1(Ak; r0)) = j + 1 for j + l < m

and therefore no true breakdown occurs in the first j steps of the inner GMRESiteration.

We will now show how a true breakdown can be overcome. There are basicallytwo ways to continue:

• In the inner iteration: by finding a suitable vector to expand theKrylov space

Page 40: Diederik Fokkema - Thesis

26 Chapter 1. Nested Krylov methods and preserving the orthogonality

• In the outer iteration: by computing the solution of the inner iterationjust before the true breakdown and then by making one LSQR-step(see below) in the outer iteration.

We will consider the continuation in the inner GMRES iteration first. Thefollowing theorem indicates how one can continue the generation of the Krylovspace K(A; rk) if in the inner GMRES iteration a true breakdown occurs.

Theorem 1.5 If a true breakdown occurs in the inner GMRES iteration then

∃c ∈ spanCk : Akc 6∈ spanAkVm−1.

This implies that one can try the vectors ci until one of them works. How-ever, one should realize that the minimization problem (1.6) is slightly morecomplicated.

Another way to continue after a true breakdown in the inner GMRESiteration is to compute the inner iteration solution just before the breakdownand then apply a LSQR-switch (see below) in the outer GCR iteration. Thefollowing theorem states the reason why one has to apply a LSQR-switch.

Theorem 1.6 Suppose one computes the solution of the inner GMRES itera-tion just before a true breakdown. Then stagnation will occur in the next inneriteration, that is rk+1 ⊥ K(Ak+1; rk+1). This will lead to a breakdown of theouter GCR iteration.

The reason for this stagnation in the inner GMRES iteration is that the newresidual rk+1 remains in the same Krylov space K(Ak; rk), which contains au ∈ spanUk. So we have to “leave” this Krylov space. We can do thisusing the so-called LSQR-switch, which was introduced in [105], to remedystagnation in the inner GMRES iteration. Just as in the GMRESR method,stagnation in the inner GMRES iteration will result in a breakdown in theouter GCR iteration, because the residual cannot be updated. The followingtheorem states that this LSQR-switch actually works.

Theorem 1.7 If stagnation occurs in the inner GMRES iteration, that is if

miny∈Rm

‖rk+1 −AkVmy‖2,= ‖rk+1‖2,

then one can continue by setting (LSQR-switch)

uk+2 = γ(I −Qk+1)AT rk+1, and

ck+2 = γAk+1AT rk+1,

Page 41: Diederik Fokkema - Thesis

Section 1.3. Implementation 27

where γ is a normalization constant. This leads to

xk+2 = xk+1 − (rTk+1ck+2)uk+2, and

rk+2 = rk+1 − (rTk+1ck+2)ck+2,

which always gives an improved approximation. Therefore, these vectors canbe used as the start vectors for a new inner GMRES iteration.

1.3. Implementation. In this section we will describe how to implementGCRO with GMRES as the inner method efficiently. We begin by showingthat GCR and GMRESR can be implemented more efficiently by incorporatingan implicit representation of Uk. We then show how to incorporate a similarrepresentation of Uk in GCRO in combination with GMRES. The implemen-tation of GCRO with a method like Bi-CGSTAB in the inner iteration willthen be obvious (see also [28]).

1.3.1. GCR and GMRESR. GCR and GMRESR can be implementedmore efficiently as follows. Observe that with (cf. Alg. 1.1 and Alg. 1.2)

Uk = [u1, u2, . . . , uk], Zk =

α1,1 α1,2 · · · α1,k

0 α2,2 α2,k

.... . .

...0 · · · 0 αk,k

, and dk =

γ1

γ2

...γk

,it follows that

(1.9) AUk = CkZk,

and that the approximate solution xk, corresponding to rk, can be writtenimplicitly as

(1.10) xk = x0 + UkZ−1k dk.

Using this relation, xk can be computed at the end of the complete iteration.The implicit representation of Uk = UZ−1

k saves all the intermediate updatesof previous ui to a new uk+1, which is approximately 30% of the computationalcosts in the outer iteration of both GCR and GMRESR.

1.3.2. GCRO with GMRES as inner iteration. We can save com-putational work in GCRO with GMRES as inner iteration in a similar way. Inthe inner GMRES iteration we construct the orthogonal matrix Vm such that

(1.11) AVm = CkBm + Vm+1Hm, for Bm ≡ CTk AVm.

This can be done with the usual GMRES algorithm [82], in which the vectorsAvi are first orthogonalized on Ck. From (1.11) it is obvious that AVm −

Page 42: Diederik Fokkema - Thesis

28 Chapter 1. Nested Krylov methods and preserving the orthogonality

CkBm = AkVm = Vm+1Hm (cf. Theorem 1.1). Now observe that (cf.Alg. 1.3), with y according to (1.6),

αk,kuk = (I −Qk)Vmy = Vmy − UkBmy.

Setting

uk = Vmy and Z1...k,k =[Bmyαk,k

]again leads to a relation of the form Uk = UkZ

−1k . An implementation based

on this relation is given in Alg. 1.4. It also incorporates the observationsmade in Remark 1.1.

1.4. Truncation. In practice, since memory space may be limited andsince the method becomes increasingly expensive for large k (the number ofouter search vectors), we want to truncate the set of outer iteration vectors(ui) and (ci) at k = kmax, where kmax is some positive integer. Basically,there are two ways to do this: one can discard one or more iteration vector(s)(dropping) or one can assemble two or more iteration vectors into one singleiteration vector (assembly). We will first discuss the strategy for truncationand then its implementation.

1.4.1. A strategy for truncation. In each outer iteration step the ma-trices Uk and Ck are augmented with one extra column. To keep the mem-ory requirement constant, at step k = kmax, it is therefore sufficient to di-minish the matrices Ukmax and Ckmax by one column. From (1.10) we havexk = x0 + UkZ

−1k dk. Denote ξk = Z−1

k dk. Consider the sequence of vectors(ξk). The components ξk(i) of these vectors ξk are the coefficients for the up-dates ui of the approximate solution xk. These coefficients ξk(i) converge tothe limits ξ(i) as k increases. Moreover, (ξk(1)) converges faster than (ξk(2)),and (ξk(2)) converges faster than (ξk(3)) etc.. Suppose that the sequence (ξk(1))has converged to ξ(1) within machine precision. From then on it makes no dif-ference for the computation of xk when we perform the update x0 + ξ(1)u1. Interms of direction vectors this means that the outer direction vector u1 willnot reenter as component in the inner iteration process. Therefore one mighthope that discarding the vector c1 will not spoil the convergence. This leadsto the idea of dropping the vector c1(= Au1) or of assembling c1 with c2 intoc (say) when

(1.12) δ (k) =

∣∣∣∣∣ξ(1)k − ξ(1)k−1

ξ(1)k

∣∣∣∣∣ < ε,

where ε > 0 is a small constant. The optimal ε, which may depend on k,can be determined from experiments. When δ (k) > ε we drop ckmax−1 or we

Page 43: Diederik Fokkema - Thesis

Section 1.4. Truncation 29

Choose x0, m, and tolr0 = b−Ax0

β = ‖r0‖2l = 0while β > tol do

l = l + 1v1 = rl−1/βt = βe1k = 0while β > tol and k < m do

k = k + 1v = Avk

for j = 1, 2, . . . , l − 1 doBj,k = (cj , v), v = v −Bj,kcj

enddofor j = 1, 2, . . . , k do

Hj,k = (vj , v), v = v − Hj,kvj

enddoHk+1,k = ‖v‖2, vk+1 = v/Hk+1,k

S1...k+1,k = Gk−1 · · ·G1H1...k+1,k

Construct and apply the Givens rotationGk to S1...k+1,k such that its last element be-comes zero.t = Gktβ = |tk+1|

endwhilet = (t1 . . . tk)T

y = S−1t(z1,l . . . zl−1,l)T = Byγl = αl,l = ‖t‖2dl = γl, zl,l = αl,l

ul = Vkycl = Vk+1Hyrl = rl−1 − clcl = c/γl

endwhile

x = x0 + UlZ−1dl

Alg. 1.4. Efficient GCRO(m) with GMRES as the inner iteration method.

Page 44: Diederik Fokkema - Thesis

30 Chapter 1. Nested Krylov methods and preserving the orthogonality

assemble ckmax−1 and ckmax (of course other choices are feasible as well, but wewill not consider them in this article). With this strategy we hope to avoidstagnation by keeping the most relevant part of the subspace spanCk in storeas a subspace of dimension k − 1. In the next subsections we describe how toimplement this strategy and its consequences for the matrices Ck and Uk.

1.4.2. Dropping a vector. Let 1 ≤ j ≤ k = kmax. Dropping the columncj is easy. We can discard it without consequences. So let C ′

k−1 be the matrixCk without the column cj . Dropping a column from Uk needs more work,since xk is computed as xk = x0 + UkZ

−1k dk. Moreover, in order to be able

to apply the same dropping strategy in the next outer iteration we have to beable to compute xk+1 in a similar way. For that purpose, assume that xk canbe computed as

(1.13) xk = x′k−1 = x′0 + U ′k−1(Z

′k−1)

−1d′k−1,

where U ′k−1 and Z ′

k−1 are matrices such that AU ′k−1 = C ′

k−1Z′k−1 (see (1.9)).

These matrices U ′k−1 and Z ′

k−1 are easily computed by using the j-th rowof (1.9) to eliminate the j-th column of Ck in (1.9). In order to determine x′0and d′k−1 we use that Uk = UkZ

−1k , which allows us to write

xk = (x0 + d(j)k uj) +

k∑i=1i 6=j

d(i)k ui and uj = (uj −

j−1∑i=1

zijui)/zjj .

Substituting the equation for uj into the equation for xk we can compute xk

from

xk = (x0 +d(j)k

zjjuj) +

j−1∑i=1

(d(i)k − d

(j)k

zij

zjj)ui +

k∑i=j+1

d(i)k ui.

Notice that this equation precisely defines x′0 and d′k−1:

x′0 = x0 + (d(j)k /zjj)uj ,

d(i)k−1

′ = d(i)k − d

(j)k (zij/zjj), for i = 1, . . . , j − 1 and

d(i)k−1

′ = d(i+1)k , for i = j, . . . , k − 1.

Now we have deallocated two vectors and we compute xk as in (1.13). We cancontinue the algorithm.

1.4.3. Assembly of two vectors. Let 1 ≤ j < l ≤ k = kmax. Againassembling cj and cl is easy. Let c = (d(j)

k cj+d(l)k cl) overwrite the l-th column of

Ck. Then, let C ′k−1 be this new matrix Ck without the j-th column. Analogous

Page 45: Diederik Fokkema - Thesis

Section 1.5. Numerical experiments 31

to the above, we wish to compute xk as (1.13). For the purpose of determiningthe matrices U ′

k−1 and Z ′k−1, let u = (d(j)

k uj + d(l)k ul) and compute t(m)

1 andt(m)2 such that

zjmuj + zlmul + t(m)1 uj = t

(m)2 u,

which gives t(m)1 = zlm(d(j)

k /d(l)k ) − zjm and t

(m)2 = zlm/d

(l)k . This enables us

to write

um =m∑

i=1

zimui, for m = 1, . . . , j − 1(1.14)

um =m∑

i=1i 6=j,l

zimui + t(m)2 u− t(m)

1 uj , for m = j, . . . , k.(1.15)

Substituting uj = (uj −∑j−1

i=1 zijui)/zjj , to eliminate uj from (1.15) we get

um =m∑

i=1

zimui, for m = 1, . . . , j − 1

um +t(m)1

zjjuj =

m∑i=1i 6=j,l

(zim + t(m)1

zij

zjj)ui + t

(m)2 u, for m = j + 1, . . . , k.

This equation determines the matrices U ′k−1 and Z ′

k−1. In order to determinex′0 and d′k−1, note that xk can be computed as

xk = x0 +k∑

i=1i 6=j,l

d(i)k ui + u.

Therefore x′0 is just x0 and d′k−1 equals the vector dk without the j-th elementand the l-th element overwritten by 1. Similarly as before, we have deallocatedtwo vectors from memory. The assembled vectors u and c overwrite ul and cl.The locations of uj and cj can therefore be used in the next step.

Finally, we remark that these computations can be done with rank oneupdates.

1.5. Numerical experiments. We will discuss the results of some nu-merical experiments, which concern the solution of two dimensional convectiondiffusion problems on regular grids, discretized using a finite volume technique,resulting in a pentadiagonal matrix. The system is preconditioned with ILUapplied to the scaled system, see [32, 62]. The first two problems are used toillustrate and compare the following solvers:

Page 46: Diederik Fokkema - Thesis

32 Chapter 1. Nested Krylov methods and preserving the orthogonality

• (full) GMRES• Bi-CGSTAB• GMRESR(m), where m indicates the number of inner GMRES itera-

tions between the outer iterations• GCRO(m), which is GCR with m adapted GMRES iterations as inner

method, using Ak (cf. Alg. 1.4)• GMRESRSTAB, which is GMRESR with Bi-CGSTAB as the inner

method• GCROSTAB, which is GCRO with the adapted Bi-CGSTAB algo-

rithm as inner method, using Ak.We will compare the convergence of these methods both with respect to thenumber of matrix vector products and with respect to CPU-time on one proces-sor of the Convex 3840. This means, e.g., that each step of Bi-CGSTAB (andvariants) is counted for two matrix vector products. We give both these con-vergence rates because the main trade off between (full) GMRES, the GCROvariants and the GMRESR variants is less iterations against more dot productsand vector updates per iteration. Any gain in CPU-time, then depends on therelative cost of the matrix vector multiplication and preconditioning versus theorthogonalization cost on the one hand and on the difference in iterations onthe other hand. We will use our third problem to show the effects of truncationand compare two strategies.

1.5.1. Problem 1. This problem comes from the discretization of

−(uxx + uyy) + bux + cuy = 0

on [0, 1]× [0, 4], where

b(x, y) =

100 for 0 ≤ y < 1 and 2 ≤ y < 3−100 for 1 ≤ y < 2 and 3 ≤ y ≤ 4

and c = 100. The boundary conditions are u = 1 on y = 0, u = 0 on y = 4,u′ = 0 on x = 0 and u′ = 0 on x = 1, where u′ denotes the (outward) normalderivative. The stepsize in x-direction is 1/100 and in y-direction is 1/50.

In this example we compare the performances of GMRES, GCRO(m) andGMRESR(m), for m = 5 and m = 10. The convergence history of problem 1is given in Fig. 1.1 and Fig. 1.2. Fig. 1.1 shows that GMRES convergesfastest (in matrix vector products), which is of course to be expected, followedby GCRO(5), GMRESR(5), GCRO(10) and GMRESR(10). From Fig. 1.1 wealso see that GCRO(m) converges smoother and faster than GMRESR(m).Note that GCRO(5) has practically the same convergence behavior as GMRES.The vertical “steps” of GMRESR(m) are caused by the optimization in theouter GCR iteration, which does not involve a matrix vector multiplication.

Page 47: Diederik Fokkema - Thesis

Section 1.5. Numerical experiments 33

(full)gmresgcro(m)

gmresr(m)

number of matrix vector products

log(||r||)

5 5 10

10

Fig. 1.1. Convergence history for problem 1.

We also observe that the GMRESR(m) variants tend to loose their super-linear convergence behavior, at least during certain stages of the convergencehistory. This seems to be caused by stagnation or slow convergence in theinner GMRES iteration, which (of course) essentially behaves like a restartedGMRES. For GCRO(m), however, we see a much smoother and faster con-vergence behavior and the superlinearity of (full) GMRES is preserved. Thisis explained by the “global” optimization over both the inner and the outersearch vectors (the latter form a sample of the entire, previously searchedKrylov subspace). So we may view this as a semi-full GMRES. Fig. 1.2 givesthe convergence with respect to CPU-time. In this example GCRO(5) is thefastest, which is not surprising in view of the fact, that it converges almost asfast as GMRES, but against much lower costs. Also, we see that GCRO(10),while slower than GMRESR(5) is still faster than GMRESR(10). In this casethe extra orthogonalization costs in GCRO are outweighed by the improvedconvergence behavior.

1.5.2. Problem 2. This problem is taken from [102]. The linear systemcomes from the discretization of

−(aux)x − (auy)y + bux = f

on the unit square, with b = 2 exp 2(x2 + y2). Along the boundaries we haveDirichlet conditions: u = 1 for y = 0, x = 0 and x = 1, and u = 0 for y = 1.

Page 48: Diederik Fokkema - Thesis

34 Chapter 1. Nested Krylov methods and preserving the orthogonality

(full)gmresgcro(m)

gmresr(m)

55 10 10

time (s)

log(||r||)

Fig. 1.2. Convergence in time for problem 1.

The functions a and f are defined as shown in Fig. 1.6; f = 0 everywhere,except for the small subsquare in the center where f = 100. The stepsize inx-direction and in y-direction is 1/128.

In Fig. 1.3 a convergence plot is given for (full) GMRES, GCRO(m) andGMRESR(m). We used m = 10 and m = 50 to illustrate the differencein convergence behavior in the inner GMRES iteration of GMRESR(m) andGCRO(m). GMRESR(50) stagnates in the inner GMRES iteration whereasGCRO(50) more or less displays the same convergence behavior as GCRO(10)and full GMRES. For the number of matrix vector products, it seems that forGMRESR(m) small m are the best choice.

In Fig. 1.4 a convergence plot is given for (full) GMRES, Bi-CGSTAB, andthe Bi-CGSTAB variants, GMRESRSTAB and GCROSTAB. To our experi-ence the following strategy gave the best results for the Bi-CGSTAB variants:

• For GMRESRSTAB we ended an inner iteration after either 20 stepsor a relative improvement of the residual of 0.01• For GCROSTAB we ended an inner iteration after either after 25 steps

or a relative improvement of the residual of 0.01.The convergence of GMRESRSTAB for this example is somewhat typicalfor GMRESRSTAB in general (albeit very bad in this case). This mightbe explained from the fact that the convergence of Bi-CGSTAB dependson a “shadow” Krylov subspace, which it implicitly generates. Now, if ifone restarts, then Bi-CGSTAB also starts to build a new, possibly different,

Page 49: Diederik Fokkema - Thesis

Section 1.5. Numerical experiments 35

log(||r||)

number of matrix vector products

5050 10

10gmresr(m)

gcro(m)

(full)gmres

Fig. 1.3. Convergence history for problem 2.

“shadow” Krylov subspace. This may lead to erratically convergence behaviorin the first few steps. Therefore, it may happen that, if in the inner itera-tion Bi-CGSTAB does not converge (to the relative precision), the “solution”of the inner iteration is not very good and therefore the outer iteration maynot give much improvement either. At the start the same more or less holdsfor GCROSTAB, however, after a few outer GCR iterations the “improved”operator (Ak) somehow yields a better convergence than Bi-CGSTAB by it-self. This was also observed for more tests, although it also may happen thatGCROSTAB converges worse than Bi-CGSTAB.

In Fig. 1.5 a convergence plot versus the CPU-time is given for GM-RESR(10), GCRO(10), Bi-CGSTAB, and GCROSTAB. The fastest conver-gence in CPU-time is achieved by GCROSTAB, which is ≈ 20% faster than Bi-CGSTAB notwithstanding the extra work in orthogonalizations. We also see,that although GCRO(10) takes less iterations than GMRESR(10), in CPU-time the latter is faster. So in this case the decrease in iterations does notoutweigh the extra work in orthogonalizations. For completeness we mentionthat GMRESRSTAB took almost 15 seconds to converge, whereas GMREStook almost 20 seconds.

1.5.3. Problem 3. The third problem is taken from [81]. The linearsystem stems from the discretization of the partial differential equation

−uxx − uyy + 1000(xux + yuy) + 10u = f

Page 50: Diederik Fokkema - Thesis

36 Chapter 1. Nested Krylov methods and preserving the orthogonality

(full)gmres

bicgstab

gcrostab

gmresrstab

number of matrix vector products

log(||r||)

Fig. 1.4. Convergence history for Bi-CGSTAB variants for problem 2.

gcro(10)gmresr(10)

bicgstab

gcrostab

time (s)

log(||r||)

Fig. 1.5. Convergence in time for problem 2.

a=100

a=1.E4a=1.E-5

f=100

u = 1

u = 1

u = 1

u = 0

0 10

1

Fig. 1.6. Coefficientsfor problem 2.

on the unit square with zero Dirichlet boundary conditions. The stepsize inboth x-direction and y-direction is 1/65. The right-hand side is selected oncethe matrix is constructed so that the solution is known to be x = (1, 1, . . . , 1)T .The zero vector was used as an initial guess.

In Fig. 1.7 we see a plot of the convergence history of full GMRES, GM-RESR(5), GCRO(5), and GCRO(10,5) for two different truncation strategies,where the first parameter gives the dimension of the outer search space and

Page 51: Diederik Fokkema - Thesis

Section 1.5. Numerical experiments 37

1.0e-06

1.0e-05

1.0e-04

1.0e-03

1.0e-02

1.0e-01

1.0e+00

1.0e+01

0 50 100 150 200 250

residual norm

number of matrix vector products

GMRESGMRESR(5)

GCRO(5)GCRO(10,5) daGCRO(10,5) tr

Fig. 1.7. Convergence history for problem 3.

the second the dimension of the inner search space. The number of vectors inthe outer GCR iteration is twice the dimension of the search space. For thetruncated version:

• “da” means that we took ε = 10−3 and dropped the vectors u1 andc1 when δ (k) < ε and assembled the vectors u9 and u10 as well as thevectors c9 and c10 when δ (k) > ε• “tr” means that we dropped the vectors u9 and c9 each step (ε = 0,

see also [108]).Notice that GCRO(5) displays almost the same convergence behavior as fullGMRES. GMRESR(5) converges eventually, but only after a long period ofstagnation. The truncated versions of GCRO(5) also display stagnation, butfor a much shorter period. After that the “da” version seems to convergesuperlinear, whereas the “tr” version still displays periods of stagnation, mostnotably at the end. This indicates that the “da” version is more capable ofkeeping most of the “convergence history” than the “tr” version. This kindof behavior was seen in more tests: “assembled” truncation strategies seem towork better than just discarding one or more iteration vectors.

In Tab. 1.1 we give the number of matrix vector products, the number ofmemory vectors and the CPU-time on a Sun Workstation. From this table wesee that GCRO(5) is by far the fastest method and uses about half the amount

Page 52: Diederik Fokkema - Thesis

38 Chapter 1. Nested Krylov methods and preserving the orthogonality

of memory vectors full GMRES and GMRESR(5) use. More interesting is thatGCRO(10,5) “da” converges in the same time as GMRESR(5), but uses onlyone third of the memory space.

Method MVs Memory Vectors CPU-time

GMRES 77 77 21.3GMRESR(5) 188 81 18.5GCRO(5) 83 39 9.4GCRO(10,5) “da” 150 25 18.3GCRO(10,5) “tr” 244 25 30.3

Table 1.1. Number of matrix vector products, number of memory vec-tors and CPU-time in seconds for problem 3.

1.6. Conclusions. We have derived from the GMRESR inner-outer it-eration schemes a modified set of schemes, which preserve the optimality ofthe outer iteration. This optimality is lost in GMRESR since it essentiallyuses “restarted” inner GMRES iterations, which do not take advantage of theouter “convergence history”. Therefore, GMRESR may loose superlinear con-vergence behavior, due to stagnation or slow convergence of the inner GMRESiterations.

In contrast, the GCRO variants exploit the “convergence history” to gen-erate a search space, that has no components in any of the outer directionsin which we have already minimized the error. For GCRO(m) this means weminimize the error over both the inner search space and a sample of the entirepreviously searched Krylov subspace (the outer search space), resulting in asemi-full GMRES. This probably leads to the smooth convergence (much likeGMRES) and the absence of stagnation, which may occur in the inner GM-RES iteration of GMRESR. Apparently the small subset of Krylov subspacevectors, that is kept, approximates the entire Krylov subspace that is gener-ated, sufficiently well. For both GMRESR(m) and GCRO(m) it seems that asmall number of inner iterations works well.

We may also say, that the GCRO variants construct a new (improved)operator (of decreasing rank) after each outer GCR iteration. Although thereis the possibility of breakdown in the inner method for GCRO, this seems tooccur rarely as is indicated by Theorem 1.4 (it has never happened in any ofour experiments).

With respect to performance of the discussed methods we have seen thatGCRO(m) (almost) always converges in less iterations than GMRESR(m).Because GCRO(m) is in average more expensive per iteration, this does not

Page 53: Diederik Fokkema - Thesis

Section 1.6. Conclusions 39

always lead to faster convergence in CPU-time. This depends on the rela-tive costs of the matrix vector product and preconditioner with respect to thecost of the orthogonalizations and the reduction in iterations for GCRO(m)relative to GMRESR(m). Our experiments, with a cheap matrix vector prod-uct and preconditioner (in terms of teh number of floating point operations),show that already in this case the GCRO variants are very competitive withother solvers. However, especially when the matrix vector product and pre-conditioner are expensive or when not enough memory is available for (full)GMRES, GCRO(m) is very attractive. GCRO with Bi-CGSTAB also seemsto be a useful method especially when a large number of iterations is neces-sary or when the available memory space is small relative to the problem size.GMRESR with Bi-CGSTAB does not seem to work so well, probably because,to our observation, restarting Bi-CGSTAB does not work so well.

We have derived sophisticated truncation strategies and shown by numer-ical example that superlinear convergence behavior can be maintained. Fromour experience, the “assembled” version seems to have most promises.

Acknowledgements. The author wishes to thank Eric De Sturler forthe colloboration on the subject of this chapter. The author is also grateful toGerard Sleijpen and Henk Van der Vorst for encouragement, helpful comments,and inspiring discussions.

Page 54: Diederik Fokkema - Thesis

40 Chapter 1. Nested Krylov methods and preserving the orthogonality

Page 55: Diederik Fokkema - Thesis

Chapter 2

BICGSTAB(`) FOR LINEAR EQUATIONS INVOLVINGUNSYMMETRIC MATRICES WITH COMPLEX SPECTRUM

GERARD L. G. SLEIJPEN AND DIEDERIK R. FOKKEMA

Abstract. For the solution of classes of linear systems of equations arising from realisticproblems, the Bi-CGSTAB algorithm [102] is attractive. Unfortunately, for some relevantproblems, where, for instance, Bi-CG performs well, the convergence of Bi-CGSTAB stag-nates. This was observed specifically in the case of discretized advection dominated PDE’s.The stagnation is due to the fact that for this type of equations the matrix has almost pureimaginary eigenvalues. With his BiCGStab2 algorithm Gutknecht [49] attempted to avoidthis stagnation. Here, we generalize the Bi-CGSTAB algorithm further, and overcome someshortcomings of BiCGStab2. The new algorithm combines GMRES(`) and Bi-CG.

Key words. Nonsymmetric linear systems, Iterative solvers, Krylov subspace, Bi-Conjugate gradients, CGS, Bi-CGSTAB, GMRES

AMS subject classifications. 65F10

2.1. Introduction. The bi-conjugate gradient method (Bi-CG) [36, 57]solves iteratively equations

(2.1) Ax = b

in which A is some given non-singular unsymmetric n× n matrix and b somegiven n-vector. Typically n is large and A is sparse. We will assume A and b tobe real, but our methods are easily generalized to the complex case. In each it-eration step, the approximation xk is corrected by some search correction thatdepends on the true residual rk (rk = b − Axk) and some “shadow residual”rk. The residuals rk are “forced to converge” by making rk orthogonal to theshadow residuals rj for j < k. Any iteration step requires a multiplication byA to produce the next true residual and a multiplication by AT (the real trans-pose of A) to produce the next shadow residual. This strategy involves shortrecursions and hence an iteration step is cheap with respect to the computa-tional cost (except for the matrix multiplications) and memory requirement.

This work was supported in part by a NCF/Cray Research University Grant CRG 92.03

Page 56: Diederik Fokkema - Thesis

42 Chapter 2. BiCGstab(`) for linear equations

In addition to the mvs (i.e., matrix-vector multiplications), a few dots (innerproducts) and axpys (vector updates) are required, and apart from the xk,four other vectors have to be stored.

Bi-CG seems like an ideal algorithm but in practice it has a few disadvan-tages:

(i) The transpose (either complex or real) of A is often not (easy) avail-able.

(ii) Although the computational cost is low in terms of axpys and dots,each step requires two matrix multiplications, which is double the cost of CG.

(iii) Bi-CG may suffer from breakdown. This can be repaired by look-ahead strategies [10, 40]. We will not consider the breakdown situation forBi-CG in this paper.

(iv) Bi-CG often converges irregularly. In finite precision arithmetic, thisirregular behavior may slow down the speed of convergence.

In [93] Sonneveld observed that the computational effort to produce theshadow residuals could as well be used to obtain an additional reduction ofthe Bi-CG residuals rk. His CGS algorithm computes approximations xk witha residual of the form rk = qk(A)rk, where qk is some appropriate polynomialof degree k. The rk are computed explicitly, while the polynomials qk andthe Bi-CG residuals rk play only a theoretical role. One step of the CGSalgorithm requires two multiplications by A and no multiplication at all bythe transpose of A. The computational complexity and the amount of memoryis comparable to that of Bi-CG. In case qk(A) gives an additional reduction,CGS is an attractive method [93]. Unfortunately, in many situations, the CGSchoice for qk leads to amplifications of rk instead of reduction. This causesirregular convergence or even divergence and makes the method more sensitiveto evaluation errors [102, 101].

Van der Vorst [102] proposes to take for qk a product of appropriate 1-stepMR-polynomials (Minimal Residual polynomials), i.e., degree one polynomialsof the form 1− ωkt for some optimal ωk. To a large extend, this choice fulfillsthe promises: for many problems, his Bi-CGSTAB algorithm converges rathersmoothly and also often faster than Bi-CG and CGS. In such cases qk(A)reduces the residual significantly, while the Bi-CGSTAB iteration steps onlyslightly more expensive than the CGS steps.

However, ωk may be close to zero, and this may cause stagnation or evenbreakdown. As numerical experiments confirm, this is likely to happen if A isreal and has nonreal eigenvalues with an imaginary part that is large relative tothe real part. One may expect that second degree MR-polynomials can betterhandle this situation. In [49] Gutknecht introduces a BiCGStab2 algorithmthat employs such second degree polynomials. Although this algorithm iscertainly an improvement in many cases, it may still suffer from problems incases where Bi-CGSTAB stagnates or breaks down. At every second step,

Page 57: Diederik Fokkema - Thesis

Section 2.1. Introduction 43

Gutknecht corrects the first degree MR-polynomial from the previous step toa second degree MR-polynomial. However, in the odd steps, the problem ofa nearly degenerate MR-polynomial of degree one may already have occurred(this is comparable to the situation where GCR breaks down while GMRES(or Orthodir) proceeds nicely (cf. [82]). In BiCGStab2 (as well as in the othermethods CGS, Bi-CGSTAB and the more general method BiCGstab(`), to beintroduced below), the Bi-CG iteration coefficients play a crucial role in thecomputation. If, in an odd step, the MR polynomial almost degenerates, thenext second degree polynomial as well as the Bi-CG iteration coefficients maybe polluted by large errors and this may affect the process severely.

In this paper, we introduce the BiCGstab(`) algorithm. For ` = 1, thisalgorithm coincides with Bi-CGSTAB. In BiCGstab(`), the polynomial qk ischosen as the product of `-step MR-polynomials: for k = m`+ ` we take

(2.2)qk = qm`+` = pmpm−1 · · · p0, where the pi’s are of degree `,

pi(0) = 1, and pm minimizes ‖pm(A)qk−`(A)rk‖2.

We form an `-degree MR-polynomial pm after each `-th step. In the interme-diate steps k = m` + i, i = 1, 2, . . . , ` − 1, we employ simple factors ti andthe pm are reconstructed from these powers. In this way, we can avoid cer-tain near-breakdowns in these steps. Near-breakdown may still occur in ourapproach if the leading coefficient of pm is almost 0. However, second degreeor more general even degree polynomials seem to be well suited for complexeigenpairs and near-breakdown is hardly a problem in practice (although itmay occur if, for instance, A is a cyclic matrix: Aei = ei−1 for i = 2, 3, . . . ).On the other hand, BiCGstab(`) still incorporates the breakdown dangers ofBi-CG.

(i) In exact arithmetic, if BiCGStab2 does not break down, it producesthe same result as our BiCGstab(2). In actual computation the results canbe quite different. Our version proceeds nicely as should be expected fromBiCGstab(2) also in cases where BiCGStab2 stagnates due to the MR-choice inthe odd steps. In cases where Gutknecht version does well, our version seemsto converge slightly faster. In some cases in finite precision arithmetic, theapproximations xk and the residuals rk drift apart (i.e., b−Axk 6≈ rk), due toirregular convergence behavior of the underlying Bi-CG process. Gutknecht’salgorithm seems to be significantly more sensitive to this effect than ours.

(ii) In addition the steps of our version are cheaper with respect to bothcomputational cost as well as memory requirement: except for the numberof mvs, which is the same for both versions, our version is about 33% lessexpensive and it needs about 10% less memory space.

(iii) Gutknecht’s approach can also be used to construct a BiCGstab(`)version. However, if ` increases, the formulas and the resulting algorithm

Page 58: Diederik Fokkema - Thesis

44 Chapter 2. BiCGstab(`) for linear equations

choose x0 and some r0k = −1

r0 = b−Ax0

u−1 = u−1 = 0, ρ−1 = 1repeat until ‖rk+1‖ is small enough:

k = k + 1ρk = (rk, rk), βk = −ρk/ρk−1

uk = rk − βkuk−1, ck = Auk

uk = rk − βkuk−1

γk = (ck, rk), αk = ρk/γk

xk+1 = xk + αkuk

rk+1 = rk − αkckrk+1 = rk − αkA

T uk

Alg. 2.1. The Bi-CG algorithm

will become increasingly more complicated, while we have virtually the samealgorithm for every `. We can easily increase ` if stagnation threatens.

(iv) In some situations it may be profitable to take ` > 2. Although thesteps of BiCGstab(`) are more expensive for larger `, numerical experimentsindicate that, in certain situations, due to a faster convergence, for instance,BiCGstab(4) performs better than BiCGstab(2). Our BiCGstab(`) algorithmcombines the advantages of both Bi-CG and GMRES(`) and seems to convergefaster than any of those.

In the next section, we give theoretical details on the above observations.Section 2.3 contains a detailed description of the BiCGstab(`) algorithm andits derivation. In addition, it contains comments on the implementation, thecomputational costs and the memory requirement. We conclude Section 2.3with a number of possible variants for BiCGstab(`). In Section 2.4 we givesome remarks on preconditioning. In the last section, we present some numer-ical experiments.

2.2. Theoretical justification of BiCGstab(`). The Bi-CG algorithm[36, 57] in Alg. 2.1 solves iteratively the linear equation (2.1).

One has to select some initial approximation x0 for x and some “shadow”residual r0. Then the Bi-CG algorithm produces iteratively sequences of ap-proximations xk, residuals rk and search directions uk by

(2.3) uk = rk − βkuk−1, xk+1 = xk + αkuk, rk+1 = rk − αkAuk

(where u−1 = 0, and r0 is computed by r0 = b−Ax0). The scalars αk and βk

Page 59: Diederik Fokkema - Thesis

Section 2.2. Theoretical justification of BiCGstab(`) 45

are computed such that both Auk and rk are orthogonal to the Krylov subspaceKk(AT ; r0) of order k, spanned by the vectors r0, AT r0, . . . , (AT )k−1r0.

By induction it follows that both uk and rk belong to the Krylov subspaceKk+1(A; r0). Moreover, rk = φk(A)r0, for some φk in the space P1

k of allpolynomials p of degree k for which p(0) = 1. Since, in the generic case, byincreasing k the “shadow” Krylov subspaces Kk(AT ; r0) “fill” the completespace, the sequence of ‖rk‖ may be expected to decrease. The vector rk isthe unique element of the form p(A)r0, with p ∈ P1

k that is orthogonal toKk(AT ; r0) : in some weak sense, p is the best polynomial in P1

k .Consider some sequence of polynomials qk of exact degree k. The vectors

Auk and rk are orthogonal to Kk(AT ; r0) if and only if these vectors are or-thogonal to sj = qj(AT )r0 for all j = 0, 1, . . . , k − 1. Now, as we will seein 2.3.1,

(2.4) βk = θk(rk, sk)

(rk−1, sk−1)and αk =

(rk, sk)(Auk, sk)

in which θk is a scalar that depends on the leading coefficients of the polyno-mials φj and qj for j = k, k − 1. The Bi-CG algorithm takes qk = φk (andθk = 1), so that the sj are computed by the same recursions as for the rj (seeAlg. 2.1, where for the choice qk = φk, we use the notation rk instead of sk).However, in exact arithmetic, for any choice of qk the same approximationsxk, residuals rk and search directions uk can be constructed.

Algorithms as CGS, Bi-CGSTAB and BiCGstab(`) are based on the ob-servation that

(2.5)(rk, sk) = (rk, qk(AT )r0) = (qk(A)rk, r0) and

(Auk, sk) = (Aqk(A)uk, r0).

In the ideal case the operator φk(A) reduces r0. One may try to select qksuch that Qk = qk(A) additionally reduces rk as much as possible. In such acase it would be an advantage to avoid the computation of rk and uk, and onemight try to compute immediately rk = Qkrk, uk = Qkuk, and the associatedapproximation xk by appropriate recursions. As (2.4) and (2.5) show, one canuse these vectors to compute the Bi-CG iteration coefficients βk and αk (formore details, see 2.3.1). If the polynomials qk are related by simple recursions,these recursions can be used to compute efficiently the iterates rk, uk and xk

without computing rk and uk explicitly. Therefore, the computational effortof the Bi-CG algorithm to build the shadow Krylov subspace can also be usedto obtain an additional reduction (by Qk) for the Bi-CG residual rk. Since r2k

would have been constructed from the “weakly best” polynomial in P12k, we

may not expect that ‖rk‖ ‖r2k‖ : which says that a method based on Qk

can only converge twice as fast (in terms of costs). Since a Bi-CG step involves

Page 60: Diederik Fokkema - Thesis

46 Chapter 2. BiCGstab(`) for linear equations

two mvs it only makes sense to compute rk instead of rk if we can obtain rk

from rk−1 by 4 mvs at most and a few vector updates and if we can updatesimultaneously the corresponding approximation xk, where rk = b−Axk. Thishas been realized in CGS and Bi-CGSTAB (these algorithms require 2 mvsper step):

(i) The choice

(2.6) qk = φk

leads to the CGS (Conjugate Gradient-squared) algorithm of Sonneveld [93].Since φk(A) is constructed to reduce r0 as much as possible, one may notexpect that φk(A) reduces rk as well. Actually, for a large class of problemsφk(A) often transforms the rk to a sequence of residuals rk that converges veryirregularly or even diverges [101].

(ii) In [102], Van der Vorst attempted to repair this irregular convergencebehavior of CGS by choosing

qk(t) = (1− ωkt)qk−1(t) with ωk such that ‖(I − ωA)qk−1(A)rk‖2is minimal with respect to the scalar ω for ω = ωk.

In fact this is a special case of our algorithm, namely ` = 1.Unfortunately, for matrix-vector equations with real coefficients, ωk is real

as well. This may lead to a poor reduction of r = qk−1(A)rk, i.e., ‖rk‖ ≈ ‖r‖,where rk = (I − ωkA)r. The convergence of Bi-CGSTAB may even stagnate(and actually does, cf. experiments in [61]). The Bi-CG iteration coefficientsαk and βk can not be computed from rk (see (2.5)) if the polynomial qk is not ofexact degree k. This happens if ωk = 0. Likewise, ωk ≈ 0 may be expected tolead to inaccurate Bi-CG iteration coefficients. Consequently, stagnation in theMinimal Residual stage (ωk ≈ 0) may cause breakdown or poor convergenceof Bi-CGSTAB. One may come across an almost zero ωk if the matrix hasnon-real eigenvalues λ with relatively large imaginary parts. If the componentsof r in the direction of the associated eigenvectors are relatively large then thebest reduction by I − ωkA is obtained for ωk ≈ 0. This fatal behavior ofBi-CGSTAB may be “cured” as follows.

Select some ` ≥ 2. For k = m`+ `, take

(2.7)

qk = pmqk−`, where pm is a polynomial of degree `,pm(0) = 1 such that ‖p(A)qk−`(A)rk‖2 is minimal

with respect to p ∈ P1` for p = pm

and where qk−` is the product of MR-polynomials in P1` constructed in previous

steps. In the intermediate steps, k = m` + i, i = 1, 2, . . . , ` − 1, we takeqk = qm` to compute the residual rk = rm`+i = qm`(A)rk and search direction

Page 61: Diederik Fokkema - Thesis

Section 2.3. The BiCGstab(`) algorithm 47

uk = qm`(A)uk. We use tiqm` to compute the Bi-CG iteration coefficientsthrough (Airk, r0) and (Ai+1uk, r0) (cf. (2.5) and (2.4)). This choice leads tothe BiCGstab(`) algorithm in Section 2.3.2. A pseudo code for the algorithmis given in Alg. 2.2.

So, only for k = m`, do the polynomials qk that we use belong to P1k . In

the intermediate steps we employ two types of polynomials, polynomials ofexact degree k (the tiqm`) and polynomials that are 1 in 0 (the qm`).

The vectors rk, uk, Airk and Ai+1uk can be computed efficiently. However,we are interested in approximations xk and not primarily in the residual rk.These approximations can easily be computed as a side-product: if rk+1 =rk − Aw then xk+1 = xk + w. Whenever we update rk by some vector u wehave its original under A−1u as well. The polynomials used in the algorithmensure that this is possible.

The residuals rk in the intermediate steps k = m`+ i will not be optimalin Kk+k(A; r0). They cannot, because they belong to Kk+m`(A; r0). Althoughthe BiCGstab(`) algorithm produces approximations and residuals also in theintermediate steps, the approximations and residuals of interest are only com-puted every `-th step.

In the BiCGstab(`) algorithm we have that rk = qk(A)φk(A)r0. For k = m`the reduction operator qk(A)φk(A) that acts on r0 is the product of the Bi-CG reduction operator and a GMRES(`)-like reduction operator: qk(A) is theproduct of a sequence of GMRES reduction operators of degree ` (or, equiv-alently, of `-step Minimal Residual operators; see [82]). Note that qk(A) isnot the operator that would be obtained by applying k steps of GMRES(`)to the residual φk(A)r0 of k steps Bi-CG. After each ` steps of Bi-CG weapply an `-step Minimal Residual step and accumulate the effect. Neverthe-less BiCGstab(`) seems to combine the nice properties of both methods. IfGMRES stagnates in the first ` steps then typically GMRES(`) does not makeany progress later. By restarting, the process builds approximately the sameKrylov subspace as before the restart, thus encountering the same point of stag-nation. This is avoided in the BiCGstab(`) process where the convergence maykeep on going by the incorporated Bi-CG process. The residual r = qk−`(A)rkmay differ significantly from the residual qk−`(A)rk−`. Therefore, each “Mini-mal Residual phase” in BiCGstab(`) in general has a complete “new” startingresidual, while, in case of stagnation, at each new start, GMRES(`) employsabout the same starting residual, keeping stagnating for a long while.

2.3. The BiCGstab(`) algorithm. Let uk, ck, rk be the vectors asproduced by Bi-CG and let αk, βk be the Bi-CG iteration coefficients, ck = Auk

(see Alg. 2.1).

2.3.1. The computation of the Bi-CG iteration coefficients.Consider the Bi-CG method in Alg. 2.1. We are not really interested in

Page 62: Diederik Fokkema - Thesis

48 Chapter 2. BiCGstab(`) for linear equations

the shadow residuals rk nor in the shadow search directions uk. Actually, asobserved in Section 2.2, we only need rk to compute βk and αk through thescalars (rk, rk) and (ck, rk). We can compute these scalars by means of anyvector sk of the form sk = qk(AT )r0 where qk is some polynomial in Pk ofwhich the leading coefficient is non-trivial and known.

To prove this, suppose qk ∈ Pk has non-trivial leading coefficient σk,that is qk(t) − σkt

k is a polynomial in Pk−1. Note that rk = φk(AT )r0 forthe Bi-CG polynomial φk ∈ P1

k and that φk(t) − τktk belongs to Pk−1 for

τk = (−αk−1)(−αk−2) · · · (−α0). Hence, both the vectors rk − τk(AT )kr0 andsk − σk(AT )kr0 belong to Kk(AT ; r0). Since both the vectors rk and ck areorthogonal to this space (see [36]), we have that

(2.8) (rk, rk) =τkσk

(rk, sk) and (ck, rk) =τkσk

(ck, sk).

Hence,

(2.9) βk = − (rk, rk)(rk−1, rk−1)

= −τkσk−1

σkτk−1

(rk, sk)(rk−1, sk−1)

= αk−1σk−1

σk

(rk, sk)(rk−1, sk−1)

and

(2.10) αk =(rk, rk)(ck, rk)

=(rk, sk)(ck, sk)

.

Using (2.5) it even follows that we do not need sk. With rk = qk(A)rk andck = qk(A)ck, we have that

(2.11) (rk, sk) = (rk, r0) and (ck, sk) = (ck, r0).

Therefore, we can compute the Bi-CG iteration coefficients αk and βk by meansof rk and ck. We do not need the rk, uk, nor sk.

2.3.2. The construction of the BiCGstab(`) algorithm. The Bi-CG vectors uk, ck, rk are only computed implicitly — they only play a role inthe derivation of the algorithm — while the Bi-CG iteration coefficients αk,βk are computed explicitly — they are explicitly needed in the computation.∗

Instead of the Bi-CG vectors, for certain indices k = `m, we compute explicitlyvectors uk−1, rk and xk: xk is the approximate solution with residual rk anduk−1 is a search direction.

The BiCGstab(`) algorithm (Alg. 2.2) iteratively computes uk−1, xk andrk for k = `, 2`, 3`, . . . . These steps are called outer iteration steps. One single

∗Moreover, even if they were not needed in the computation, it could be worthwhileto compute them: from these coefficients one can easily compute the representation of thematrix of A with respect to the basis of the Bi-CG vectors ci. This matrix is tri-diagonaland enables us to compute cheaply approximations (Ritz values) of the eigenvalues of A.

Page 63: Diederik Fokkema - Thesis

Section 2.3. The BiCGstab(`) algorithm 49

outer step, in which we proceed from k = m` to k = m`+`, consists of an inneriteration process. In the first half of this inner iteration process (the Bi-CGpart) we implicitly compute new Bi-CG vectors. In the second half (the MRpart) we construct by a Minimal Residual approach a locally minimal residual.

We describe the BiCGstab(`) algorithm by specifying one inner loop.Suppose, for k = m` and for some polynomial qk ∈ Pk with qk(0) = 1 we

have computed uk−1, rk and xk such that

(2.12) uk−1 = Qkuk−1, rk = Qkrk and xk, where Qk = qk(A).

The steps of the inner loop may be represented by a triangular scheme as inScheme 2.1, where the steps for the computation of residuals and search direc-tions are indicated for ` = 2 (and k = m · 2). The computation proceeds fromrow to row, replacing vectors from the previous row by vectors on the next row.In Scheme 2.1 vector updates derived from the Bi-CG relations (2.3) are indi-cated by arrows. For instance, in the transition from the first row to the secondone, we use Qkuk = Qk(rk−βkuk−1) = Qkrk−βkQkuk−1 and to get from thesecond row to the third, we use Qkrk+1 = Qk(rk−αkAuk) = Qkrk−αkAQkuk.The computation involves other vector updates as well (in the MR part); theseare not represented. Vectors that are obtained by multiplication by the ma-trix A are framed. The column at the left edge represents iteration coefficientscomputed according to (2.9)–(2.11) before replacing the old row by the newone. Recall that ck = AQkuk. The scheme does not show how the approx-imations for x are updated from row to row. However, their computation isanalogous to the update of the residuals Qkrk+j : when a residual is updatedby adding a vector of the form −Aw, the approximation for x is updated byadding the vector w.

In the Bi-CG part, we construct the next row from the previous rows bymeans of the Bi-CG recursions (2.3) and matrix multiplication. The fifth row,for instance, is computed as follows: since rk+2 = rk+1 − αk+1Auk+1 we havethat

Qkrk+2 = Qkrk+1 − αk+1AQkuk+1 and

AQkrk+2 = AQkrk+1 − αk+1A2Qkuk+1.

By multiplying AQkrk+2 by A we compute the vector A2Qkrk+2 on the di-agonal of the scheme. After 2` rows we have the vectors AiQkrk+` andAiQkuk+`−1 (i = 0, 2, . . . , `).

In the MR part, we combine these vectors AiQkrk+` to find the minimalresidual rk+`. This vector is the residual in the best approximation of Qkrk+`

in the Krylov subspace K`−1(A;AQkrk+`). The computation of the scalars

Page 64: Diederik Fokkema - Thesis

50 Chapter 2. BiCGstab(`) for linear equations

Qkuk−1 Qkrk

βk ↓ Qkuk Qkrk AQkuk B

αk ↓ i

Qkuk Qkrk+1 AQkuk AQkrk+1 |βk+1 ↓ ↓ C

Qkuk+1 Qkrk+1 AQkuk+1 AQkrk+1 A2Qkuk+1 G

αk+1 ↓ ↓ Qkuk+1 Qkrk+2 AQkuk+1 AQkrk+2 A2Qkuk+1 A2Qkrk+2

Qkuk+1 Qkrk+2 AQkuk+1 AQkrk+2 A2Qkuk+1 A2Qkrk+2 Mγ1, γ2 R

Qk+2uk+1 Qk+2rk+2

Scheme 2.1. The computational schema for BiCGstab(2).

γi needed for this linear combination is done by the modified Gram-Schmidtorthogonalization process. The γi and AiQkuk+`−1 lead to uk+`−1:

rk+` = Qkrk+` −∑i=1

γiAiQkrk+` and

uk+`−1 = Qkuk+`−1 −∑i=1

γiAiQkuk+`−1.

In this part we determine from a theoretical point of view the polynomialpm(t) = 1−γ1t−· · ·−γlt

l. Implicitly we update qk to find qk+`. We emphasizethat we do not use complicated polynomials until we arrive at the last row ofthe scheme where we form implicitly pm.

The vectors in the second column of vectors, the Qkrk+j (r0 in the algo-rithm and in the detailed explanation below) are also residuals (correspondingto x0 in the algorithm). The vectors AjQkuk+j−1 and AjQkrk+j along thediagonal are used in the computation of the Bi-CG iteration coefficients αk+j

and βk+j+1. The computation of all these “diagonal vectors” require also 2`multiplications by A (mvs). Note that ` steps of the Bi-CG algorithm requirealso 2` multiplications by some matrix: ` multiplications by A and another` by AT . As indicated above, the other vectors AiQkrk+j and AiQkuk+j−1

(i = 0, 1, . . . , j− 1) in the triangular schemes can cheaply be constructed fromvector updates: we obtain the vectors Qkrk+`, AQkrk+`, . . . , A

`−1Qkrk+` as aby-product. Consequently, the last step in the inner loop can easily be exe-cuted. The vector rk+` is the minimal residual of the form p(A)Qkrk+`, wherep ∈ P1

` . In exact arithmetic, ` steps of GMRES starting with the residual

Page 65: Diederik Fokkema - Thesis

Section 2.3. The BiCGstab(`) algorithm 51

r0 = Qkrk+` would yield the same residual rk+` (see [82]). However, GMRESwould require ` mvs to compute this projection. For stability reasons, GMRESavoids the explicit computation of vectors of the form Air0. Since we keep thevalue for ` low (less than 8), our approach does not seem to give additionalstability problems besides the ones already encountered in the Bi-CG process.We trade a possible instability for efficiency (see also Section 2.3.8).

We now give details on the Bi-CG part, justify the computation of theBi-CG iteration coefficients and discuss the MR part. In the MR part, wecompute uk+`−1, rk+` and xk+`.

2.3.3. The Bi-CG part. In this section, in ` steps, we compute iter-atively AiQkuk+`−1, AiQkrk+` (i = 0, 1, . . . , `), the approximation x0 forwhich b − Ax0 = Qkrk+`, the Bi-CG iteration coefficients αk+j , βk+j (j =0, 1, . . . , `−1) and an additional scalar ρ0. We start our computation with thevectors u0 = uk−1 = Qkuk−1, r0 = rk = Qkrk and x0 = xk, the scalar αk−1

and some scalars ρ0 and ω from the previous step; −ω is the leading coefficientof pm−1.

Suppose after j-steps, we have

ui = AiQkuk+j−1, ri = AiQkrk+j (i = 0, 1, . . . , j),x0 such that r0 = b−Ax0,

α = αk+j−1 and ρ0 = (rj−1, r0).

Note thatui = Ai−1QkAuk+j−1 = Ai−1Qkck+j−1.

Then the (j + 1)-th step proceeds as follows (the “old” vectors “u”, “r” andx0 may be replaced by the new ones. For clarity of explanation we label thenew vectors with a ′). Below, we comment on the computation of αk+j andβk+j .

ρ1 = (rj , r0) = (AjQkrk+j , r0), β = βk+j = αρ1ρ0, ρ0 = ρ1,

u′i = AiQkuk+j = AiQk(rk+j − βk+juk+j−1) = ri − βui (i = 0, 1, . . . , j),

u′j+1 = Au′j (multiplication by A),

γ = (u′j+1, r0) = (AjQkck+j , r0), α = αk+j = ρ0γ ,

r′i = AiQkrk+j+1 = AiQk(rk+j − αk+jck+j) = ri − αu′i+1 (i = 0, 1, . . . , j),

r′j+1 = Ar′j (multiplication by A),

x′0 = x0 + αu′0 (b−Ax′0 = r0 − αAu′0 = r0 − αu′1 = r′0).

Page 66: Diederik Fokkema - Thesis

52 Chapter 2. BiCGstab(`) for linear equations

Now, drop the ·′ and repeat this step for j = 0, 1, . . . , `− 1.

The computation of the Bi-CG iteration coefficients. Consider some j ∈0, 1, . . . , `− 1 and let γ = (AjQkck+j , r0) and ρ1 = (AjQkrk+j , r0).

For j = 0, let ρ0 = (A`−1Qk−`rk−1, r0). The leading coefficient of qk(t) isequal to the leading coefficient of t`−1qk−`(t) times −ωm−1, where −ωm−1 isthe leading coefficient of the “MR polynomial” pm−1 for which qk = pm−1qk−`.Hence, by (2.9), (2.10) and (2.11), we have that

βk = − αk−1

ωm−1

ρ1

ρ0and αk =

ρ1

γ.

In case j > 0, let ρ0 = (Aj−1Qkrk+j−1, r0). Now, the polynomials tjqk(t) andtj−1qk(t) have the same leading coefficient. Therefore, again by (2.9), (2.10)and (2.11), we have that

βk+j = αk+j−1ρ1

ρ0and αk+j =

ρ1

γ.

2.3.4. The MR part. Suppose x0, rj , uj are known for j = 0, 1, . . . , `such that

r0 = b−Ax0 and rj = Arj−1, uj = Auj−1 (j = 1, 2, . . . , `)

(as after the ` steps of the Bi-CG part).Let

∑`j=1 γj rj the orthogonal projection of r0 onto spanr1, r2, . . . , r`.

With pm(t) = 1− γ1t− · · · − γ`t` (t ∈ R) we have that

rk+` = r0 −∑j=1

γj rj = pm(A)r0 = pm(A)Qkrk+` = Qk+`rk+`.

Further,

uk+`−1 = u0 −∑j=1

γj uj = pm(A)u0 = Qk+`uk+`−1

and

xk+` = x0 +∑j=1

γj rj−1.

We wish to compute these quantities as efficient as possible.The orthogonal vectors q1, q2, . . . , q` are computed by modified Gram--

Schmidt from r1, r2, . . . , r`; the arrays for r1, 2, . . . , r` may be used to store

Page 67: Diederik Fokkema - Thesis

Section 2.3. The BiCGstab(`) algorithm 53

q1, q2, . . . , q`.For ease of discussion, we consider the n× ` matrices R, Q and U for which

Rej = rj , Qej = qj , Uej = uj for j = 1, 2, . . . , `.

Moreover, we consider the ` × ` matrices T , D, S, where T is the uppertriangular matrix for which R = QT , D is the diagonal matrix given by QTQ =D, and S is given by Se1 = 0 and Sej = ej−1 (j = 2, 3, . . . , `). If ~γ ∈ R`

minimizes

‖r0 −R~γ ‖2 = ‖r0 −QT~γ ‖2,

or equivalently, ~γ is the least square solution of QT~γ = r0, then

~γ = T−1D−1QT r0

and

rk+` = r0 −R~γ = r0 −QD−1QT r0,

uk+`−1 = u0 − U~γ,xk+` = x0 + γ1r0 +RS~γ = x0 + γ1r0 +QTS~γ.

or, with

~γ′ = D−1QT r0, ~γ = T−1~γ′ and ~γ′′ = TS~γ,

we have

rk+` = r0 −Q~γ′, uk+`−1 = u0 − U~γ, xk+` = x0 + γ1r0 +Q~γ′′.

Since −γl is the leading coefficient of the polynomial pm we have ωm = γl (ωin the algorithm).

In the algorithm we use the same arrays for rj and qj . Therefore, qj iswritten as rj in the algorithm.

Remark 2.1 In Bi-CG as well as in several other iterative methods the vectorAuk is a scalar multiple of rk+1−rk. Unfortunately, Auk+`−1 is not a multipleof rk+` − rk nor of rk+` − Qkrk+` which would facilitate the computation ofAuk+`−1. For similar reasons one can not save on the costs of the computationof uk+`−1, unless one is willing to rearrange the Bi-CG part (see [92] or ourdiscussion in Section 2.3.7).

Page 68: Diederik Fokkema - Thesis

54 Chapter 2. BiCGstab(`) for linear equations

Choose x0 and some r0k = −`

r0 = b−Ax0

u−1 = 0, x0 = x0, ρ0 = 1, α = 0, ω = 1repeat until ‖rk+`‖ is small enough:

k = k + `u0 = uk−1, r0 = rk, x0 = xk

ρ0 = −ωρ0

for j = 0, 1, . . . , `− 1 do Bi-CG partρ1 = (rj , r0), β = βk+j = αρ1

ρ0, ρ0 = ρ1

for i = 0, 1, . . . , j doui = ri − βui

enddouj+1 = Auj

γ = (uj+1, r0), α = αk+j = ρ0γ

for i = 0, 1, . . . , j dori = ri − αui+1

enddorj+1 = Arj , x0 = x0 + αu0

enddofor j = 1, 2, . . . , ` do (mod. GS) MR part

for i = 1, 2, . . . , j − 1 doτij = 1

σi(rj , ri)

rj = rj − τij rienddoσj = (rj , rj), γ′j = 1

σj(r0, rj)

enddoγ` = γ′l, ω = γ`

for j = `− 1, `− 2, . . . , 1 do (~γ = T−1~γ′)γj = γ′j −

∑`i=j+1 τjiγi

enddofor j = 1, 2, . . . , `− 1 (~γ′′ = TS~γ)

γ′′j = γj+1 +∑`−1

i=j+1 τjiγi+1

enddou0 = u0 − γ`u`, x0 = x0 + γ1r0, r0 = r0 − γ′l r`,for j = 1, 2, . . . , `− 1

u0 = u0 − γj uj

x0 = x0 + γ′′j rjr0 = r0 − γ′j rj

enddouk+`−1 = u0, xk+` = x0, rk+` = r0

Alg. 2.2. The BiCGstab(`) algorithm

Page 69: Diederik Fokkema - Thesis

Section 2.3. The BiCGstab(`) algorithm 55

2.3.5. The computational cost and memory requirements.BiCGstab(`) as well as for instance GMRES(`) and CGS are Krylov subspacemethods. These methods compute iteratively a sequence (xk) (or (xm`)) ofapproximations of x for which, for every k, xk belongs to the k-dimensionalKrylov subspace Kk(A; r0) (or xm` ∈ Km`(A; r0) for every m; actually, theapproximation xk − x0 of x − x0 belongs to this Krylov subspace. Withoutloss of generality we assume x0 = 0). The success of such a method dependson

• its capability to find a good (best) approximation in the Krylov sub-space Kk(A, r0) (also in the presence of evaluation errors)• the efficiency to compute the next approximation xk+1 from the ones

of the previous step(s)• the memory space that is required to store the vectors that are needed

for the computation.For none of the methods, are all the conditions optimally fulfilled (unless thelinear problem to be solved is symmetric, or otherwise nice). For instance,in some sense GMRES finds the best approximation in the Krylov subspace(it finds the approximation with the smallest residual), but the steps are in-creasingly expensive in computational cost as well as in memory requirement.Bi-CG proceeds efficiently from step to step, but it does not find the bestapproximation. This makes it hard to compare the methods of this type ana-lytically.

It is hard to get access to the convergence behavior, to its capability to findgood approximations of x. Nevertheless one can easily investigate the compu-tational cost per iteration step, which we will do now. Note that some methodsdo not aim to find a good approximation in Krylov subspaces of all dimen-sions; CGS and Bi-CGSTAB head for even dimensions, while the BiCGstab(`)approximation xk is only computed for k = m`, for xm` ∈ K2m`(A; r0). Inaddition the computational cost may vary from step to step, as is the case forGMRES(`) and BiCGstab(`). For these reasons we give the average costs toincrease the dimension of the approximating Krylov subspace by one. If, fora certain linear system, the methods we wish to compare are all able to findan equally good approximation in the Krylov subspace of interest, then thisaverage cost represents the overall efficiency of the methods well. If some lessefficient method finds better approximations, then it depends on the numberof iteration steps which one is the best. We assume that the problem size n islarge and therefore that the costs of small vector operations (involving vectorsof dimension `) are negligible.

In Table 2.1 we list the computational cost and the memory requirementsfor a number of Krylov subspace methods. GMRESR(`,m) was introducedin [105] (see also [81]); in this modification of GMRES(`) (or, more appropriate,of GCR(`)), GMRES(m) is used as a preconditioner. GMRES(`) as well as

Page 70: Diederik Fokkema - Thesis

56 Chapter 2. BiCGstab(`) for linear equations

MethodComputational Costs Memory

Mvs axpy dot requirements

Bi-CG 2 6.5 2 7CGS 1 3.25 1 7Bi-CGSTAB 1 3 2 7BiCGStab2 1 5.5 2.75 10BiCGstab(2) 1 3.75 2.25 9BiCGstab(`) 1 0.75(`+ 3) 0.25(`+ 7) 2`+ 5GMRES(`) 1 ≈ 0.5(`+ 3) ≈ 0.5(`+ 1) `+ 3GMRESR(`,m) 1 ≈ g`,m + 1 ≈ gm,` m+ 2`+ 4

where g`,m = 0.5(m+ 3) + (`+ 2)/(2m)

The algorithm BiCGStab2 [49], may be improved slightly. For instance, it computescertain vectors in each step while it suffices to compute them in the even steps only.Our list above is based on the improved algorithm.

Table 2.1. The average cost per Krylov dimension.

GMRESR(`,m) avoid excessive use of memory by restarting after a certainnumber of steps.

The column “computational costs” contains the average amount of largevector operations that is needed to increase the dimension of the relevantKrylov subspace by one.

Furthermore, the table shows the maximum number of n-vectors that haveto be stored during the computation; we do not count the locations needed tostore the matrix (but our count includes b, r0, xk, and rk ).

2.3.6. Remarks on the implementation of the algorithm.(i) Actually we only introduced the vectors uk−1, xk and rk for ease of

presentation. Neither of them have to be stored: they can overwrite u0, x0

and r0.(ii) The computation of u0 in the MR part of Alg. 2.2 involves a number

of vector updates. In order to restrict memory traffic, it is worth postponingthe updates to the end and to combine them in the next Bi-CG part (whenj, i = 0) where u0 has to be updated again. A similar remark applies to thefinal update of x0 in the Bi-CG part and the first update of x0 in the MR part.One can also gain computational speed by computing inner products togetherwith the appropriate vector updates or matrix multiplications. For instanceρ1 in the Bi-CG part can be computed in combination with the last vectorupdate for r0 in the MR part.

Page 71: Diederik Fokkema - Thesis

Section 2.3. The BiCGstab(`) algorithm 57

(iii) The final updates in the MR part should be implemented using theBLAS2 subroutine GEMV (or GEMM from BLAS3) instead of the BLAS1subroutine AXPY. Depending on the computer architecture this will improveefficiency.

(iv) Another change in the algorithm that would reduce significantly theamount of work involves the modified Gram-Schmidt process. One can use thegeneralized inverse of R in order to compute the necessary coefficients γi for theMR-polynomial (see “The MR part” in Section 2.3.2). More precisely one cancompute these coefficients from the normal equations as ~γ = (RTR)−1RT r0.Now we do not have to compute an orthogonal basis for range(R) and we havesaved (`− 1)/4 vector updates per Krylov dimension.This approach not only reduces the total amount of work, but it also makesthe algorithm more suitable for parallel implementation. However, when `is large this approach may be more unstable than the one based on modifiedGram-Schmidt. Consequently one might not expect to obtain the best possiblereduction for r0. We discuss this variant and we analyze its stability in [92].

2.3.7. Variants. Many variants of the above process are feasible. Wewill mention only a few. For a detailed discussion, numerical experiments andconclusions, we refer to [92].

Dynamic choice of `. For a number of problems the BiCGstab(`) algorithm(with ` > 1) converges about as fast as the BiCGstab(1) algorithm, i.e., theaverage reduction per step of the residuals in one algorithm is comparable tothe reduction in the other. In such a case it is more efficient to work with ` = 1,since for larger ` the average cost per step is higher. However, particularly ifBiCGstab(1) stagnates (if ω ≈ 0), one should take an ` larger than 1. It maybe advantageous not to fix ` at the start of the process, but to choose ` foreach new inner loop depending on information from the previous inner loop.

If for larger ` a significant reduction can be obtained locally, it is also worthswitching to larger `.

It is not obvious how the switch can be realized and what the correctswitching criterion would be. We further discuss this issue in [92]. The switchthat we will discuss there is based on a BiCGstab(`) algorithm in which, inthe inner loop, the MR part and the Bi-CG part are reversed. This costsslightly more memory and vector updates, but it facilitates the selection of anappropriate ` before any stagnation or breakdown occurs.

Bi-CG combined with some polynomial iteration. The MR part does notrequire any additional mvs but it needs quite a number of axpys and dotsdue to the orthogonalization process. If one knows the coefficients γi of thepolynomial pm(t) = 1 −

∑`j=1 γjt

j , then one can skip the orthogonalization.Unfortunately, the optimal γj will not be known a priori, but one might hope

Page 72: Diederik Fokkema - Thesis

58 Chapter 2. BiCGstab(`) for linear equations

that the γj from previous steps work as well (at least for a number of consecu-tive steps). Further, since the Bi-CG iteration coefficients provide informationon the spectrum of A, one might use this information to construct a shiftedChebychev polynomial of degree ` and take this for pm. Of course, one may up-date the polynomial in each step. Note that the construction of the Chebychevpolynomial does not involve extra operations with n-vectors.

Bi-CG combined with standard GMRES or Bi-CG. Instead of computingrk+` by correcting r0 with some explicit linear combination of vectors Aj r0as we do, one can apply ` steps of standard GMRES with starting residualr0. This approach would require ` mvs to obtain rk+`. One has to computethe γj from the GMRES results in order to construct uk+`−1 (see also theremark on the MR part in Section 2.3.2). If one decides to pursue this lastapproach, one can save ` mvs and a number of axpys and dots in the Bi-CGpart as follows. The Bi-CG iteration coefficients αk+j and βk+j can also becomputed from the vectors AQkuk+j , Qkrk+j−1, Qkrk+j (the u1, r0 in thealgorithm) and the shadow residuals rj−1, rj . Instead of building a triangularscheme of residuals and search directions (see Scheme 2.1) one can stick to ascheme of three columns of Qkuk+j , Qkrk+j , AQkuk+j . The shadow residualsr1, r2, . . . , r`−1 need only be computed and stored once.

If these shadow residuals are available, it is tempting to apply ` stepsof Bi-CG to compute rk+` starting with Qkrk+`. This saves a number ofaxpys and dots in the “MR part”. The search direction uk+`−1 has alsoto be computed. This can be done without additional mvs: from the Bi-CGrelations (2.3) it follows that the Ajuk+`−1 are linear combination of AiQkrk+`

and AQkuk+`−i (i = 1, 2, . . . , j). The scalars in the linear combination canbe expressed in terms of the Bi-CG iteration coefficients βk+j , αk+j . Hence,uk+`−1 can be computed by updatingQkuk+`−1 using the previously computedvectors AQkuk+`−j and AjQkrk+` (j = 1, 2, . . . , `).

2.3.8. The stability. We obtain rk+` by subtracting some explicit linearcombination of vectors Aj r0 from r0. One may object that this approachmight be unstable especially if ` is not small. However, we restrict ourselvesto small ` (` ≤ 8). Our strategy resembles somewhat the look ahead strategyin the Lanczos algorithms in [40, 48, 50]. In our numerical experiments theconvergence did not seem to suffer from such instabilities. On the contrary,the residual reduction of BiCGstab(`) proceeds more smoothly than those ofBi-CG or CGS. Bi-CG and `-step MR seem to improve their mutual stability.The following two observations may help to understand why the γi may beaffected by non-small errors without spoiling the convergence.

(i) The polynomial pm must be non-degenerate (i.e., the contributionγlA

`r0 should be significant also in finite precision arithmetic) and the samescalars should be used to update the residual, the search direction and the

Page 73: Diederik Fokkema - Thesis

Section 2.4. The preconditioned BiCGstab(`) algorithm 59

approximation. The Bi-CG part does not impose other restrictions on the γi

used in the actual computation.(ii) In the MR part, any reduction is welcome even it is not the optimal

one.As an alternative to our approach, one may gain stability by computing

rk+` by ` steps of GMRES with starting residual r0 (see the “GMRES variant”in Section 2.3.7). One also has to keep track of the search directions. Sincethis GMRES stability “cure” is directed towards the residuals it is not clearwhether this approach would improve the stability of the computation of thesearch directions. We return to these stability questions in [92].

In [49], for ` = 2, Gutknecht “avoids” the instability caused by workingwith the “naive” basis for the Krylov subspace. He computes rk+` from r0 bya GCR-type method (in his algorithm the GCR part and the Bi-CG part areintertwined), thus incorporating the breakdown dangers of GCR.

2.4. The preconditioned BiCGstab(`) algorithm. Let K be a pre-conditioning matrix. Instead of solving Ax = b, one may as well solve

(2.13) K−1A = K−1b

or

(2.14) AK−1y = b with x = K−1y

Therefore, by replacing A by K−1A and r0 = b−Ax0 by r0 = K−1(b−Ax0),we have an algorithm that solves (2.13) iteratively. In this case the computedresiduals rk are not the real residuals (even not in exact arithmetic) but rk =K(b−Axk).

By replacing A by AK−1 and x0 = x0 by x0 = Kx0, we have an algorithmthat solves iteratively (2.14). The computed residuals are the real ones, thatis, rk = b − AK−1xk, but now xk is not the approximation we are interestedin: we would like to have K−1xk instead. If we do not want to monitor theapproximations of the exact solution x, it suffices to compute K−1xk only aftertermination.

In both variants, the BiCGstab(`) algorithm may converge faster, due tothe preconditioning. However, in order to get either the real residual (in (2.13))or the real approximate (in (2.14)), some additional work is required. Incontrast to algorithms as Bi-CG and GCR, there is no variant of preconditionedBiCGstab(`) that generates the real residual and the approximations of interestwithout additional computational work or additional storage requirement.

2.5. Numerical examples. In this section we will discuss some numer-ical experiments. These experiments are intended to show the characteristicbehavior of BiCGstab(`) for certain linear systems. We do not pretend that

Page 74: Diederik Fokkema - Thesis

60 Chapter 2. BiCGstab(`) for linear equations

the problems are solved in the best possible way. For instance, in some ex-periments we used a preconditioner, whereas in others we did not. With asuitable preconditioner all methods can be made to converge efficiently, butthis is not the point we would like to make. The experiments are used toshow that BiCGstab(`) may be a good alternative for certain problems. Thealgorithm was implemented as in Alg. 2.2.

All partial differential equations were discretized with finite volumes dis-cretization. When a preconditioner was used then the explicitly left precondi-tioned system was solved (see (2.13)). In all cases x0 = 0 was taken as an initialguess. The experiments were done on a CRAY Y-MP 4/464, in a multi-userenvironment. The iterations were stopped when ‖rk‖2/‖r0‖2 < 10−9 (exceptin example 2 where the iterations were stopped when ‖rk‖2/‖r0‖2 < 10−12),or when the number of matrix multiplications exceeded 1000.

The figures show the convergence behavior of the iterative methods. ForBiCGstab(`) we have plotted the norms of the residuals rm` that are com-puted by Alg. 2.2, i.e., only every `-th step (see our discussion at the end ofSection 2.2). Horizontally the number of matrix multiplications is counted. Inexact arithmetic this number represents the dimension of the relevant Krylovsubspace, except for Bi-CG, where it should be divided by two.

At the end of this section we give in Table 2.2 an overview of the requiredCPU-time for the true residual norm of several iterative methods. The num-bers between brackets () are the log of the `2-norm of the final true residuals:log10(‖b − Axk‖2). The log of the norm of the computed updated residualscan be seen from the figures. A ‘ * ’ in Table 2.2 indicates that the methoddid not meet the required tolerance before 1000 multiplications of the matrixA. We did our experiments for Bi-CG, CGS and several popular or successfulGMRES variants. We selected algorithms that have about the same memoryrequirements as the BiCGstab(`) algorithms that we tested. If one can store13, say, n-vectors then one may choose for instance between BiCGstab(4),GMRES(10) and GMRESR(3,4) [105]. In our experiments BiCGstab(4) thenseems to be the better choice.

2.5.1. Example 1. First we consider an advection dominated 2-nd orderpartial differential equation, with Dirichlet boundary conditions, on the unitcube (this equation was taken from [61]):

uxx + uyy + uzz + 1000ux = F.

The function F is defined by the solution

u(x, y, z) = exp(xyz) sin(πx) sin(πy) sin(πz).

This equation was discretized using (52 × 52 × 52) volumes, resulting in aseven-diagonal linear system of order 125000. No preconditioning was used.

Page 75: Diederik Fokkema - Thesis

Section 2.5. Numerical examples 61

-10

-8

-6

-4

-2

0

2

0 100 200 300 400 500 600

-.- BiCG, -- BiCGstab, - BiCGstab(2)

number of matrix multiplications

log1

0 of

res

idua

l nor

m

Fig. 2.1. Convergence plot of example 1.

In Fig. 2.1 we see a plot of the convergence history. Bi-CGSTAB stagnatesas might be anticipated from the fact that this linear system has large complexeigenpairs. Surprisingly, Bi-CGSTAB does even worse than Bi-CG. For thistype of matrices this behavior of Bi-CGSTAB is not uncommon and mightbe explained by the poor first degree minimal residual reductions. In thatcase the Bi-CG iteration coefficients αk and βk are not accurately computed.BiCGstab(2) converges quite nicely and almost twice as fast as Bi-CG (see ourdiscussion in Section 2.2).

2.5.2. Example 2. Next, we give an example where BiCGStab2 [49]suffers from the underlying Bi-CGSTAB algorithm (see our discussion in theintroduction).

The symmetric positive definite linear system stems from a (200 × 200)discretization of

−(Dux)x − (Duy)y = 1,

over the unit square, with Dirichlet boundary conditions along y = 0 andNeumann conditions along the other parts of the boundary. The function Dis defined as

D = 1000 for 0.1 ≤ x, y ≤ 0.9 and D = 1 elsewhere.

Page 76: Diederik Fokkema - Thesis

62 Chapter 2. BiCGstab(`) for linear equations

-8

-6

-4

-2

0

2

4

0 100 200 300 400 500 600

-. BiCGstab2, : Bi-CGSTAB, -- BiCGstab(2), - BiCGstab(4)

number of matrix multiplications

log1

0 of

res

idua

l nor

m

Fig. 2.2. Convergence plot for example 2.

This example was taken from [102] and we used a Modified Incomplete Choleskydecomposition [46] as a preconditioner. A convergence plot is given in Fig. 2.2.

Here the underlying Bi-CG algorithm looses bi-orthogonality among theresiduals in a very early phase and consequently superlinear convergence takesplace for none of the methods (in contrast to what might be expected; see,for instance, [98] and [103]), but apparently the BiCGstab(`) algorithm for` = 2, 4, has less problems. Gutknecht’s BiCGStab2 follows the convergencehistory of Bi-CGSTAB almost perfectly. This kind of behavior was also ob-served by Gutknecht. Apparently the polynomials of degree one in the oddsteps spoil the overall convergence behavior of BiCGStab2.

In exact arithmetic we have that rk = b−Axk. In finite precision arithmeticthe true residual b − Axk and the recursively computed rk may differ. Thedifference will be more significant if the convergence history of the residualsshows large peaks. In our algorithm the updates for the approximations followvery closely the updates for the residuals: in each step we have x0 = x0 +w where r0 = r0 − Aw. In Gutknecht’s version the formulas that describethe update of the approximations are quite different from the ones for theresiduals. Therefore, if the true residuals and the computed ones drift apartthis is much more apparent in Gutknecht’s version. In this experiment the finalcomputed preconditioned residual norms were of order 10−8, whereas the true

Page 77: Diederik Fokkema - Thesis

Section 2.5. Numerical examples 63

-8

-7

-6

-5

-4

-3

-2

-1

0

0 200 400 600 800 1000

-. BiCGstab2, : BiCGstab, -- BiCGstab(2), - BiCGstab(4)

number of matrix multiplications

log1

0 of

res

idua

l nor

m

Fig. 2.3. Convergence plot for example 3.

preconditioned residual norms were of order 10−4 for BiCGstab(`), ` = 1, 2, 4,but only of order 10−1 for BiCGStab2 (see Table 2.2).

Although BiCGstab(`) becomes more expensive with respect to the num-ber of inner products and vector updates as ` increases, the convergence maybe faster, and therefore, the total CPU-time needed to find an accurate ap-proximation may decrease. In this example the BiCGstab(4) algorithm (forinstance) is faster than the BiCGstab(2) algorithm (see Table 2.2). So it issometimes more profitable to use an ` > 2 (see also our next example).

2.5.3. Example 3. Our third example shows more clearly that taking` > 2 may be beneficial. Here BiCGstab(2) converges very slowly, whereasBiCGstab(4) does not seem to have any problem: it converges quite nicely,although linearly. This example was taken from [75].

The nonsymmetric linear system comes from a (201 × 201) finite volumediscretization of

−ε(uxx + uyy) + a(x, y)ux + b(x, y)uy = 0,

on the unit square, where

a(x, y) = 4x(x− 1)(1− 2y), b(x, y) = 4y(1− y)(1− 2x),

Page 78: Diederik Fokkema - Thesis

64 Chapter 2. BiCGstab(`) for linear equations

-8

-6

-4

-2

0

2

4

0 50 100 150 200 250 300 350 400 450 500

-.- BiCG, -- BiCGstab, - BiCGstab(2)

number of matrix multiplications

log1

0 of

res

idua

l nor

m

Fig. 2.4. Convergence plot for example 4 (129× 129).

with Dirichlet boundary conditions u(x, y) = sin(πx) + sin(13πx) + sin(πy) +sin(13πy). We took ε = 10−1 and did not use any preconditioning. A conver-gence plot is shown in Fig. 2.3.

2.5.4. Example 4. Our last example shows that even if Bi-CGSTABconverges well, BiCGstab(`), ` = 2, 4, . . . , may be good competitors. More-over, when the problem is discretized on a finer grid BiCGstab(2) seems to bea better choice for solving this problem. The problem was taken from [102].

The two nonsymmetric linear systems come from a (129×129) and a (201×201) finite volume discretization of the partial differential equation

−(Aux)x − (Auy)y +B(x, y)ux = F

over the unit square, with B(x, y) = 2 exp(2(x2 + y2)). Along the boundarieswe have Dirichlet conditions: u = 1 for y = 0, x = 0 and x = 1, and u = 0 fory = 1. The function A is defined as shown in figure 2.6; F = 0 everywhere,except for the small subsquare in the center where F = 100. Incomplete LUfactorization was used as a preconditioner.

From Fig. 2.4 we observe that Bi-CGSTAB and BiCGstab(2) behave simi-larly for the coarser grid with BiCGstab(2) slightly faster, but on the finer grid(Fig. 2.5) BiCGstab(2) performs much better than Bi-CGSTAB. BiCGstab(4)

Page 79: Diederik Fokkema - Thesis

Section 2.6. Conclusions 65

-8

-6

-4

-2

0

2

4

0 100 200 300 400 500 600 700 800 900 1000

-.- BiCG, -- BiCGstab, - BiCGstab(2)

number of matrix multiplications

log1

0 of

res

idua

l nor

m

Fig. 2.5. Convergence plot for example 4 (201× 201).

F =100

A = 10e4A = 10e-5

A = 10e2

0 u = 1 1

u = 1

u = 01

u = 1

Fig. 2.6. The coefficients for example 4.

and BiCGstab(8) have a similar convergence history as BiCGstab(2). Comparealso Table 2.2.

2.6. Conclusions. From our numerical experiments we have learned thatthe BiCGstab(`) algorithm may be an attractive method for solving linear

Page 80: Diederik Fokkema - Thesis

66 Chapter 2. BiCGstab(`) for linear equations

Method Ex. 1 Ex. 2 Ex. 3 Ex. 4 (129) Ex. 4 (201)

Bi-CG 4.96(10.5) 6.35(4.2) 2.71(2.4)∗ 1.60(7.0) 4.58(7.0)

CGS divergence 4.54(4.4) breakdown divergence divergence

Bi-CGSTAB stagnation 4.67(4.3) 3.22(3.4)∗ 1.10(7.0) 7.87(6.2)

BiCGStab2 4.42(10.7) 5.63(1.9) 4.26(2.6)∗ 1.31(6.8) 3.77(6.7)

BiCGstab(2) 3.88(10.4) 4.45(4.5) 4.00(3.6)∗ 1.01(6.8) 3.68(6.7)

BiCGstab(4) 4.17(10.9) 4.00(4.5) 4.35(7.5) 1.11(6.8) 3.68(6.8)

BiCGstab(8) 5.03(11.1) 4.36(3.5) 5.54(6.9) 1.27(7.5) 4.06(6.9)

GMRES(6) 5.27(10.3) stagnation 4.69(2.7)∗ stagnation stagnation

GMRES(10) 6.30(10.3) stagnation 5.16(3.5)∗ stagnation stagnation

GMRESR(2,2) 8.85(10.3) stagnation 5.71(2.5)∗ stagnation stagnation

GMRESR(3,4) 6.25(10.3) stagnation 5.16(2.6)∗ stagnation stagnation

Table 2.2. CPU-time and − log10 of the true residual norm (see the introduc-tion of Section 2.5).

systems of equations. The algorithm is a generalization of Van der Vorst’sBi-CGSTAB [102]. For ` = 1 BiCGstab(`) computes exactly the same approx-imation xk as Bi-CGSTAB does.

For ` > 1 it seems that BiCGstab(`) is less affected by relatively large com-plex eigenpairs (as one encounters in advection dominated partial differentialequations). Its computational work and memory requirement is modest.

BiCGstab(2) is, in exact arithmetic, equivalent withBiCGStab2 [49]. How-ever we have given arguments and experimental evidence for the superiorityof our version.

Therefore, we conclude that BiCGstab(`) may be considered as a compet-itive algorithm to solve nonsymmetric linear systems of equations.

Acknowledgement. The authors are grateful to Henk Van der Vorst forencouragement, helpful comments, and inspiring discussions.

Page 81: Diederik Fokkema - Thesis

Chapter 3

ENHANCED IMPLEMENTATION OF BICGSTAB(`) FORSOLVING LINEAR SYSTEMS OF EQUATIONS

DIEDERIK R. FOKKEMA

Abstract. In this paper, we present a FORTRAN implementation of the BiCGstab(`)algorithm. The implementation is based on the power basis variant of BiCGstab(`). Thisvariant is enhanced with a more stable way of determination of the iteration coefficients andwith a more reliable update strategy for the residuals. These enhancements improve theaccuracy and rate of convergence at almost no additional computational costs.

Key words. Nonsymmetric linear systems, Iterative solvers, BiCGstab(`), Krylovsubspace

AMS subject classifications. 65F10

3.1. Introduction. The BiCGstab(`) algorithm [85] is an iterative solu-tion method for linear problems

(3.1) Ax = b,

where A is some given nonsingular (n × n)-matrix and b some given righthand side. Typically n is large and A is sparse. The algorithm belongs to theclass of hybrid BiCG methods. The methods in this class iteratively compute,for a given initial guess x0, approximate solutions xk for which the residualrk = b−Axk can be written formally as

(3.2) rk = qk(A)rk,

in which qk is a polynomial of degree k with q(0) = 1, and rk is the kthBiCG [36, 57] residual. In BiCGstab(`) the polynomial qk is chosen as aproduct of locally minimizing polynomials of degree `. More precisely, fork = m`, with P1

` the space of polynomials p of degree ≤ ` with p(0) = 1,

(3.3)qk = pMR

m,`qk−`, with pMRm,` ∈ P1

` such that ‖p(A)qk−`(A)rk‖2is minimal with respect to p ∈ P1

` for p = pMRm,`.

Page 82: Diederik Fokkema - Thesis

68 Chapter 3. Enhanced implementation of BiCGstab(`)

There are numerous ways to implement this procedure, see, for instance, [102,85, 92, 49], but basically the iteration steps of a BiCGstab method can bedivided into two parts, namely,

(i) the BiCG part, in which the BiCG residual is implicitly updatedusing the short recursions of BiCG

(ii) the polynomial part, in which the minimal residual polynomial is con-structed and used to update the new residual and corresponding approximatesolution.

Remark 3.1 In the following, our notation reflects the notation used in thealgorithms Alg. 3.1–3.3: the index k of the iteration vectors is suppressed.For instance, after the BiCG part in Alg. 3.1, we have that r0 = qk(A)rk+`,and after the polynomial part, r0 = qk+`(A)rk+`.Furthermore, in the algorithms, we use the MATLAB index notation.

In Alg. 3.1 we have pictured an efficient variant of BiCGstab(`) that issuggested in [85, 92]. After the BiCG part (starting with r0 = qk(A)rk) apower basis

R = [r0, Ar0, . . . , A`r0]

is available, such that r0 = qk(A)rk+`. In the polynomial part, this basis R isthen used to minimize the residual with the help of the normal equations, i.e.,with R = [Ar0, A

2r0, . . . , A`r0]

r0 ← r0 − R(R∗R)−1R∗r0.

The associated approximate solution x (= xk+`), and the search direction u0,needed in the BiCG part, are updated correspondingly.

However, whereas the minimal residual polynomials are optimal for reduc-ing the residual, they are not optimal for an accurate determination of theBiCG iteration coefficients (α and β in Alg. 3.1) [88, 89]. Inaccurate coeffi-cients are undesirable, because they may disturb the underlying BiCG process,and this may affect the speed of convergence.

In [88, 89] it is argued that, for accurate coefficients (at least locally) oneshould take a different polynomial, namely, the orthogonal polynomial pOR

m,`

that is characterized by

(3.4) pORm,` ∈ P1

` for which pORm,`(A)r0 ⊥ [r0, Ar0, . . . , A

`−1r0]

Unfortunately, these kind of polynomials may amplify the residual, and thisalso may affect for the speed of convergence.

The suggestions is then to take a suitable convex combination of pMRm,` and

pORm,` as a compromise. This choice may still amplify the residual, but whereas

Page 83: Diederik Fokkema - Thesis

Section 3.1. Introduction 69

Choose an initial guess x0 and some r0r0 = K−1(b−Ax0), ζ0 = ‖r0‖2u0 = 0, α = ρ0 = ω = 1, ζ = ζ0while ζ > ε ζ0 do

— The BiCG part —ρ0 = −ωρ0

for j = 0, 1, . . . , `− 1 doρ1 = (rj , r0), β = α(ρ1/ρ0)ρ0 = ρ1

for i = 0, 1, . . . , j doui = ri − βui

enddouj+1 = K−1Auj

σ = (uj+1, r0), α = ρ1/σx = x + αu0

for i = 0, 1, . . . , j dori = ri − αui+1

enddorj+1 = K−1Arj

enddo— The polynomial part —for i = 1, 2, . . . , ` do

for j = 1, 2, . . . , i do

Z(i, j) = Z(j, i) = (rj , ri)enddoy(i) = (r0, ri)

enddoy = Z−1y, ω = y(`)for i = 1, 2, . . . , ` do

u0 = u0 − y(i)ui

x = x + y(i)ri−1

r0 = r0 − y(i)ri

enddoζ = ‖r0‖2

endwhile

Alg. 3.1. Left preconditioned BiCGstab(`) with powerbasis and normal equations. The matrix K is a precondi-tioner for A.

Page 84: Diederik Fokkema - Thesis

70 Chapter 3. Enhanced implementation of BiCGstab(`)

the amplification by pORm,` can be unbounded, the amplification by the convex

combination is at most√

2 (for Ω =√

2/2 ≈ 0.7, see Section 3.2 below) andusually much less. If this leads to divergence, then increasing the value of `may help. The implementation of this procedure is the subject of Section 3.2.

Remark 3.2 In fact, taking a convex combination may be viewed as a curefor a breakdown possibility in the polynomial part. We do not address thebreakdown possibilities in the BiCG recursions.

Of course, speed of convergence is one thing, but accuracy∗ of the solutionis desired as well: because the approximate solution and the residual are up-dated with recursions, rounding errors may cause significant differences in therecursively computed residual r0 and the true residual b−Ax. As an inspectionof the algorithm shows, possible rounding errors in the approximation are notcorrected in the update for the residual (see also [91, 45]).

Since the residual is usually involved in some kind of stopping criterion,this is may cause a premature termination of the algorithm: the true residualb−Ax and therefore the approximate solution x does not satisfy the stoppingcriterion.

A naive strategy to overcome this problem would be to replace the com-puted residual by the true residual. Not only is this expensive because anextra matrix multiplication is needed in each iteration, but these true resid-uals do not satisfy the given BiCG recursions and this may even destroy theconvergence eventually.

In [91], it is shown that an occasional replacement of the recursively com-puted residual by the true residual at strategic points during the iterations maylead to more accurate solutions, while maintaining the speed of convergence.However, if these replacements are performed for residuals much smaller thanthe initial residual, then also the update of the approximate solution requires aspecial treatment. This is done by accumulating groups of updates for updat-ing the approximation. The implementation of such a strategy is the subjectof Section 3.3.

The remainder of this paper is organized as follows. In Section 3.4 wepresent a FORTRAN implementation that incorporates these enhancements.In Section 3.5 we present some numerical examples. Section 3.6 contains ourconclusions.

3.2. Maintaining the convergence. In [88, 89] the following convexcombination for a more stable determination of the BiCG coefficients is pro-

∗We say that an algorithm is accurate for a certain problem if the recursively computedresiduals r0 and the true residual b−Ax are of comparable size, i.e., ‖b−Ax− r0‖2 shouldbe small.

Page 85: Diederik Fokkema - Thesis

Section 3.2. Maintaining the convergence 71

posed: in the polynomial part, take r0 ← p(A)r0 with

(3.5) p =1− ωγ1− ω2

pMRm,` +

ωγ − ω2

1− ω2pOR

m,`

where

(3.6) ω :=‖pMR

m,`(A)r0‖2‖pOR

m,`(A)r0‖2and γ := max (ω, 0.7).

An equivalent formulation (cf. [88]), more suitable for implementation, is thefollowing. With

R = [Ar0, A2r0, . . . , A

`−1r0],

r0 = r0 − R(R∗R)−1R∗r0,

r` = A`r0 − R(R∗R)−1R∗A`r0,

take

(3.7) r0 ← r0 − γ‖r0‖2‖r`‖2

r`,

where

(3.8) γ := (%/|%|) max (|%|, 0.7), and % :=(r0, r`)‖r0‖2 ‖r`‖2

.

This strategy can be incorporated by replacing the polynomial part in algo-rithm Alg. 3.1 by the algorithm in Alg. 3.2.

The implementation follows from the observation that with

R = [r0, Ar0, . . . , A`r0] and Z = R∗R,

r0 is given by

r0 = Ry0, for y0 = (1, −(Z(2 :`, 2:`)−1Z(2 :`, 1))∗, 0)∗

and, similarly, r` is given by

r` = Ry`, for y` = (0, −(Z(2 :`, 2:`)−1Z(2 :`, `+ 1))∗, 1)∗.

The inner product (r0, r`) and the norms ‖r0‖2 and ‖r`‖2 follow from observingthat:

(r0, r`) = y∗` R∗Ry0 = y∗`Zy0,

‖r0‖2 =√y∗0R

∗Ry0 =√y∗0Zy0,

‖r`‖2 =√y∗` R

∗Ry` =√y∗`Zy`.

This implies hardly any additional costs (see also Tab. 3.1).

Page 86: Diederik Fokkema - Thesis

72 Chapter 3. Enhanced implementation of BiCGstab(`)

— Z = R∗R —for i = 0, 1, . . . , ` do

for j = 0, 1, . . . , i do

Z(i+ 1, j + 1) = Z(j + 1, i+ 1) = (rj , ri)enddo

enddo— r0 and r` —y0 = (−1, (Z(2 :`, 2:`)−1Z(2 :`, 1))∗, 0)∗

y` = (0, (Z(2 :`, 2:`)−1Z(2 :`, `+ 1))∗, −1)∗

— Convex combination —

κ0 =√y∗0Zy0, κ` =

√y∗`Zy`, % =

y∗`Zy0κ0κ`

γ = (%/|%|) max (|%|, 0.7),

y0 = y0 − γκ0

κ`y`

— Update —ω = y0(`+ 1)for i = 1, 2, . . . , ` do

u0 = u0 − y0(i+ 1)ui

x = x + y0(i+ 1)ri−1

r0 = r0 − y0(i+ 1)ri

enddo

ζ =√y∗0Zy0

Alg. 3.2. Convex combination of pMRm,`(A)r0 and pOR

m,`(A)r0.

3.3. Reliable updates. In [91] the accuracy of computed residuals is ad-dressed. Efficient and easy to implement strategies are proposed that improvethe accuracy significantly, while maintaining the speed of convergence.

Such a strategy can be incorporated as displayed in Alg. 3.3. For per-forming a group wise update of the approximate solution, we have chosen thefollowing conditions (cf. [91]):

(3.9) if (‖r0‖2 < δζ0 & ζ0 ≤M(x)) then ‘update app’ = ‘true’,

where ζ0 is the norm of the initial residual, δ = 10−2, and M(x) is the max-imum of the norm of the residuals since the last group wise update of theapproximation. For replacing the recursively computed residual by the true

Page 87: Diederik Fokkema - Thesis

Section 3.4. Description of FORTRAN code 73

residual, we have chosen the following conditions (cf. [91]):

(3.10) if

(‖r0‖2 < δM(r) & ζ0 ≤M(r))or ‘update app’ = ‘true’

then ‘compute res’ = ‘true’,

where ζ0 is the norm of the initial residual, δ = 10−2, andM(r) is the maximumof the norm of the residuals since the last computation of the true residual.This combination of conditions for updating the solution and the replacementof the recursively computed residual by the true residual gives a compromisebetween costs and accuracy (cf. [91]).

MethodComputational Costs Memory

MVs axpys dots requirements

BiCGstab(`) 2` `2 + 5` `2/2 + 7/2`+ 1 2`+ 3EnhancedBiCGstab(`)

2` (∗) `2 + 5` `2/2 + 9/2`+ 1 (∗) 2`+ 5

The ‘(∗)’ indicates that additional costs are involved when a reliable update is done:1 axpy + 1 MV, when the residual is replaced; 1 axpy + 2 copies, when the solutionis updated.

Table 3.1. Computational costs per iteration.

3.4. Description of FORTRAN code. Here we present a FORTRANcode for the enhanced version of BiCGstab(`). In Tab. 3.1 an overview ofthe computational costs per iteration for the unmodified and for the enhancedversion is given. As we see, the additional costs are low: 2 extra vectors forkeeping track of the groups of updates for the approximate solution (x′ andb′); ` dots for determining M(x) and M(r); and some costs for when a reliableupdate is performed.

The calling sequence and the parameters are explained below. The FOR-TRAN code itself uses subroutines and functions from LAPACK [1].

BISTBL BISTBL — Left Preconditioned BiCGstab(`) for the it-erative solution of linear systems Ax = b.

Declaration subroutine bistbl ( `, n, x, b, mv, solve, tol, mxmv,work, ldw, rwork, ldrw, iwork,info )

Page 88: Diederik Fokkema - Thesis

74 Chapter 3. Enhanced implementation of BiCGstab(`)

Choose an initial guess x0 and some r0r0 = K−1(b−Ax0), ζ0 = ‖r0‖2u0 = 0, α = ρ0 = ω = 1, ζ = ζ0x′ = x0, x = 0, b′ = r0

k = −`while ζ > ε ζ0 do

— The BiCG part —ρ0 = −ωρ0

for j = 0, 1, . . . , `− 1 doρ1 = (rj , r0), β = α(ρ1/ρ0)ρ0 = ρ1

for i = 0, 1, . . . , j doui = ri − βui

enddouj+1 = K−1Auj

σ = (uj+1, r0), α = ρ1/σx = x + αu0

for i = 0, 1, . . . , j dori = ri − αui+1

enddorj+1 = K−1Arj

enddo— The polynomial part —Compute convex combination as in Alg. 3.2— The reliable update part —set ‘update app’ (cf. (3.9)) and ‘compute res’ (cf. (3.10))if ‘compute res’ = ‘true’

r0 = b′ −Axif ‘update app’ = ‘true’

x′ = x′ + x, x = 0, b′ = r0

endifendif‘compute res’ = ‘update app’ = ‘false’

endwhilex = x′ + x

Alg. 3.3. Enhanced left preconditioned BiCGstab(`). The ma-trix K is a preconditioner for A.

Page 89: Diederik Fokkema - Thesis

Section 3.4. Description of FORTRAN code 75

Parameters integer `

On entry, ` specifies the degree of the polynomial (` > 1).Suggested values are ` = 1, 2, 4, 8. Unchanged on exit.

integer n

On entry, n specifies the dimension of the matrix A (n >1). Unchanged on exit.

x

double precision array of size n. On entry, the array x hasthe value of the initial guess to the solution, e.g., x = 0.On exit, if info = 0, x is overwritten by the approximatesolution.

b

double precision array of size n. On entry, the array bhas the value of the right hand side of the linear problemAx = b. Unchanged on exit.

external mv

external subroutine mv(n, x, y). Must be supplied bythe user and should return the vector y = Ax of size n.

external solve

external subroutine solve(n, x). Must be supplied bythe user and should return x ← K−1x, where K is apreconditioner for A.

double precision tol

On entry, tol > 0 specifies the stopping tolerance. Onexit, if info = 0, tol has the value of the relative norm ofthe true residual.

integer mxmv

On entry, mxmv specifies the maximum number of ma-trix multiplications. On exit, if info = 0, mxmv has thevalue of the number of matrix multiplications actuallyperformed.

work

double precision array of size ldw . Workspace for (3 +2(`+ 1)) vectors of size n.

Page 90: Diederik Fokkema - Thesis

76 Chapter 3. Enhanced implementation of BiCGstab(`)

integer ldw

On entry, ldw specifies the length of work . ldw ≥ (3 +2(`+ 1))n. Unchanged on exit.

rwork

double precision array of size ldrw . Workspace for threevectors of size `+1 and two matrices of size (`+1)×(`+1).

integer ldrw

On entry, ldrw specifies the length of rwork . ldrw ≥(3 + 2(`+ 1))(`+ 1). Unchanged on exit.

iwork

integer array of size `+ 1. Workspace for one pivot arrayof size `+ 1

integer info

On exit, info defines the exit code.

info Description

< 0If info = −i, the ith argument had an ille-gal value.

0 The method was successful.

1The method did not meet the specified tol-erance within the specified number of ma-trix multiplications.

2 Breakdown; a division by zero occurred.

Note The implementation does not handle Lanczos and pivotbreakdowns.

The FORTRAN code

1 subroutine bistbl (l, n, x, b, mv, solve, tol,

$ mxmv, work, ldw, rwork, ldrw, iwork, info)

c

c subroutine bistbl v1.0 1995

5 c

c Copyright (c) 1995 by D.R. Fokkema.

c Permission to copy all or part of this work is granted,

c provided that the copies are not made or distributed

c for resale, and that the copyright notice and this

Page 91: Diederik Fokkema - Thesis

Section 3.4. Description of FORTRAN code 77

10 c notice are retained.

c

c THIS WORK IS PROVIDED ON AN "AS IS" BASIS. THE AUTHOR

c PROVIDES NO WARRANTY WHATSOEVER, EITHER EXPRESSED OR IMPLIED,

c REGARDING THE WORK, INCLUDING WARRANTIES WITH RESPECT TO ITS

15 c MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE.

c

implicit none

c

c .. Parameters ..

20 c

integer l, n, mxmv, ldw, ldrw, iwork(l+1), info

double precision x(n), b(n), tol

double precision work(n,3+2*(l+1)), rwork(l+1,3+2*(l+1))

c

25 c .. Matrix ..

c

external mv

external solve

c

30 c .. Local ..

c

logical rcmp, xpdt

integer i, j, k, nmv

double precision alpha, beta, omega, rho0, rho1, sigma

35 double precision varrho, hatgamma

double precision rnrm0, rnrm

double precision mxnrmx, mxnrmr, kappa0, kappal

c

c .. Work Aliases ..

40 c

integer z, zz, y0, yl, y

integer rr, r, u, xp, bp

c

c .. Constants ..

45 c

double precision zero, one, delta

parameter (zero = 0d0, one = 1d0, delta = 1d-2)

c

c .. BLAS and LAPACK ..

50 c

c subroutine daxpy

c subroutine dcopy

c subroutine dgemv

c subroutine dgetrf

Page 92: Diederik Fokkema - Thesis

78 Chapter 3. Enhanced implementation of BiCGstab(`)

55 c subroutine dgetrs

c subroutine dlacpy

c subroutine dlaset

c subroutine dsymv

c function ddot

60 c function dnrm2

c

double precision dnrm2, ddot

c

c .. Intrinsic ..

65 c

intrinsic abs, max, sqrt

c

c ===========================

c .. Executable Statements ..

70 c ===========================

c

info = 0

if (l.lt.1) info = -1

75 if (n.lt.1) info = -2

if (tol.le.zero) info = -7

if (mxmv.lt.0) info = -8

rr = 1

80 r = rr+1

u = r+(l+1)

xp = u+(l+1)

bp = xp+1

if (bp*n.gt.ldw) info = -10

85

z = 1

zz = z+(l+1)

y0 = zz+(l+1)

yl = y0+1

90 y = yl+1

if (y*(l+1).gt.ldrw) info = -12

if (info.ne.0) return

c

95 c --- Initialize first residual

c

call mv (n, x, work(1,r))

do i=1,n

work(i,r) = b(i) - work(i,r)

Page 93: Diederik Fokkema - Thesis

Section 3.4. Description of FORTRAN code 79

100 enddo

call solve (n, work(1,r))

c

c --- Initialize iteration loop

c

105 nmv = 0

call dcopy (n, work(1,r), 1, work(1,rr), 1)

call dcopy (n, work(1,r), 1, work(1,bp), 1)

call dcopy (n, x, 1, work(1,xp), 1)

110 call dlaset (’n’, n, 1, zero, zero, x, 1)

rnrm0 = dnrm2 (n, work(1,r), 1)

rnrm = rnrm0

mxnrmx = rnrm0

115 mxnrmr = rnrm0

rcmp = .false.

xpdt = .false.

alpha = zero

120 omega = one

sigma = one

rho0 = one

c

c --- Iterate

125 c

do while (rnrm.gt.tol*rnrm0 .and. nmv.lt.mxmv)

c

c =====================

c --- The BiCG part ---

130 c =====================

c

rho0 = -omega*rho0

do k=1,l

rho1 = ddot (n, work(1,rr), 1, work(1,r+k-1), 1)

135 if (rho0.eq.zero) then

info = 2

return

endif

beta = alpha*(rho1/rho0)

140 rho0 = rho1

do j=0,k-1

do i=1,n

work(i,u+j) = work(i,r+j) - beta*work(i,u+j)

enddo

Page 94: Diederik Fokkema - Thesis

80 Chapter 3. Enhanced implementation of BiCGstab(`)

145 enddo

call mv (n, work(1,u+k-1), work(1,u+k))

call solve (n, work(1,u+k))

nmv = nmv+1

sigma = ddot (n, work(1,rr), 1, work(1,u+k), 1)

150 if (sigma.eq.zero) then

info = 2

return

endif

alpha = rho1/sigma

155 call daxpy (n, alpha, work(1,u), 1, x, 1)

do j=0,k-1

call daxpy (n, (-alpha), work(1,u+j+1), 1,

$ work(1,r+j), 1)

enddo

160 call mv (n, work(1,r+k-1), work(1,r+k))

call solve (n, work(1,r+k))

nmv = nmv+1

rnrm = dnrm2 (n, work(1,r), 1)

mxnrmx = max (mxnrmx, rnrm)

165 mxnrmr = max (mxnrmr, rnrm)

enddo

c

c ==================================

c --- The convex polynomial part ---

170 c ==================================

c

c --- Z = R’R

c

do i=1,l+1

175 call dgemv (’t’, n, l+1-(i-1), one, work(1,r+i-1),

$ n, work(1,r+i-1), 1, zero, rwork(i,z+i-1), 1)

call dcopy (l-(i-1), rwork(i+1,z+i-1), 1,

$ rwork(i,z+i), l+1)

enddo

180 call dlacpy (’a’, l+1, l+1, rwork(1,z), l+1,

$ rwork(1,zz), l+1)

call dgetrf (l-1, l-1, rwork(2,zz+1), l+1,

$ iwork, info)

c

185 c --- tilde r0 and tilde rl (small vectors)

c

rwork(1,y0) = -one

call dcopy (l-1, rwork(2,z), 1, rwork(2,y0), 1)

call dgetrs (’n’, l-1, 1, rwork(2,zz+1), l+1, iwork,

Page 95: Diederik Fokkema - Thesis

Section 3.4. Description of FORTRAN code 81

190 $ rwork(2,y0), l+1, info)

rwork(l+1,y0) = zero

rwork(1,yl) = zero

call dcopy (l-1, rwork(2,z+l), 1, rwork(2,yl), 1)

195 call dgetrs (’n’, l-1, 1, rwork(2,zz+1), l+1, iwork,

$ rwork(2,yl), l+1, info)

rwork(l+1,yl) = -one

c

c --- Convex combination

200 c

call dsymv (’u’, l+1, one, rwork(1,z), l+1,

$ rwork(1,y0), 1, zero, rwork(1,y), 1)

kappa0 = sqrt(ddot (l+1, rwork(1,y0), 1,

$ rwork(1,y), 1))

205

call dsymv (’u’, l+1, one, rwork(1,z), l+1,

$ rwork(1,yl), 1, zero, rwork(1,y), 1)

kappal = sqrt(ddot (l+1, rwork(1,yl), 1,

$ rwork(1,y), 1))

210

call dsymv (’u’, l+1, one, rwork(1,z), l+1,

$ rwork(1,y0), 1, zero, rwork(1,y), 1)

varrho =

$ ddot (l+1, rwork(1,yl), 1, rwork(1,y), 1)

215 $ / (kappa0*kappal)

hatgamma =

$ varrho/abs(varrho)*max(abs(varrho),7d-1)

$ * (kappa0/kappal)

220

call daxpy (l+1, (-hatgamma), rwork(1,yl), 1,

$ rwork(1,y0), 1)

c

c --- Update

225 c

omega = rwork(l+1,y0)

call dgemv (’n’, n, l, (-one), work(1,u+1), n,

$ rwork(2,y0), 1, one, work(1,u), 1)

230 call dgemv (’n’, n, l, one, work(1,r), n,

$ rwork(2,y0), 1, one, x, 1)

call dgemv (’n’, n, l, (-one), work(1,r+1), n,

$ rwork(2,y0), 1, one, work(1,r), 1)

Page 96: Diederik Fokkema - Thesis

82 Chapter 3. Enhanced implementation of BiCGstab(`)

235 call dsymv (’u’, l+1, one, rwork(1,z), l+1,

$ rwork(1,y0), 1, zero, rwork(1,y), 1)

rnrm = sqrt (ddot (l+1, rwork(1,y0), 1,

$ rwork(1,y), 1))

c

240 c ================================

c --- The reliable update part ---

c ================================

c

mxnrmx = max (mxnrmx, rnrm)

245 mxnrmr = max (mxnrmr, rnrm)

xpdt = (rnrm.lt.delta*rnrm0.and.rnrm0.lt.mxnrmx)

rcmp = ((rnrm.lt.delta*mxnrmr.and.rnrm0.lt.mxnrmr)

$ .or.xpdt)

if (rcmp) then

250 call mv (n, x, work(1,r))

call solve (n, work(1,r))

do i=1,n

work(i,r) = work(i,bp) - work(i,r)

enddo

255 mxnrmr = rnrm

if (xpdt) then

call daxpy (n, one, x, 1, work(1,xp), 1)

call dlaset (’n’, n, 1, zero, zero, x, 1)

call dcopy (n, work(1,r), 1, work(1,bp), 1)

260 mxnrmx = rnrm

endif

endif

enddo

c

265 c =========================

c --- End of iterations ---

c =========================

c

call daxpy (n, one, work(1,xp), 1, x, 1)

270 c

c --- Check stopping criterion

c

call mv (n, x, work(1,r))

do i=1,n

275 work(i,r) = b(i) - work(i,r)

enddo

call solve (n, work(1,r))

rnrm = dnrm2 (n, work(1,r), 1)

if (rnrm.gt.tol*rnrm0) info = 1

Page 97: Diederik Fokkema - Thesis

Section 3.5. Numerical experiments 83

280 c

c --- Return

c

tol = rnrm/rnrm0

mxmv = nmv

285

return

end

3.5. Numerical experiments. In this section we compare the perfor-mance of the unmodified BiCGstab(`) version (Alg. 3.1) and the enhancedversion (Alg. 3.3). We consider two of the linear problems that are also usedin [91, 88]. In both cases no preconditioning is used. The computations wheredone in double precision (≈ 15 digits) on a Sun workstation.

3.5.1. Example 1. With this example we show that taking a convexcombination of the MR polynomial and the OR polynomial may indeed curestagnation.

The linear systems stems from a 65×65 finite volume discretization on theunit square of the partial differential equation

−∆u+ 100(xux + yuy)− 200u = f,

where f is such that u(x, y) ≡ 1 is the solution.In Fig. 3.5.1 and 3.5.1 we have plotted the number of matrix multiplica-

tions versus the log10 of the true residual norm for the unmodified and forthe enhanced version of BiCGstab(`) for ` = 1, 2, 4, 8, respectively. Fig. 3.5.1and 3.5.1 display plots for the number of flops versus the true residual norm.The maximum number of matrix multiplications was set to 300.

From these figures we see that the unmodified version of BiCGstab(1) stag-nates, whereas the enhanced version does converge. Apparently, taking theconvex combination of the MR polynomial and the OR polynomial of degree 1cures the stagnation. For larger values of ` the unmodified version convergesincreasingly better, but still they converge not as fast as their enhanced coun-terparts.

In number of matrix multiplications, the enhanced version converges com-parable for all considered values of `. Looking at the number of flops we seethat the enhanced BiCGstab(1) algorithm is the most efficient.

3.5.2. Example 2. With this example we show that taking the convexcombination does not always cure stagnation. In this case increasing the valueof ` helps. Moreover, the reliable update strategy in the enhanced versionresults in a more accurate solution.

Page 98: Diederik Fokkema - Thesis

84 Chapter 3. Enhanced implementation of BiCGstab(`)

-15

-10

-5

0

0 50 100 150 200 250 300

number of matrix multiplications

l=1l=2l=4l=8

Fig. 3.1. Number of MVs ver-sus log10 of the true residual norm forBiCGstab(`) for example 1.

-15

-10

-5

0

0 50 100 150 200 250 300

number of matrix multiplications

l=1l=2l=4l=8

Fig. 3.2. Number of MVs ver-sus log10 of the true residual norm forEnhanced BiCGstab(`) for example 1.

-15

-10

-5

0

0.0e+00 5.0e+03 1.0e+04 1.5e+04 2.0e+04

number of flops (x 1e6)

l=1l=2l=4l=8

Fig. 3.3. Number of flops ver-sus log10 of the true residual norm forEnhanced BiCGstab(`) for example 1.

-15

-10

-5

0

0.0e+00 5.0e+03 1.0e+04 1.5e+04 2.0e+04

number of flops (x 1e6)

l=1l=2l=4l=8

Fig. 3.4. Number of flops ver-sus log10 of the true residual norm forEnhanced BiCGstab(`) for example 1.

The linear systems stems from a 65×65 finite volume discretization on theunit square of the partial differential equation

−∆u+ 1000(xux + yuy) + 10u = f,

where f is such that u(x, y) ≡ 1 is the solution.In Fig. 3.5.2 and 3.5.2 we have plotted the number of matrix multiplica-

Page 99: Diederik Fokkema - Thesis

Section 3.6. Conclusions 85

-15

-10

-5

0

0 250 500 750 1000

number of matrix multiplications

l=1l=2l=4l=8

Fig. 3.5. Number of MVs ver-sus log10 of the true residual norm forBiCGstab(`) for example 2.

-15

-10

-5

0

0 250 500 750 1000

number of matrix multiplications

l=1l=2l=4l=8

Fig. 3.6. Number of MVs ver-sus log10 of the true residual norm forEnhanced BiCGstab(`) for example 2.

tions versus the log10 of the true residual norm for the unmodified and forthe enhanced version of BiCGstab(`) for ` = 1, 2, 4, 8, respectively. Fig. 3.5.2and 3.5.2 display plots for the number of flops versus the log10 of the trueresidual norm. The maximum number of matrix multiplications was set to1000.

From these figures we see that taking the convex combination of the MRpolynomial and the OR polynomial of degree 1 does not cure the stagnationand leads to divergence. Increasing ` however, results in increasingly betterconvergence (in terms of MVs) for the unmodified version. The convergencefor the enhanced version is for ` = 2, 4, 8 comparable. Apparently, the BiCGiteration coefficients of the enhanced version are already accurate for ` = 2and increasing ` does not lead to better convergence. Notice that with thereliable update strategy we obtain almost full precision.

3.6. Conclusions. We have presented an enhanced FORTRAN imple-mentation of the BiCGstab(`) algorithm. The enhancements consist of twoparts: (1) the accuracy of the BiCG iteration coefficients (and thereby theconvergence behavior) is improved by taking a suitable combination of mini-mal residual (MR-) and orthogonal (OR-) polynomials in the polynomial partof the BiCGstab(`) algorithm, and (2) the accuracy of the approximate solu-tion is improved by incorporating a “reliable update” strategy. The additionalcomputational costs involved are small and easily compensated for by the muchbetter overall performance.

Taking a suitable convex combination of MR- and OR-polynomials may

Page 100: Diederik Fokkema - Thesis

86 Chapter 3. Enhanced implementation of BiCGstab(`)

-15

-10

-5

0

0.0e+00 2.5e+04 5.0e+04 7.5e+04 1.0e+05

number of flops (x 1e6)

l=1l=2l=4l=8

Fig. 3.7. Number of flops ver-sus log10 of the true residual norm forEnhanced BiCGstab(`) for example 2.

-15

-10

-5

0

0.0e+00 2.5e+04 5.0e+04 7.5e+04 1.0e+05

number of flops (x 1e6)

l=1l=2l=4l=8

Fig. 3.8. Number of flops ver-sus log10 of the true residual norm forEnhanced BiCGstab(`) for example 2.

cure stagnation (as is sometimes observed for BiCGstab(1), for instance). Itmay also lead to divergence, but then increasing the value of ` usually helps.

The reliable update strategy occasionally replaces the recursively computedresidual by the the true residual at strategic chosen points, thereby improv-ing the accuracy of the approximate solution without affecting the speed ofconvergence. A stopping criterion that involves the residual is therefore muchmore reliable.

Page 101: Diederik Fokkema - Thesis

Chapter 4

GENERALIZED CONJUGATE GRADIENT SQUARED

DIEDERIK R. FOKKEMA , GERARD L. G. SLEIJPEN , AND

HENK A. VAN DER VORST

Abstract. The Conjugate Gradient Squared (CGS) is an iterative method for solv-ing nonsymmetric linear systems of equations. However, during the iteration large residualnorms may appear, which may lead to inaccurate approximate solutions or may even de-teriorate the convergence rate. Instead of squaring the Bi-CG polynomial as in CGS, wepropose to consider products of two nearby Bi-CG polynomials which leads to generalizedCGS methods, of which CGS is just a particular case. This approach allows the constructionof methods that converge less irregular than CGS and that improve on other convergenceproperties as well. Here, we are interested in a property that got less attention in literature:we concentrate on retaining the excellent approximation qualities of CGS with respect tocomponents of the solution in the direction of eigenvectors associated with extreme eigenval-ues. This property seems to be important in connection with Newton’s scheme for nonlinearequations: our numerical experiments show that the number of Newton steps may decreasesignificantly when using a generalized CGS method as linear solver for the Newton correctionequations.

Key words. Nonsymmetric linear systems, Krylov subspace, Iterative solvers, Bi-CG,CGS, BiCGstab(`), Nonlinear systems, Newton’s method

AMS subject classifications. 65F10

4.1. Introduction. There is no best iterative method for solving linearsystems of equations [67]. However, in many applications a particular methodis preferred. CGS [93] is a frequently used method, but the popularity of CGShas diminished over time, because of its irregular convergence behavior. Nev-ertheless, in some situations, for instance, when in combination with Newton’smethod for nonlinear equations in the context of device simulations, CGS isoften still the method of choice∗.

The observation is that a Newton scheme in combination with CGS usu-

∗Personal communication by W. Schilders and M. Driessen, Philips Research Labora-tories. They have also observed that for their semiconductor device modeling, where thesystem is often expressed in terms of voltages, the conservation of currents is better main-tained when working with CGS.

Page 102: Diederik Fokkema - Thesis

88 Chapter 4. Generalized conjugate gradient squared

ally solves the nonlinear problem in less Newton steps than a Newton schemein combination with other iterative methods. And although other methods,e.g., Bi-CGSTAB [102], sometimes need less iteration steps to solve the linearequations involved, Newton in combination with CGS turns out to be moreefficient (see also our examples in Section 4.7).

For other situations where CGS or CGS-type of methods, for exampleTFQMR [39], are preferred, see [60, pp. 128–133], [14].

However, the large intermediate residuals produced by CGS badly affectits speed of convergence and limit its attainable accuracy [92], and this in turnhas a (very) negative effect on the convergence of the overall Newton process.

In this paper we discuss variants of CGS that have improved convergenceproperties, while still having the important “quadratic reduction” propertydiscussed below.

We will now try to explain why CGS may be so successful as a linear solverin a Newton scheme. In our heuristic arguments the eigensystem, the eigen-values λj , and the eigenvectors vj , of the local Jacobian matrices (the matricesof partial derivatives of the nonlinear problem, evaluated at the approxima-tion) play a role. We consider the components of the approximate solutionsand residuals in the direction of these eigenvectors, distinguishing betweencomponents associated with exterior eigenvalues (“exterior components”) andcomponents associated with interior eigenvalues (“interior components”). By“exterior” and “interior” we refer to the position of the eigenvalue in the convexhull of the spectrum of the Jacobian matrix.

CGS (cf. Section 4.2) is based on Bi-CG [36, 57]. This linear solver tends toapproximate the exterior components of the solution better and faster than theinterior components [53, 77]. Any residual of a linear solver that we considercan be represented by a polynomial in the matrix representing the linear system(for instance, the Bi-CG residual can be written as rBi-CG

k = φk(A)r0, whereφk is a polynomial of degree k) and the size of the eigenvector components ofthe residual is proportional to the (absolute) value of the polynomial in theassociated eigenvalue (for instance for Bi-CG rBi-CG

k =∑n

j=1 φk(λj)vj).The absolute value of Bi-CG polynomials tends to be smaller in the ex-

terior eigenvalues than in the interior ones. A small component φk(λj)vj

of the residual rk means that the corresponding component of the solutionxk is well approximated. CGS polynomials are the squares of Bi-CG poly-nomials: the residual of CGS can be written as rCGS

k = φ2k(A)r0. There-

fore, CGS approximations tend to have very accurate exterior components.A polynomial associated with, for instance, the BiCGstab methods is theproduct of a Bi-CG polynomial and another polynomial of the same degree(rBiCGstab

k = φk(A)φk(A)r0). This other polynomial (a product of locally min-imizing degree 1 polynomials for Bi-CGSTAB (φk(t) =

∏ki=1(1 − ωit)) and a

product of such polynomials of degree ` for BiCGstab(`) [85]) does not have

Page 103: Diederik Fokkema - Thesis

Section 4.1. Introduction 89

this strong tendency of reducing in exterior eigenvalues better than in theinterior ones. Therefore, comparing approximations with residuals of compa-rable size (2-norm), we may expect that approximate solutions as producedby a BiCGstab method have exterior components that are less accurate thanthose of the CGS approximations, since the error components are larger. Ofcourse, with respect to interior components, the situation will be in favor ofthe BiCGstab methods.

Now, we come to the implication for Newton’s method. The nonlinearityof the problem seems often stronger in the (linear combination of) exteriorcomponents than in the (linear combination of) interior ones. This observa-tion explains the nice convergence properties in the outer iteration when CGSis used in the inner iteration of Newton’s process. CGS tends to deliver ap-proximate solutions of which the exterior components are very accurate. Withrespect to these components, the Newton process, in which the linear systemsare solved approximately by CGS, compares to a Newton process in which thelinear systems are solved exactly, while this may not be true for the Newtonprocess in combination with the BiCGstab methods (or others).

In summary, we wish to retain in our modifications the attractive propertyof CGS that it converges faster with respect to exterior components within aNewton method, without losing its efficiency, the fact that it is transpose free,and its fast convergence. However, we wish to avoid irregular convergenceand large intermediate residuals, since they may badly affect the speed ofconvergence of the inner iteration.

Techniques as proposed in, e.g., [111, 68, 91] smooth down the convergenceby operating a posteriori on approximates and residuals. Although they maylead to more accurate approximates (see the “additional note” in Section 4.7or [91]), they do not change the speed of convergence. For a detailed discussion,see [91].

The polynomial associated with our new methods is the product of the Bi-CG polynomial with another “nearby” polynomial of the same degree (cf. Sec-tion 4.4). We refer to these methods as generalized CGS methods. They areabout as efficient as CGS per iteration step (cf. Section 4.4). We pay spe-cial attention to the case where this second polynomial is a Bi-CG polynomial(cf. Section 4.6.1) of another (nearby) Bi-CG process, or a polynomial closelyrelated to such a Bi-CG polynomial (cf. Section 4.6.2). The difference betweenthe square of a Bi-CG polynomial and the product of two “nearby” Bi-CGpolynomials of the same degree may seem insignificant, but, as we will seein our numerical examples in Section 4.7, this approach may lead to fasterconvergence in norm as well as to more accurate results. Moreover, this ap-proach seems to improve the convergence of (exterior components in) nonlinearschemes. A discussion on the disadvantages of squaring the Bi-CG polynomialcan be found in Section 4.3. Since we are working with products of Bi-CG

Page 104: Diederik Fokkema - Thesis

90 Chapter 4. Generalized conjugate gradient squared

polynomials, the new methods reduce exterior components comparable fast asCGS (cf. Section 4.6.1). It is obvious that Bi-CG and the ideas behind CGSare essential in deriving the new methods and therefore Bi-CG and CGS arediscussed in Section 4.2. In that section we also introduce most of our notation.

4.2. Bi-CG and CGS. The Bi-CG method [36, 57] is an iterative solu-tion scheme for linear systems

Ax = b,

in which A is some given nonsingular n×n matrix and b some given n-vector.Typically n is large and A is sparse. For ease of presentation, we assume Aand b to be real.

Starting with an initial guess x0, each iteration of Bi-CG computes anapproximation xk to the solution. It is well known that the Bi-CG residualrk = b − Axk can be written as φk(A)r0 where φk is a certain polynomial inthe space P1

k of all polynomials ψ of degree k for which ψ(0) = 1. The Bi-CGpolynomial φk is implicitly defined by the Bi-CG algorithm through a coupledtwo-term recurrence:

uk = rk − βkuk−1,

rk+1 = rk − αkAuk.

The iteration coefficients αk and βk follow from the requirement that rk andAuk are orthogonal to the Krylov subspace Kk(AT ; r0) of order k, generatedby AT and an arbitrary, but fixed r0.

If (φk) is some sequence of polynomials of degree k with a nontrivial leadingcoefficient θk then (see [93] or [85]):

(4.1) βk =θk−1

θk

ρk

σk−1and αk =

ρk

σk,

where

(4.2) ρk = (rk, φk(AT )r0) and σk = (Auk, φk(AT )r0).

In standard Bi-CG the polynomial φk is taken to be the same as the Bi-CGpolynomial: φk = φk, where φk is such that rk = φk(A)r0. This leads toanother coupled two-term recurrence in the Bi-CG algorithm:

uk = rk − βkuk−1,

rk+1 = rk − αkAT uk.

Since A and b are assumed to be real, this means that rk and AT uk are orthog-onal to the Krylov subspace Kk(A; r0), in particular the sequences (rk) and

Page 105: Diederik Fokkema - Thesis

Section 4.3. Disadvantages of squaring the iteration polynomial 91

(rk) are bi-orthogonal. Of course, other choices for φk are possible. For in-stance, when A and b are complex and if we still want to have bi-orthogonality,then we should choose φk = φk.

The leading coefficient of φk is (−αk−1)(−αk−2) · · · (−α0) and therefore wehave that

θk−1

θk=−1αk−1

and thusβk =

−1αk−1

ρk

σk−1and αk =

ρk

σk.

A pseudo-code for the standard Bi-CG algorithm is given in Alg. 4.1.It was Sonneveld [93] who suggested to rewrite the inner products so as to

avoid the operations with AT , e.g.,

(4.3) ρk = (rk, φk(AT )r0) = (φk(A)rk, r0),

and to take advantage of both φk and φk for the reduction of the residual bygenerating recurrences for the vectors rk = φk(A)rk. In fact, he suggested totake φk = φk, which led to the CGS method: rk = φ 2

k (A)r0. The correspond-ing search directions uk for the corresponding approximation xk can be easilyconstructed. In this approach the Bi-CG residuals rk and search directions uk

themselves are not computed explicitly, nor are they needed in the process.See Alg. 4.2 for CGS.

As is explained in [102], φk(A) may not be a particularly well suited reduc-tion operator for φk(A)r0. But, as we will see in Section 4.3, there are morearguments for not selecting φk = φk. For instance, we wish to avoid irregu-lar convergence and large intermediate residuals. In [102] it was suggested tochoose φk as a product of linear factors, which were constructed to minimizeresiduals in only one direction at a time. This led to the Bi-CGSTAB algo-rithm. This was further generalized to a composite of higher degree factorswhich minimize residuals over `-dimensional subspaces: BiCGStab2, for ` = 2,in [49], and BiCGstab(`), the more efficient and more stable variant also forgeneral `, in [85, 92] (see also [88]).

Obviously, there is a variety of possibilities for the polynomials φk. In thenext sections we investigate polynomials that are similar to the Bi-CG polyno-mial, i.e., polynomials that are defined by a coupled two-term recurrence. Thisleads to a generalized CGS (GCGS) algorithm, of which CGS and Bi-CGSTABare just particular instances.

4.3. Disadvantages of squaring the iteration polynomial. For aneigenvalue λ of A, the component of the CGS residual, in the direction of theeigenvector associated with λ, is equal to νλφk(λ)2, where νλ is the component

Page 106: Diederik Fokkema - Thesis

92 Chapter 4. Generalized conjugate gradient squared

Choose an initial guess x0 andsome r0

r0 = b−Ax0

u−1 = u−1 = 0, α−1 = σ−1 = 1for k = 0, 1, 2, . . . do

ρk = (rk, rk)βk = (−1/αk−1)(ρk/σk−1)uk = rk − βkuk−1

uk = rk − βkuk−1

c = Auk

σk = (c, rk)αk = ρk/σk

xk+1 = xk + αkuk

if xk+1 is accurate enough,then quit

rk+1 = rk − αkcrk+1 = rk − αkA

T uk

end

Alg. 4.1. Bi-CG

Choose an initial guess x0 andsome r0

r0 = b−Ax0

u−1 = w−1 = 0, α−1 = σ−1 = 1for k = 0, 1, 2, . . . do

ρk = (rk, r0)βk = (−1/αk−1)(ρk/σk−1)vk = rk − βkuk−1

wk = vk − βk(uk−1 − βkwk−1)c = Awk

σk = (c, r0)αk = ρk/σk

uk = vk − αkcxk+1 = xk + αk(vk + uk)if xk+1 is accurate enough,

then quitrk+1 = rk − αkA(vk + uk)

end

Alg. 4.2. CGS

of r0 in the direction of the same eigenvector (assuming λ is a semi-simpleeigenvalue). The corresponding component of the Bi-CG residual is preciselyνλφk(λ) and the tendency of |φk(λ)| to be small for non-large k and for exteriorλ explains the good reduction abilities of CGS with respect to the exteriorcomponents.

Unfortunately, squaring has disadvantages: |φk(λ)|2 may be large even if|νλφk(λ)| is moderate. This may happen especially during the initial stage ofthe process (when k is small) and the CGS component will be extremely large.In such a case, the CGS residual rk is extremely large. Although the nextresidual rk+1 may be moderate, a single large residual is enough to preventthe process of finding an accurate final approximate solution in finite precisionarithmetic: in [92], Section 2.2 (see also [88]), it was shown that∣∣‖rm‖2 − ‖b−Axm‖2

∣∣ ≤ ξ Γ maxk≤m‖rk‖2,

with Γ := mnA ‖A−1‖2 ‖ |A| ‖2,(4.4)

where ξ is the relative machine precision and nA is the maximum number ofnonzero entries per row of A. Except for the constant Γ this estimate seemsto be sharp in practice: in actual computations we do not see the factor Γ

Page 107: Diederik Fokkema - Thesis

Section 4.4. Generalized CGS: methods of CGS type 93

(see [88]). Moreover the local bi-orthogonality, essential for Bi-CG and (im-plicitly) for CGS, will seriously be disturbed†. This will slow down the speedof convergence. CGS is notorious for large intermediate residuals and irregularconvergence behavior. The fact that |φk(λ)|2 can be large was precisely thereason in [102] to reject the choice φk = φk and to consider a product of degree1 factors that locally minimize the residual with respect to the norm ‖ · ‖2.As anticipated, this approach usually improves the attainable accuracy, (i.e.,the distance between ‖rm‖2 and ‖b − Axm‖2; cf. (4.4)) as well as the rate ofconvergence. However, the degree 1 factors do not tend to favor the reductionof the exterior components as we wish here.

In summary, we wish to avoid “quadratically large” residual components,while retaining “quadratically small” components.

Of course the selected polynomials φk should also lead to an efficient al-gorithm. Before specifying polynomials φk in the Sections 4.5 and 4.6, weaddress this efficiency subject in Section 4.4.

4.4. Generalized CGS: methods of CGS type. In this section wederive an algorithm that delivers rk = φk(A)φk(A)r0, where φk is a polyno-mial defined by a coupled two-term recurrence and where φk is the Bi-CGpolynomial.

Consider the Bi-CG recurrence for the search directions uk and the residualsrk+1

u−1 ≡ 0, r0 ≡ b−Ax0,(4.5)uk = rk − βkuk−1,(4.6)

rk+1 = rk − αkAuk,(4.7)

and the polynomial recurrence for the polynomials φk+1 and ψk evaluated in A

ψ−1(A) ≡ 0, φ0(A) ≡ I,(4.8)

ψk(A) = φk(A)− βkψk−1(A),(4.9)

φk+1(A) = φk(A)− αkAψk(A),(4.10)

for scalar sequences (αk) and (βk). For ease of notation we will write Φk

for φk(A) and Ψk for ψk(A) from now on. Our goal is to compute rk+1 =Φk+1rk+1. We will concentrate on the vector updates first, i.e., for the momentwe will assume that the iteration coefficients αk and βk are explicitly given.

Suppose we have the following vectors at step k:

(4.11) Ψk−1uk−1, Ψk−1rk, Φkuk−1 and Φkrk.

†The Neumaier trick (cf. the “additional note” in Section 4.7) cures the loss of accuracy,but it does not improve the speed of convergence [91].

Page 108: Diederik Fokkema - Thesis

94 Chapter 4. Generalized conjugate gradient squared

Note that for k = 0 these vectors are well defined. We proceed by showinghow the index of vectors in (4.11) can be increased.

We use the Bi-CG recurrence (4.6) to update Φkuk:

Φkuk = Φkrk − βkΦkuk−1.

Before we can update Ψkuk a similar way, i.e.,

(4.12) Ψkuk = Ψkrk − βkΨkuk−1,

we need the vectors Ψkrk and Ψkuk−1. These vectors follow from (4.9):

Ψkrk = Φkrk − βkΨk−1rk,(4.13)

Ψkuk−1 = Φkuk−1 − βkΨk−1uk−1.(4.14)

This in combination with (4.12) gives us Ψkuk. The vectors Ψkrk+1 andΦk+1uk follow from (4.7) and (4.10):

Ψkrk+1 = Ψkrk − αkAΨkuk,

Φk+1uk = Φkuk − αkAΨkuk.

Finally, to obtain Φk+1rk+1 we apply the recurrences (4.7) and (4.10):

Φkrk+1 = Φkrk − αkAΦkuk,(4.15)Φk+1rk+1 = Φkrk+1 − αkAΨkrk+1.(4.16)

When αk and αk are known before updating (4.15) and (4.16), we can avoidone of the matrix-vector products by combining these equations. This leads to

Φk+1rk+1 = Φkrk −A(αkΦkuk − αkΨkrk+1),

and, hence, we only need AΨkuk and A(αkΦkuk− αkΨkrk+1) in order to com-plete one iteration step, and the corresponding computational scheme needstwo matrix-vector multiplications per iteration step, just as CGS.

The iteration coefficients αk and βk have to be computed such that rk andAuk are orthogonal to the Krylov subspace Kk(AT ; r0). According to (4.1)and (4.2), these coefficients are determined by θk−1/θk, ρk and σk. From (4.10)it follows that the leading coefficient of φk is given by (−αk−1)(−αk−2) · ·(−α0)and hence

θk−1

θk=−1αk−1

.

For the scalar ρk we can rewrite the inner product (cf. (4.3)):

ρk = (Φkrk, r0).

Page 109: Diederik Fokkema - Thesis

Section 4.5. Well known methods of CGS type 95

Note that the vector Φkrk is available. However, for the scalar σk rewritingthe inner product does not help because AΦkuk is no longer available, sincewe have combined (4.15) and (4.16). Fortunately, we can replace AΦkuk bythe vector AΨkuk, which is available. It follows from (4.9) that the degree ofψk − φk is smaller than k and thus that

(A(Φk −Ψk)uk, r0) = (Auk, (φk(AT )− ψk(AT ))r0) = 0.

Therefore, we have thatσk = (AΨkuk, r0).

The algorithm for this generalized CGS (GCGS) method is given Alg. 4.3.In this algorithm, the following substitutions have been made:

uk−1 = Φkuk−1, vk = Φkuk, wk = Ψkuk,

rk = Φkrk, sk = Ψkrk+1, and tk = Ψkrk,

and the equations (4.12) and (4.14) are combined to one single equation.The algorithm is very similar to Alg. 4.2. In terms of computational work

per iteration step (per 2 matrix-vector multiplications) GCGS needs only twomore vector updates than CGS; moreover, GCGS needs only storage for twomore vectors.

In Sections 4.5 and 4.6 we will discuss some possible choices for the recur-rence coefficients of the polynomials φk. Section 4.5 contains the well knownCGS and Bi-CGSTAB method. The new methods can be found in Section 4.6.

4.5. Well known methods of CGS type. We present here the CGSand the Bi-CGSTAB method to show that they fit in the frame of generalizedCGS methods and to facilitate comparison of efficiencies.

4.5.1. CGS: using the Bi-CG polynomials. The choice αk = αk,βk = βk leads to CGS. In Alg. 4.3 the vectors vk and tk as well as thevectors uk and sk are identical in this situation and some computational stepsare now redundant.

4.5.2. Bi-CGSTAB: using products of optimal first degree fac-tors. As explained in Section 4.3, to avoid irregular convergence and largeintermediate residuals, a product of degree 1 factors that locally minimize theresidual is suggested in [102].

In our formulation Bi-CGSTAB can be obtained as follows. Take βk = 0,so that the recurrences (4.12)-(4.16) reduce to

Φkuk = Φkrk − βkΦkuk−1,(4.17)Φkrk+1 = Φkrk − αkAΦkuk,(4.18)Φk+1uk = Φkuk − αkAΦkuk,(4.19)

Φk+1rk+1 = Φkrk+1 − αkAΦkrk+1,(4.20)

Page 110: Diederik Fokkema - Thesis

96 Chapter 4. Generalized conjugate gradient squared

Choose an initial guess x0 and some r0r0 = b−Ax0

u−1 = w−1 = s−1 = 0,α−1 = σ−1 = α−1 = σ−1 = 1for k = 0, 1, 2, . . . do

ρk = (rk, r0)βk = (−1/αk−1)(ρk/σk−1)vk = rk − βkuk−1

choose βk

tk = rk − βksk−1

wk = tk − βk(uk−1 − βkwk−1)c = Awk

σk = (c, r0)αk = ρk/σk

sk = tk − αkcchoose αk

uk = vk − αkcxk+1 = xk + αkvk + αksk

if xk+1 is accurate enough, then quitrk+1 = rk −A(αkvk + αksk)

end

Alg. 4.3. GCGS

and take αk such that ‖Φkrk+1 − αkAΦkrk+1‖2 is minimal. Hence,

αk =(Φkrk+1, AΦkrk+1)

(AΦkrk+1, AΦkrk+1).

For efficiency reasons one usually combines (4.17) and (4.19). Notice that φk

is now a product of the linear factors (1− αk t).A pseudo-code for Bi-CGSTAB is given in Alg. 4.4.

4.6. New methods of CGS type. The BiCGstab methods generallyconverge more smoothly than CGS, but they do not approximate the exte-rior components of the solution as well as CGS. We wish to preserve thisapproximation property, while smoothing the convergence at the same time‡.

‡As explained in Section 4.3, we want smooth convergence by avoiding a priori extremelylarge components. The smoothing techniques in, e.g., [111], work a posteriori and do notaffect the rate of convergence nor the attainable accuracy.

Page 111: Diederik Fokkema - Thesis

Section 4.6. New methods of CGS type 97

Choose an initial guess x0 and some r0r0 = b−Ax0

u−1 = w−1 = s−1 = 0,α−1 = σ−1 = α−1 = σ−1 = 1for k = 0, 1, 2, . . . do

ρk = (rk, r0)βk = (−1/αk−1)(ρk/σk−1)wk = rk − βk(wk−1 − αkck−1)ck = Awk

σk = (ck, r0)αk = ρk/σk

sk = rk − αkck

tk = Ask

αk = (sk, tk)/(tk, tk)xk+1 = xk + αkwk + αksk

if xk+1 is accurate enough, then quitrk+1 = sk − αktk

end

Alg. 4.4. Bi-CGSTAB

4.6.1. CGS2: using related Bi-CG polynomials. We will argue thata related Bi-CG polynomial will meet our conditions to a certain extent: inthis subsection, φk is the Bi-CG polynomial generated by r0 and s0, somevector different from r0. For s0 one may take, for instance, a random, butfixed vector. The roots of the Bi-CG polynomial φk converge (for increasingk) towards eigenvalues corresponding to eigenvectors with nonzero weights νλ.The roots of this φk will converge to the same eigenvalues, but, and this isimportant, in a different manner. If both φk and φk reduce a component of r0poorly, as may be the case initially, then both corresponding roots have notyet converged to the corresponding eigenvalue. In other words, both φk(λ)and φk(λ) are significantly different from zero. But, since both polynomialsare distinct, the product |φk(λ)φk(λ)| is smaller than max(|φk(λ)|2, |φk(λ)|2)and one may hope that applying φk(A)φk(A) as a reduction operator to r0will not lead to as bad an amplification of this component as φk(A)2 (CGS). Ifboth φk and φk reduce a component of r0 well, as may be the case later in theiteration process, then both corresponding roots have converged to the samecorresponding eigenvalue. In this case we have a quadratic reduction of thatcomponent.

We give more details for the resulting scheme. The scheme is very efficient:

Page 112: Diederik Fokkema - Thesis

98 Chapter 4. Generalized conjugate gradient squared

although we work (implicitly) with two different Bi-CG processes the iterationsteps do not require matrix-vector multiplications in addition to the ones inthe GCGS scheme (Alg. 4.3). As before, we write φk(A) as Φk (and ψk(A)as Ψk).

As with the Bi-CG polynomial φk (see Section 4.2), we seek coefficientsαk and βk such that Φkr0 and AΨkr0 are orthogonal to the Krylov subspaceKk(AT ; s0). According to (4.1) and (4.2) we may write

βk =θk−1

θk

ρk

σk−1and αk =

ρk

σk,

where

(4.21) ρk = (Φkr0, χk(AT )s0) and σk = (AΨkr0, χk(AT )s0)

and θk is the leading coefficient of some polynomial χk of degree k and χk(0) =1. Normally, like in Bi-CG, practically any choice for χk would lead to an-other two-term recurrence in order to construct a basis for Kk(AT ; s0). Thatwould make the algorithm expensive, especially since matrix multiplicationsare involved. Surprisingly, we can avoid this construction, and thus the compu-tational work, because we can use the Bi-CG polynomial φk, which is already(implicitly) available. Replacing χk by φk in (4.21) gives us for the iterationcoefficients that

βk =−1αk−1

ρk

σk−1and αk =

ρk

σk,

where

ρk = (Φkr0, φk(AT )s0) = (Φkφk(A)r0, s0) = (rk, s0), and

σk = (AΨkr0, φk(AT )s0) = (AΨkφk(A)r0, s0) = (Avk, s0).

Here we used the fact that multiplication with polynomials in A is commuta-tive:

φk(A) φk(A)r0 = φk(A)φk(A)r0 = Φkrk, and

φk(A) ψk(A)r0 = ψk(A)φk(A)r0 = Ψkrk.

A pseudo-code for this computational scheme, which we will call CGS2, is givenin Alg. 4.5. Compared with CGS, CGS2 needs two more vector updates andtwo more inner products per iteration and storage for three additional vectors.

4.6.2. Shifted CGS: using delayed Bi-CG polynomials. We wish toavoid extremely large factors |φk(λ)φk(λ)| . Such factors may occur if φkφk

has a (nearly) double root corresponding to an eigenvector component that

Page 113: Diederik Fokkema - Thesis

Section 4.6. New methods of CGS type 99

Choose an initial guess x0, some r0 and some s0r0 = b−Ax0

u−1 = w−1 = s−1 = 0,α−1 = σ−1 = α−1 = σ−1 = 1for k = 0, 1, 2, . . . do

ρk = (rk, r0)βk = (−1/αk−1)(ρk/σk−1)vk = rk − βkuk−1

ρk = (rk, s0)βk = (−1/αk−1)(ρk/σk−1)tk = rk − βksk−1

wk = tk − βk(uk−1 − βkwk−1)c = Awk

σk = (c, r0)αk = ρk/σk

sk = tk − αkcσk = (c, s0)αk = ρk/σk

uk = vk − αkcxk+1 = xk + αkvk + αksk

if xk+1 is accurate enough, then quitrk+1 = rk −A(αkvk + αksk)

end

Alg. 4.5. CGS2

has not converged (yet). The choice of φk in the preceding section does notexclude this possibility. In our approach below, we explicitly try to avoid theseunwanted double roots associated with eigenvector components that have notconverged yet. As before, we still want to have near double roots correspondingto converged components.

It is well known that for A = AT the roots of the Bi-CG polynomial φk−1

separate those of φk and a product of these two polynomials seems to be agood candidate for avoiding large residuals. This idea can be implemented asfollows.

For some µ ∈ C, take

φk(λ) = (1− µλ)φk−1(λ),

Page 114: Diederik Fokkema - Thesis

100 Chapter 4. Generalized conjugate gradient squared

or equivalently, take

βk = 0 and αk = µ, for k = 0,

βk = βk−1 and αk = αk−1, for k > 0.

in the GCGS algorithm in Alg. 4.3.A possible choice for µ is, for instance, the inverse of an approximation

for the largest eigenvalue of A. This value for µ can be roughly determinedwith Gershgorin disks or with a few steps of Arnoldi’s algorithm [2, 80]. Asexplained in the previous section, one may expect a smoother convergencebehavior for symmetric problems. Additionally, the choice of µ may reducethe influence of the largest eigenvalue on the convergence behavior. For generalnonsymmetric problems, where complex roots may appear, one may hope fora similar behavior of this scheme. We will refer to this approach as ShiftedCGS. Note that in terms of computational work we save 2 inner products ascompared with CGS2.

4.7. Numerical examples. The new GCGS methods (in Section 4.6) donot seem to be superior to BiCGstab(`) as solvers of linear equations (althoughit seems they can compete). This should not come as a surprise, becausethey were not designed for this purpose. However, as we will see, they canbe attractive as linear solver in a Newton scheme for nonlinear equations.The GCGS methods improve on CGS, with smoother and faster convergence,avoiding large intermediate residuals, leading to more accurate approximations(see, Section 4.7.1 for CGS2, and Section 4.7.2 for Shifted CGS). At the sametime, they seem to maintain the good reduction properties of CGS with respectto the exterior components, and thus improving on BiCGstab methods assolvers in a Newton scheme (see, Section 4.7.3 and 4.7.4).

For large realistic problems, it is hard to compare explicitly the effectsof the linear solvers on, say, the exterior components. Here, we support thevalidity of our heuristic arguments by showing that the convergence behaviorin the numerical examples is in line with our predictions.

4.7.1. Characteristics of CGS2. The CGS2 algorithm (Alg. 4.5),which uses a product of two nearby Bi-CG polynomials, was tested with successat IIS in Zurich (this section) and at Philips in Eindhoven (Section 4.7.3).

At IIS the package PILS [74] written in C and FORTRAN was used forsolving two linear systems extracted from the simulation of two devices calleddr15c and mct70c, respectively. The computations were done on a Sun Sparc10 in double precision (ξ ≈ 0.5 × 10−15) and ILU(0) [74, 62] was used asa preconditioner. The plots in Fig. 4.1 and Fig. 4.2 show the convergencebehavior of CGS2, CGS, Bi-CGSTAB, and BiCGstab(2). In CGS2 we tookrandom vectors for both r0 and s0. In the other methods we took the standard

Page 115: Diederik Fokkema - Thesis

Section 4.7. Numerical examples 101

0 50 100 15010

-12

10-10

10-8

10-6

10-4

10-2

100

102

104

106

Number of MV’s

rela

tive

resi

dual

nor

m

CGS2CGSBi-CGSTABBi-CGstab(2)

-...-.---

Fig. 4.1. Convergence history for device dr15c, 469741 nonzeros (ILU(0) pre-conditioning).

choice r0 = r0. Along the x-axis the number of matrix-vector multiplicationsis given. The y-axis represents the relative residual norm ‖rk‖2/‖r0‖2 onlogarithmic scale.

One observation is that CGS2 does not amplify the initial residual as muchas CGS does. Its convergence behavior is much smoother. When we triedCGS with a random vector as r0 too, its convergence behavior improved, butstill CGS2 was better. Furthermore, the plots show that CGS2 can competewith Bi-CGSTAB and BiCGstab(2). The accuracy of the approximate solutiondelivered by all methods was of comparable size, except for the accuracy of theapproximate solution of CGS in mct70c, which was two orders of magnitudeless than the others. Since the iterations were terminated when ‖rk‖2/‖r0‖2 ≤10−9 and the relative machine precision is ξ ≈ 0.5 × 10−15, these results arein line with (4.4).

4.7.2. Characteristics of Shifted CGS. The Shifted CGS method(Section 4.6.2) uses a combination with a lower degree Bi-CG polynomial.In the examples to be discussed next, the parameter µ was taken as the in-verse of the real part of the largest eigenvalue estimate, delivered by a fewsteps of Arnoldi’s algorithm. Along the x-axis the number of matrix-vector

Page 116: Diederik Fokkema - Thesis

102 Chapter 4. Generalized conjugate gradient squared

0 100 200 300 400 500 600 70010

-10

10-8

10-6

10-4

10-2

100

102

104

106

108

1010

Number of MV’s

rela

tive

resi

dual

nor

mCGS2CGSBi-CGSTABBi-CGstab(2)

-...-.---

Fig. 4.2. Convergence history for device mct70c, 1969203 nonzeros (ILU(0)preconditioning).

multiplications is given and the y-axis represents the scaled true residual norm‖b−Axk‖2/‖r0‖2.

4.7.2.1. Example 1. We start with a system with a symmetric positivedefinite matrix. For such a system the polynomial behavior of the error re-duction with CGS is more easily interpreted, and because of the orthogonaleigensystem the situation is not further confused with arguments in anglesbetween subspaces. The linear system stems from a (82 × 83) finite volumediscretization over the unit square, with Dirichlet boundary conditions alongy = 0 and Neumann conditions along the other parts of the boundary, of

−(Dux)x − (Duy)y = 1,

where the function D is defined as

D = 1000 for 0.1 ≤ x, y ≤ 0.9, and D = 1 elsewhere.

Symmetric ILU(0) preconditioning [62] was used. Fig. 4.3 confirms our heuris-tic arguments that for a symmetric system a combination with a lower degreeBi-CG polynomial can make the convergence somewhat smoother. The three

Page 117: Diederik Fokkema - Thesis

Section 4.7. Numerical examples 103

1e-16

1e-14

1e-12

1e-10

1e-08

1e-06

1e-04

1e-02

1e+00

0 50 100 150 200

rela

tive

true

res

idua

l nor

m

Number of MV’s

Shifted CGSCGS

Fig. 4.3. Convergence history for example 1, 33292 nonzeros (ILU(0) precondi-tioning).

peaks in the convergence history for CGS are not found in the history for ourShifted CGS variant. Notice that full accuracy of the approximate solution isattained for both methods, as may be explained by the fact that no residualnorm is larger than the initial residual norm (cf. (4.4)).

4.7.2.2. Example 2. This example is taken from [19]. The linear systemstems from a (42 × 42) finite volume discretization over the unit square withDirichlet boundary conditions, of

−∆u+ 2 exp(2(x2 + y2))ux − 100u = F,

where the right hand side is taken such that the vector with all ones is thesolution. ILU(0) preconditioning was used.

The convergence behavior of both methods reflects the fact that the matrixis now nonsymmetric. Both methods converge less smoothly. The improve-ment is not impressive, but on the average it seems that all residual normsof Shifted CGS stay well below those of CGS. As a result, the accuracy ofShifted CGS is two orders of magnitude better compared with the accuracy ofCGS: the maximum intermediate residual for CGS is ≈ 3 × 102 times largerthan the maximum one of Shifted CGS (cf. Fig. 4.4 and (4.4)).

Page 118: Diederik Fokkema - Thesis

104 Chapter 4. Generalized conjugate gradient squared

1e-14

1e-12

1e-10

1e-08

1e-06

1e-04

1e-02

1e+00

1e+02

1e+04

0 50 100 150 200 250

rela

tive

true

res

idua

l nor

m

Number of MV’s

Shifted CGSCGS

Fig. 4.4. Convergence history for example 2, 7840 nonzeros, (ILU(0) precondi-tioning).

4.7.3. CGS2 as linear solver in a Newton scheme. In this sub-section we discuss numerical results of nonlinear device simulations in whichthe linear system of equations that appear in Newton’s method are solved byCGS2, CGS, and Bi-CGSTAB. The numerical data for the figures was ob-tained from device simulations with the package CURRY [73], written in FOR-TRAN, developed at Philips in Eindhoven. In this package the Jacobian matri-ces are explicitly formed. The computations were done on an HP workstationin double precision. With this package the evolution of the solution of the de-vice CAP01T with respect to Time (in seconds), and of the device DIODE withrespect to voltage (in volt), is followed by a continuation method [43].

In each continuation step the value of the relevant parameter (volt or sec-ond) is increased by a certain step size and the next solution is computed by aNewton process in which the solution of the previous step is used as an initialguess. The irregularities in the convergence history in the figures are causedby convergence failures of the Newton process. In case Newton’s method failsto converge for a particular step size, CURRY tries to solve this subproblem byusing the continuation method with the step size halved. If Newton’s methodagain fails to converge for this subproblem, this strategy is repeated up to 5times (after which CURRY gives up).

Page 119: Diederik Fokkema - Thesis

Section 4.7. Numerical examples 105

0 1000 2000 3000 4000 5000 600010

−5

10−6

10−7

10−8

10−9

10−10

10−11

10−12

CGS2CGSBi−CGSTAB

−...−.−

Number of MV’s

Sec

onds

Fig. 4.5. CAP01T: Convergence behavior of CURRY in combination with CGS2,CGS, and Bi-CGSTAB+.

The figures 4.5 and 4.6 show the convergence behavior of CURRY in com-bination with CGS2, CGS, or Bi-CGSTAB (all with ILU(0) preconditioning),as a linear solver in the consecutive Newton steps. Actually, for reasons ex-plained in the introduction of this paper, CURRY, in the case of Bi-CGSTAB,switches to CGS in the last step of the Newton process for a particular contin-uation step. This improves the overall convergence of the continuation methodsignificantly.

The figures should be understood as follows. The vertical axis shows thevalue of the continuation parameter, dictated by the continuation strategy inCURRY. The horizontal axis shows the cumulative number of matrix multipli-cations (MV’s) used by the linear solver. The simulation is a success whenthe bottom of the plot is reached. The execution time is proportional to thenumber of MV’s, so the fewer MV’s the better the performance.

Fig. 4.5 shows the convergence behavior of a transient phase simulation(from 3 to 4 volts) in Time for the device CAP01T. With all three choices ofthe linear solvers CGS2, CGS, and Bi-CGSTAB+ (the “+” indicating the

Page 120: Diederik Fokkema - Thesis

106 Chapter 4. Generalized conjugate gradient squared

0 1000 2000 3000 4000 5000 6000 7000 40

35

30

25

20

15

10

5

0

CGS2CGS (no convergence)Bi−CGSTAB

−...−.−

Number of MV’s

Vol

t

Fig. 4.6. DIODE: Convergence behavior of CURRY in combination with CGS2,CGS, and Bi-CGSTAB+.

switch to CGS), the package CURRY manages to compute the solution of a fullsimulation. Clearly, CGS2 is the method of choice in this example. Observethe long stagnation phase between 10−9 and 10−8 seconds. Typically, in othertransient simulations (not shown here) with similar stagnation phases, CGS2improved the overall performance of CURRY significantly.

Fig. 4.6 shows the convergence behavior of a simulation for the voltage(from 0 to 40 volts) of the device DIODE. The plot shows a typical convergencebehavior of CURRY for simulation of “difficult” devices for which the combi-nation of CURRY and CGS fails, e.g., in this case almost immediately (andtherefore hard to see in the plot). The combination with Bi-CGSTAB+ con-verges initially much better than the combination with CGS2, but stalls atvoltage level 23 and fails. CURRY with CGS2, on the other hand, after somedifficulties in the initial phase, converges quite rapidly. In this example, andalso in others, only the combination of CURRY with CGS2 is able to computethe solution of a full simulation.

Page 121: Diederik Fokkema - Thesis

Section 4.7. Numerical examples 107

4.7.4. Shifted CGS as linear solver in a Newton scheme. Herewe present a comparison of Shifted CGS and other linear solvers in a Newtonscheme for solving the classical driven cavity problem from incompressible fluidflow. We compare Shifted CGS, CGS2, CGS, Bi-CGSTAB, and BiCGstab(2).In step k of the Newton process, the linear system (involving the exact Jaco-bian), is solved to a relative residual norm reduction of 2−k (see [30]), subjectto a maximum of 100 matrix vector multiplications. The correction vectorobtained in this way was then used in a linesearch procedure [31] to get thenew approximation. If the relative change of the (Newton) residual was lessthan 10−6 the iterations were stopped.

Following closely the presentations in [43, 17] the driven cavity problem instream function-vorticity formulation is described by these equations:

ν∆ω + (ψx2ωx1 − ψx1ωx2) = 0 in Ω,−∆ψ = ω in Ω,ψ = 0 on ∂Ω,

∂ψ

∂n(x1, x2)|∂Ω =

1 if x2 = 1,0 if 0 ≤ x2 < 1,

where Ω is the unit square and the viscosity ν is the reciprocal of the Reynoldsnumber Re. In terms of ψ alone this can be written as

ν∆2ψ + (ψx2(∆ψ)x1 − ψx1(∆ψ)x2) = 0 in Ω,

subject to the same boundary conditions. This equation was discretized withcentral differences on a 41 × 41 regular grid. As preconditioner we used theModified ILU(2) decomposition [46] of the biharmonic operator ∆2. As initialguess we took ψ = 0.

In Fig. 4.7 we show a plot of the convergence of Newton for Re=1000.The marks indicate a Newton step. Also in this example, the parameter µ inShifted CGS was taken as the inverse of the real part of the largest eigenvalueestimate, delivered by a few steps of Arnoldi’s algorithm.

As can be seen clearly, only the combination of Newton with Shifted CGSand CGS2 is successful in this example. The combination with CGS cankeep up in the beginning but then CGS has trouble solving the linear system,which causes the stagnation. The combination with Bi-CGSTAB stagnatesall together. This could be attributed to the fact that Bi-CGSTAB is notable to solve the linear systems, because they are very nonsymmetric [85].BiCGstab(2) on the other hand is able to solve the linear systems (in thebeginning) but apparently delivers a correction that is not of much use toNewton.

Page 122: Diederik Fokkema - Thesis

108 Chapter 4. Generalized conjugate gradient squared

1e-12

1e-11

1e-10

1e-09

1e-08

1e-07

1e-06

1e-05

1e-04

1e-03

1e-02

1e-01

1e+00

1e+01

0 100 200 300 400 500 600 700

resi

dual

nor

m

Number of matrix multiplications

Shifted CGSCGS2CGS

Bi-CGSTABBiCGstab(2)

Fig. 4.7. Driven Cavity: Convergence behavior of Newton in combination withdifferent linear solvers.

Note that in this case the combination of Newton with Shifted CGS ispreferable, because it is more efficient: Shifted CGS uses two inner productsless than CGS2.

Additional note. In [102] it was observed that replacing the residual rk

in CGS by the true residual b − Axk has a negative effect on the iterationprocess. Recently, it came to our attention that Neumaier [68] reports goodresults with a different strategy that does include the use of the true residual.His strategy can be summarized as follows:

Add the line “xbest = 0” after the first line in CGS and replace the lastline with

rk+1 = b−Axk+1

if ‖rk+1‖2 ≤ ‖rbest‖2 thenb = rbest = rk+1

xbest = xbest + xk+1

xk+1 = 0endif

We have tested this approach on several problems and for those problems weconfirm the observation that indeed this modification to CGS has no adverseinfluence on the convergence behavior and that accuracy is reached withinmachine precision (i.e., | ‖rm‖2−‖b−Axm‖2 | . ξ Γ ‖r0‖2 with Γ as in (4.4)).

Page 123: Diederik Fokkema - Thesis

Section 4.8. Conclusions 109

For an explanation and other related strategies, see [91].

4.8. Conclusions. We have shown how the CGS algorithm can be gen-eralized to a method that uses the product of two nearby Bi-CG polynomialsas a reduction operator on the initial residual. Two methods are suggestedto improve the accuracy and the speed of convergence, without losing thequadratic reduction of errors in converged eigenvector directions. This is im-portant, since the Newton process seems to benefit from this property. Severalnumerical examples are given that confirm our heuristic arguments.

Acknowledgement. We appreciated the help of Marjan Driessen at Phi-lips Research Laboratories (Eindhoven). She provided the numerical data forthe examples in Section 4.7.3.

Page 124: Diederik Fokkema - Thesis

110 Chapter 4. Generalized conjugate gradient squared

Page 125: Diederik Fokkema - Thesis

Chapter 5

ACCELERATED INEXACT NEWTON SCHEMES FOR LARGESYSTEMS OF NONLINEAR EQUATIONS

DIEDERIK R. FOKKEMA , GERARD L. G. SLEIJPEN , AND

HENK A. VAN DER VORST

Abstract. Classical iteration methods for linear systems, such as Jacobi Iteration, canbe accelerated considerably by Krylov subspace methods like GMRES. In this paper, wedescribe how Inexact Newton methods for nonlinear problems can be accelerated in a similarway and how this leads to a general framework that includes many well-known techniquesfor solving linear and nonlinear systems, as well as new ones. Inexact Newton methodsare frequently used in practice to avoid the expensive exact solution of the large linearsystem arising in the (possibly also inexact) linearization step of Newton’s process. Ourframework includes acceleration techniques for the “linear steps” as well as for the “nonlinearsteps” in Newton’s process. The described class of methods, the AIN (Accelerated InexactNewton) methods, contains methods like GMRES and GMRESR for linear systems, Arnoldiand Jacobi-Davidson for linear eigenproblems, and many variants of Newton’s method, likeDamped Newton, for general nonlinear problems. As numerical experiments suggest, theAIN approach may be useful for the construction of efficient schemes for solving nonlinearproblems.

Key words. Nonlinear problems, Newton’s method, Inexact Newton, Iterative methods

AMS subject classifications. 65H10

5.1. Introduction. Our goal in this paper is twofold. A number of iter-ative solvers for linear systems of equations, such as FOM [79], GMRES [82],GCR [110], Flexible GMRES [81], GMRESR [105] and GCRO [29], are instructure very similar to iterative methods for linear eigenproblems, like shiftand invert Arnoldi [2, 80], Davidson [26, 80], and Jacobi-Davidson [90]. Wewill show that all these algorithms can be viewed as instances of an AcceleratedInexact Newton (AIN) scheme (cf. Alg. 5.3), when applied to either linearequations or to linear eigenproblems. This observation may help us in thedesign and analysis of algorithms by “transporting” algorithmic approachesfrom one application area to another. Moreover, our aim is to identify efficientAIN schemes for nonlinear problems as well, and we will show how we canlearn from the algorithms for linear problems.

Page 126: Diederik Fokkema - Thesis

112 Chapter 5. Accelerated Inexact Newton schemes

To be more specific, we will be interested in the numerical approximationof the solution u of the nonlinear equation

(5.1) F (u) = 0,

where F is some smooth (nonlinear) map from a domain in Rn (or C n) thatcontains the solution u, into Rn (or C n), where n is typically large.

Some special types of systems of equations will play an important motivat-ing role in this paper.

The first type is the linear system of equations

(5.2) Ax = b,

where A is a nonsingular matrix and b, x are vectors of appropriate size; A andb are given, x is unknown. The dimension n of the problem is typically largeand A is often sparse. With u = x and F (u) := b − Au, (5.2) is equivalentto (5.1). This type will serve as the main source of inspiration for our ideas.

The second type concerns the generalized linear eigenproblem

(5.3) Av = λBv.

With u = (v, λ) we have that, for normalized v, with F (u) := Av − λBv,equation (5.3) is equivalent to (5.1). This type is an example of a mildlynonlinear system and will serve as an illustration for the similarity betweenvarious algorithms, seen as instances of AIN (see Section 5.6).

However, the AIN schemes, that we will discuss, will be applicable tomore general nonlinear problems, like, for instance, equations that arise fromdiscretizing nonlinear partial differential equations of the form

(5.4) −∇(a∇u) + b g(u)∇u+ c h(u) = f on Ω,

where Ω is a domain in R2 or R3, a, b ∈ C1(Ω), c ∈ C(Ω), h, g ∈ C1(R), andf ∈ L2(Ω), and u satisfies suitable boundary conditions. An example of (5.4)is, for instance

(5.5) −∆u− λeu = 0 on Ω,

where Ω is some domain in R2 and u = 0 on ∂Ω (see also Section 5.8).Guided by the known approaches for the linear system (cf. [81, 105, 29])

and the eigenproblem (cf. [90, 84]) we will define accelerated Inexact Newtonschemes for more general nonlinear systems. This leads to a combination ofKrylov subspace methods for Inexact Newton (cf. [55, 17] and also [30]) withacceleration techniques (as in [4]) and offers us an overwhelming choice oftechniques for further improving the efficiency of Newton type methods. As a

Page 127: Diederik Fokkema - Thesis

Section 5.2. Inexact Newton methods 113

side-effect this leads to a surprisingly simple framework for the identificationof many well-known methods for linear, eigen, and nonlinear problems.

Our numerical experiments for nonlinear problems, like problem (5.5), serveas an illustration for the usefulness of our approach.

The rest of this paper is organized as follows. In Section 5.2 we brieflyreview the ideas behind the Inexact Newton method. In Section 5.3 we intro-duce the Accelerated Inexact Newton methods (AIN). We will examine howiterative methods for linear problems are accelerated and we will distinguishbetween a Galerkin approach and a Minimal Residual approach. These con-cepts are then extended to the nonlinear case. In Section 5.4 we make somecomments on the implementation of AIN schemes. In Section 5.5 we showhow many well-known iterative methods for linear problems fit in the AINframework. In Section 5.6 and Section 5.7 we consider instances of AIN forthe mildly nonlinear generalized eigenproblem and for more general nonlinearproblems. In Section 5.8 we present our numerical results and some concludingremarks are in Section 5.9.

5.2. Inexact Newton methods. Newton type methods are very pop-ular for solving systems of nonlinear equations as, for instance, representedby (5.4). If uk is the approximate solution at iteration number k, Newton’smethod requires for the next approximate solution of (5.1), the evaluation ofthe Jacobian Jk := F ′(uk) and the solution of the correction equation

(5.6) Jkp = −rk, where rk := F (uk).

Unfortunately, it may be very expensive, or even practically impossible to de-termine the Jacobian and/or to solve the correction equation exactly, especiallyfor larger systems.

In such situations one aims for an approximate solution of the correctionequation, possibly with an approximation for the Jacobian (see, e.g., [30]).Alg. 5.1 is an algorithmical representation of the resulting Inexact Newtonscheme.

For an initial guess u0 sufficiently close to a solution, Newton’s methodhas asymptotically at least quadratic convergence behavior. However, thisquadratic convergence is usually lost if one uses inexact variants and oftenthe convergence is not much faster than linear. In the next section we makesuggestions how this (linear) speed of convergence may be improved.

Note: It is our aim to restore, as much as possible, the asymptotic conver-gence behavior of exact Newton and we do not address the question of globalconvergence.

5.3. Accelerating Inexact Newton methods. Newton’s method is aone step method, that is, in each step, Newton’s method updates the approx-imate solution with information from the previous step only. However, in the

Page 128: Diederik Fokkema - Thesis

114 Chapter 5. Accelerated Inexact Newton schemes

1. Set k = −1 and choose an initial approximation u0.2. Repeat until uk is accurate enough:

(a) k = k + 1(b) Compute the residual rk = F (uk).(c) Compute an approximation Jk for the Jacobian

F ′(uk).(d) Solve the correction equation (approximately).

Compute an (approximate) solution pk of thecorrection equation

Jkp = −rk.

(e) Update. Compute the new approximation:uk+1 = uk + pk.

Alg. 5.1. Inexact Newton

1. Set k = −1 and choose an initial approximation x0.2. Repeat until xk is accurate enough:

(a) k = k + 1(b) rk = b−Axk

(c) pk = diag(A)−1rk(d) xk+1 = xk + pk

Alg. 5.2. Jacobi Iteration

computational process, subspaces have been built gradually, that contain use-ful information concerning the problem. This information may be exploitedto improve the current approximate solution, and this is what we propose todo. More precisely, we will consider alternative update strategies for step (e)of the Inexact Newton algorithm Alg. 5.1.

5.3.1. Acceleration in the linear case. The linear system Ax = b canbe written as F (x) := b − Ax = 0, and −A is the Jacobian of F . When theapproximate solution pk is computed as pk = M−1rk, where M is some pre-conditioning matrix (approximating A), then the Inexact Newton algorithm,Alg. 5.1, reduces to a standard Richardson-type iteration process for the split-ting A = M − R. For instance, the choice M = D, where D = diag(A) leadsto Jacobi iteration (see Alg. 5.2).

One may improve the convergence behavior of standard iterations schemes

Page 129: Diederik Fokkema - Thesis

Section 5.3. Accelerating Inexact Newton methods 115

by• using more sophisticated preconditioners M , and/or• applying acceleration techniques in the update step.

Different preconditioners and different acceleration techniques lead to differentalgorithms, some of which are well-known.

Examples of iterations schemes that use more sophisticated preconditionersare, for instance, Gauss-Seidel iteration, where M = L+D, with L is the strictlower triangular part of A and D = diag(A) and SOR where M = ω(L+D),and ω is a relaxation parameter.

Examples of iterations schemes that use acceleration techniques are algo-rithms that take their updates to the approximate solution as a linear combi-nation of previous directions pj . Preferable updates pk :=

∑j≤k γjpj are those

for which b − Axk+1, where xk+1 = xk + pk, is minimal in some sense: e.g.,‖b − Axk+1‖2 is minimal, as in GMRES [82] and GCR [110], or b − Axk+1 isorthogonal to the pj for j ≤ k, as in FOM or GENCG [79], or b − Axk+1 is“quasi-minimal”, as in Bi-CG [57], and QMR [41].

Of course the distinction between preconditioning and acceleration is not aclear one. Acceleration techniques with a limited number of steps can be seenas a kind of dynamic preconditioning as opposed to the static preconditioningwith fixedM . In this view one is again free to choose an acceleration technique.Examples of such iteration schemes are Flexible GMRES [81], GMRESR [105]and GCRO [29].

All these accelerated iteration schemes for linear problems construct ap-proximations xk+1 = x0 + Vkyk, Vk := [p1, p2, . . . , pk], with yk the solution ofa smaller or an easier projected problem. For example, GMRES computes yk

such that ‖b−A(xk + Vkyk)‖2 is minimal, or equivalently (AVk)∗(b−A(xk +Vkyk)) = 0; FOM computes yk such that V ∗

k (b − A(xk + Vkyk)) = 0, whereasBi-CG and QMR compute yk as the solution of a larger tri-diagonal problemobtained with oblique projections.

For stability (and efficiency) reasons one usually constructs another basisfor the span of Vk with certain orthogonality properties, depending on theselected approach.

5.3.2. Acceleration in the nonlinear case. We are interested in iter-ation schemes for finding a zero of a general nonlinear mapping F . For thelinear case, the methods mentioned above are, apart from the computation ofthe residual, essentially a mix of two components: (1) the computation of anew search direction (which involves the residual), and (2) the update of theapproximation (which involves the current search direction and possibly pre-vious search directions, and the solution yk of a projected problem). The firstcomponent may be interpreted as preconditioning, while the second componentis the acceleration.

Page 130: Diederik Fokkema - Thesis

116 Chapter 5. Accelerated Inexact Newton schemes

Looking more carefully on how yk in the linear case is computed, we candistinguish between two approaches based on two different conditions. WithGk(y) := F (xk + Vky), the FOM and the other “oblique” approaches leadto methods that compute y such that (for appropriate Wk) W ∗

kGk(y) = 0(a Galerkin condition), whereas the GMRES approach leads to methods thatcompute y such that ‖Gk(y)‖2 is minimal (a Minimal Residual condition).

From these observations for the linear case we now can formulate iterationschemes for the nonlinear case.

The Inexact Newton iteration can be accelerated in a similar way as thestandard linear iteration. This acceleration can be accomplished by updat-ing the solution by a correction pk in the subspace spanned by all correctiondirections pj (j ≤ k).

To be more precise, the update pk for the approximate solution is given bypk = Vky, where Vk = [v1, v2, . . . , vk] for some basis (vj) of the search spaceVk spanned by p1, p2, . . . , pk. Furthermore, with Gk(y) = F (uk + Vky), wepropose to determine y by

• a Galerkin condition on Gk(y): y is a solution of

(5.7) W ∗kGk(y) = 0,

where Wk is some matrix of the same dimensions as Vk,• or a Minimal Residual (MR) condition on Gk(y): y is a solution of

(5.8) miny‖Gk(y)‖2,

• or a mix of both, a Restricted Minimal Residual (RMR) condition onGk(y): y is a solution of

(5.9) miny‖W ∗

kGk(y)‖2.

Equation (5.7) generalizes the FOM approach, while equation (5.8) generalizesthe GMRES approach.

Solving (5.7) means that the component of the residual rk+1 in the subspaceWk (spanned by Wk) vanishes. For Wk one may choose, for instance, Wk =Vk (as in FOM), or Wk = [Wk−1, wk] where wk is the component of Jkpk

orthogonal to Wk−1, (as in GMRES: wk = (I −Wk−1W∗k−1)Jkpk). For linear

equations the Minimal Residual and the Galerkin approach coincide for thelast choice.

As is known from the linear case, a complication of the Galerkin approachis that equation (5.7) may have no solution, which means that this approachmay lead to breakdown of the method. In order to circumvent this shortcom-ing to some extend we have formulated the Restricted Minimal Residual ap-proach (5.9). Compared to (5.7) this formulation is also attractive for another

Page 131: Diederik Fokkema - Thesis

Section 5.4. Computational considerations 117

reason: one can apply standard Gauss-Newton [31] schemes for solving generalnonlinear least squares problems to it. One might argue that a drawback ofa Gauss-Newton scheme is that it may converge slowly (or not at all). How-ever, for least squares problems with zero residual solutions, the asymptoticspeed of convergence of a Gauss-Newton method is that of Newton’s method.This means, that if the Galerkin problem (5.7) has a solution, a Gauss-Newtonscheme applied to (5.9) will find it fast and efficient (see also Section 5.8).

Note that equations (5.7)–(5.9) represent nonlinear problems in only kvariables, which may be much easier to solve than the original problem. Ifthese smaller nonlinear problems can be formulated cheaply, then the costs foran update step may be considered as being relatively small.

Note also that since equations (5.7)–(5.9) are nonlinear, they may havemore than one solution. This fact may be exploited to steer the computationalprocess to a specific preferable solution of the original problem.

Accelerated Inexact Newton. For the Galerkin approach, step (e) in theInexact Newton’s algorithm, Alg. 5.1, is replaced by four steps in which

• the search subspace Vk−1 is expanded by an approximate “Newtoncorrection” and a suitable basis is constructed for this subspace,• a shadow space Wk is selected on which we project the original prob-

lem,• the projected problem (5.7) is solved,• and the solution is updated.

This is represented, by the steps (e)–(h) in Alg. 5.3. The Minimal Residualapproach and the Restricted Minimal Residual approach can be representedin a similar way.

5.4. Computational considerations. In this section we make somecomments on implementation details that mainly focus on limiting computa-tional work and memory space.

5.4.1. Restart. For small k, problems (5.7)–(5.9) are of small dimensionand may often be solved at relatively low computational costs (e.g., by somevariant of Newton’s method).

For larger k they may become a serious problem in itself. In such a situa-tion, one may wish to restrict the subspaces V and W to subspaces of smallerdimension (see Alg. 5.3, step (i)). Such an approach limits the computationalcosts per iteration, but it may also have a negative effect on the speed ofconvergence.

For example, the simplest choice, restricting the search subspace to a 1-dimensional subspace leads to Damped Inexact Newton methods, where, forinstance, the damping parameter α is the solution of minα ‖Gk(α)‖2, whereGk(α) = F (uk + pkα).

Page 132: Diederik Fokkema - Thesis

118 Chapter 5. Accelerated Inexact Newton schemes

1. Set k = −1 and choose an initial approximation u0.V = [ ], W = [ ].

2. Repeat until uk is accurate enough:(a) k = k + 1(b) Compute the residual rk = F (uk).(c) Compute an approximation Jk for the Jacobian F ′(uk).(d) Solve the correction equation (approximately).

Compute an (approximate) solution pk for thecorrection equation

Jkp = −rk.

(e) Expand the search space. Select a vk in thespan(Vk−1, pk) that is linearly independent of Vk−1 andupdate Vk = [Vk−1, vk].

(f) Expand the shadow space. Select a wk that is linearlyindependent of Wk−1 and update Wk = [Wk−1, wk].

(g) Solve the projected problem. Compute nontrivialsolutions y of the projected system

W ∗kGk(y) = 0.

(h) Update. Select a yk (from the set of solutions y) andupdate the approximation: uk+1 = uk + Vkyk.

(i) Restart. ` = dim(span(Vk)). If ` is too large, select an`′ < `, select `× `′ matrices RV and RW and computeVk = VkRV , Wk = WkRW (i.e., take suitablecombinations of the columns of Vk and Wk).

Alg. 5.3. Accelerated Inexact Newton

Of course, a complete restart is also feasible, say after each mth step(cf. step (i) of Alg. 5.3):

(i) If dim(span(Vk)) > m then Vk = [ ] and Wk = [ ].

The disadvantage of a complete restart is that we have to rebuild subspaceinformation again. Usually it leads to a slower speed of convergence.

It seems like an open door to suggest that parts of subspaces better be

Page 133: Diederik Fokkema - Thesis

Section 5.4. Computational considerations 119

retained at restart, but in practical situations it is very difficult to predictwhat those parts should be. A meaningful choice would depend on spectralproperties of the Jacobian as well as on the current approximation. Whensolving linear equations with GMRESR [105], good results have been reportedin [108] when selecting a number of the first and the last columns (cf. step (i)of Alg. 5.3); e.g.,

(i) If dim(span(Vk)) > 10 then Vk = VkRV and Wk = WkRW , withRV = RW = [e1, . . . , e5, e7, . . . , e11].

In [29], a variant of GMRESR, called GCRO, is proposed, which imple-ments another choice. For subspaces of dimension l + m, the first l columnsare retained, together with a combination of the lastm columns. This combina-tion is taken such that the approximate solution, induced by a minimal residualcondition, is the same for both the subspaces of dimension l+m and l+1. Tobe more specific, if uk+1 = uk+Vkyk, where yk solves miny ‖F (uk+Vky‖2, thenVk is replaced by [Vkl

, Vkmykm

] (denoting Vk = [Vkl, Vkm

] and yk = [ykl, ykm

]).

5.4.2. Update. In the update step (step (h) of Alg. 5.3), a solutionyk of the projected problem has to be selected from the set of solutions y.Selection may be necessary since many nonlinear problems have more than onesolution. Sometimes, this may be the reason for poor convergence of (Inexact)Newton: the sequence of approximate solutions “wavers” between differentexact solutions. For larger search subspaces, the search subspace may containgood approximations for more than one solution. This may be exploited tosteer the sequence of approximate solution to the wanted solution uk+1 and itmay help to avoid wavering convergence behavior.

The selection of yk should be based on additional properties of the solutionuk+1. For instance, we may look for the solution largest in norm, or as in thecase of eigenvalue problems, for a solution of which one component is close tosome specific value (for instance, if one is interested in eigenvalues close to,say, 0, the Ritz vector with Ritz value closest to 0 will be chosen).

5.4.3. The projected problem. Even though problems of small di-mension can be solved with relatively low computational costs, step (g) inAlg. 5.3 is not necessarily inexpensive. The projected problem is embeddedin the large subspace and it may require quite some computational effort torepresent the problem in a small subspace (to which y belongs) of dimension` := dim(span(Vk)) (y ∈ C `). In the case of linear equations (or linear eigen-value problems) the computation of an ` × `-matrix as W ∗

kAVk requires `2

inner products. For this type of problems, and for many others as well, onemay save on the computational costs by re-using information from previousiterations.

Page 134: Diederik Fokkema - Thesis

120 Chapter 5. Accelerated Inexact Newton schemes

5.4.4. Expanding the search subspace. The AIN algorithm breaksdown if the search subspace is not expanded. This happens when pk belongsto the span of Vk−1 (or, in finite precision arithmetic, if the angle between pk

and this subspace is very small). Similar as for GMRES, one may then replacepk by Jkv`, where v` is the last column vector of the matrix Vk−1.

With approximate solution of the correction equation, a breakdown willalso occur if the new residual rk is equal to the previous residual rk−1. We willhave such a situation if yk−1 = 0. Then, instead of modifying the expansionprocess in iteration number k, one may also take measures in iteration numberk − 1 in order to avoid yk−1 = 0. In [105] a few steps by LSQR are suggestedwhen the linear solver is a Krylov subspace method: pk = JT

k−1rk−1 mayalready cure the stagnation.

5.5. How linear solvers fit in the AIN framework. In this sectionwe will show how some well-known iterative methods for the solution of linearsystems fit in the AIN framework. The methods that follow from specificchoices in AIN are equivalent to well-known methods only in the sense that,at least in exact arithmetic, they produce the same basis vectors for the searchspaces, the same approximate solutions, and the same Newton corrections (inthe same sense as in which GMRES and ORTHODIR are equivalent).

With u = x, F (u) := b−Au, the linear equation (5.2) is equivalent to theone in (5.1) and Jk = −A. In this section, M denotes a preconditioning matrixfor A (i.e., for a vector v, M−1v is easy to compute and approximates A−1v).

5.5.1. GCR. With the choice, pk = M−1rk, wk = Avk, and vk such thatwk ⊥ span(Wk−1), the AIN algorithm Alg. 5.3 (without restart) is equivalentto preconditioned GCR [110].

5.5.2. FOM and GMRES. The choice pk = M−1rk and vk such thatvk ⊥ span(Vk−1), gives algorithms that are related to FOM and GMRES [82].With the additional choice wk = vk, AIN algorithm Alg. 5.3 is just FOM,while the choice wk = Avk gives an algorithm that is equivalent to GMRES.

5.5.3. GMRESR. Taking wk = Avk, and vk such that wk is perpen-dicular to span(Wk−1) as in GCR and taking pk as an approximate solutionof the equation Ap = rk, AIN algorithm Alg. 5.3 is equivalent to the GM-RESR algorithms [105]. One might compute pk by a few steps of GMRES, forinstance.

5.6. AIN schemes for mildly nonlinear problems. In this sectionwe will discuss numerical methods for the iterative solution of the generalizedeigenproblem (5.3). We will show that they also fit in the general frameworkof the AIN Alg. 5.3 methods.

As already mentioned these AIN methods consist of two parts. In one partan approximate solution of the correction equation (cf. step (d) of Alg 5.3) is

Page 135: Diederik Fokkema - Thesis

Section 5.6. AIN schemes for mildly nonlinear problems 121

used to extend the search space. In the other part a solution of the projectedproblem (cf. step (g) in Alg. 5.3) is used to construct an update for theapproximate solution.

We will start with the derivation of a more suitable form for the (Newton)correction equation for the generalized eigenproblem. After that, we will makesome comments on how to solve the projected problem.

The correction equation. In order to avoid some of the complicationsthat go with complex differentiation, we will mainly focus on the numericalcomputation of eigenvectors with a fixed component in some given direction(rather then on the computation of eigenvectors with a fixed norm).

First, let u be a fixed vector with a nontrivial component in the directionof the desired eigenvector x. We want to compute approximations uk for xwith a normalized component in the u-direction: (u, u) = (x, u) = 1. We willselect ϑk such that the residual rk := (A−ϑkB)uk is orthogonal to w, where wis another fixed nontrivial vector, i.e., the approximate eigenvalue ϑk is givenby ϑk := w∗Auk/w

∗Buk.Consider the map F given by

F (u) := (A− ϑB)u, where ϑ :=w∗Au

w∗Bu,

and u belongs to the hyper-plane y ∈ C n | (y, u) = 1. The JacobianJk = F ′(uk) is then given by

Jk =(I − Bukw

w∗Buk

)(A− ϑkB)|u⊥ ,

and the correction equation reads as

(5.10) p ⊥ u, such that(I − Bukw

w∗Buk

)(A− ϑkB)p = −rk.

Since rk ⊥ w, this equation is equivalent to

(5.11)[A− ϑkB Buk

u∗ 0

] [pε

]=

[−rk0

],

that is, p is the solution of (5.10) if and only if p is the solution of (5.11).

The projected problem. For the Generalized eigenvalue problem we are inthe fortunate position that all the solutions of problems of moderate size canbe computed by standard methods such as for instance the QZ [63] method.However, before we can apply these methods we have to reformulate the pro-jected problem because of the exceptional position of uk in W ∗F (uk + Vky).

Page 136: Diederik Fokkema - Thesis

122 Chapter 5. Accelerated Inexact Newton schemes

The key to this reformulation is the observation that in the methods weconsider the affine subspace uk + span(Vk) is equal to Vk because Vk containsuk by itself. Now, as an alternative to step (g) in Alg. 5.3, we may alsocompute all the solutions y of

W ∗kF (Vky) = 0.

This problem can now be solved by for instance the QZ method, and afterselecting yk a new approximation uk+1 is given by uk+1 := Vkyk.

5.6.1. Arnoldi’s method. We consider the simplified case where B = I,i.e., the standard eigenproblem. If we do only one step of a Krylov subspacemethod (Krylov dimension 1) for the solution of the correction equation (5.10),then we obtain for the correction pk:

pk = −αrk.

Hence, pk = −α(A − ϑkI)uk. Note that this may be a poor (very) approxi-mation, because, in general, rk 6⊥ u. The approximate eigenvector uk belongsto the search subspace span(Vk−1) and expanding the search subspace by thecomponent of pk orthogonal to span(Vk−1) is equivalent to expanding thisspace with the orthogonal component of Auk, which would be the “expan-sion” vector in Arnoldi’s method. Hence, the search subspace is precisely theKrylov subspace generated by A and u0. Apparently, Arnoldi’s method is anAIN method (with a “very inexact Newton step”) without restart.

The choice Wk = Vk corresponds to the standard one in Arnoldi and pro-duces ϑ’s that are called Ritz values, while the choice Wk = AVk leads toHarmonic Ritz values [70].

5.6.2. Davidson’s method. As is the case in Arnoldi’s method, David-son’s method [26] also carries out only one step of a Krylov subspace methodfor the solution of the correction equation. However, in contrast to Arnoldi’smethod, Davidson also incorporates a preconditioner.

He suggests to solve (5.10) approximately by pk with

pk = −M−1rk,

where M is the inverse of the diagonal of A − ϑkB. Other choices have beensuggested as well (cf. e.g., [22, 66]). Because of the preconditioner, even ifB = I, the search space is not simply the Krylov subspace generated by Aand u0. This may lead to an advantage of Davidson’s method over Arnoldi’smethod.

For none of the choices of the preconditioner, proper care has been taken ofthe projections (see (5.10)): the preconditioner should approximate the inverse

Page 137: Diederik Fokkema - Thesis

Section 5.7. AIN schemes for general nonlinear problems 123

of the projected matrix (see (5.10)) as a map from u⊥ onto w⊥ rather than ofA− ϑkB.

However, if M is the diagonal of A− ϑB, and we choose u and w equal tothe same, arbitrary standard basis vector (as Davidson does [26]) then(

I − Bukw∗

w∗Buk

)M

(I − ukw

w∗uk

)p = −rk,

whenever w ⊥ rk and p solves Mp = −rk. Note that p ⊥ w, because M isdiagonal and rk ⊥ w. Therefore, for this particular choice of w (and u), thediagonal M may be expected to be a good preconditioner for the correctionequation (including the projections) in the cases where M is a good precondi-tioner for A−ϑkB. Observe that this argument does not hold for non-diagonalpreconditioners M .

5.6.3. Jacobi-Davidson. Davidson methods with a non-diagonal pre-conditioner do not take care properly of the projections in the correctionequation (5.10). This observation was made in [90], and a new algorithmwas proposed for eigenproblems by including the projections in the David-son scheme. In addition, these modified schemes allow for more general ap-proximate solutions pk than pk = −M−1rk. For instance, the use of ` stepsof a preconditioned Krylov subspace method for the correction equation issuggested, leading to Arnoldi type of methods in which the variable polyno-mial preconditioning is determined efficiently and the projections have beenincluded correctly. The new methods have been called Jacobi-Davidson meth-ods (Jacobi took proper care of the projections, but did not build a searchsubspace as Davidson did (see [90] for details and further references)).

The analysis and results in [13, 84] show that these Jacobi-Davidson meth-ods can also be effective for solving generalized eigenproblems, even withoutany matrix inversion.

The Jacobi-Davidson methods allow for a variety of choices that may im-prove efficiency of the steps and speed of convergence and are good examplesof AIN methods in which the projected problem (5.7) is used to steer thecomputation.

For an extensive discussion, we refer to [84].

5.7. AIN schemes for general nonlinear problems. In this sectionwe summarize some iterative methods for the solution of nonlinear problemsthat have been proposed by different authors, and we show how these methodsfit in the AIN framework.

Brown and Saad [17] describe a family of methods for solving nonlinearproblems. They refer to these methods as nonlinear Krylov subspace projectionmethods. Their modifications to Newton’s method are intended to enhance

Page 138: Diederik Fokkema - Thesis

124 Chapter 5. Accelerated Inexact Newton schemes

robustness and are heavily influenced by ideas presented in [31]. One of theirmethods is a variant of Damped Inexact Newton, in which they approximatethe solution of the correction equation by a few steps of Arnoldi or GMRES anddetermine the damping parameter α by a “linesearch backtracking technique”.So this is just another AIN scheme, with a special 1-dimensional subspaceacceleration. They also propose a model trust region approach, where theytake their update to the approximation from the Krylov subspace Vm generatedby m steps of (preconditioned) Arnoldi or GMRES as pk = Vmyk, where yk isthe point on the dogleg curve for which ‖yk‖2 = τ , the trust region size: yk

is an approximation for miny ‖F (uk + Vmy)‖2. This could be considered as ablock version of the previous method.

In [4] Axelsson and Chronopoulos propose two nonlinear versions of a(truncated) Generalized Conjugate Gradient type of method. Both meth-ods fit in the AIN framework. The first method, NGCG, is a MinimalResidual AIN method with pk = −rk and Vk orthonormal; in other wordsthe correction equation is not solved. The second method, NNGCG, dif-fers from NGCG in that pk is now computed as an approximate solution(by some method) of the correction equation (5.6), where the accuracy issuch that ‖F (uk)−F ′(uk)pk‖ ≤ ρk‖F (uk)‖, for some non-increasing sequence(ρj), 0 ≤ ρj < 1 (see, e.g., [30]). So the method NNGCG is a Minimal ResidualAIN method. It can be viewed as generalization of GMRESR [105]. Undercertain conditions on the map F they prove global convergence.

In [54], Kaporin and Axelsson propose a class of nonlinear equation solvers(GNKS) in which the ideas presented in [17] and [4] are combined. There, thedirection vectors pk are obtained as linear combinations of the columns of Vm

and Vk. To be more precise, pk = [Vm, Vk]yk, where yk solves miny ‖F (uk +[Vm, Vk]y)‖2. This problem is then solved by a special Gauss-Newton iterationscheme, which avoids excessive computational work, by taking into account theacute angle between rk and Jkpk, and the rate of convergence. The methodgeneralizes GCRO [29].

5.8. Numerical experiments. In this section we test several AIN schemesand present results of numerical experiments on three different nonlinear prob-lems. For tests and test results with methods for linear and eigen problemswe refer to their references. The purpose of this presentation is to show thatacceleration may be useful also in the nonlinear case. By useful, we mean thatadditional computational cost is compensated for by faster convergence.

Different AIN schemes distinguish themselves by the way they (approx-imately) solve the correction equation and the projected problem (cf. Sec-tion 5.3.2 and 5.7). Out of the overwhelming variety of choices we haveselected a few possible combinations, some of which lead to AIN schemes

Page 139: Diederik Fokkema - Thesis

Section 5.8. Numerical experiments 125

that are equivalent to already proposed methods and some of which lead tonew methods. We compare the following (existing) Minimal Residual AINschemes:

• linesearch, the backtracking linesearch technique [17, pp. 458];• dogleg, the model trust region approach as proposed in [17, pp. 462];• nngcg, a variant of the method proposed in [4], solving (5.8) by the

Levenberg-Marquardt algorithm [64];• gnks, the method proposed in [54];

and the (new) Restricted Minimal Residual AIN schemes:• rmr a, choosing Wk = Vk; and• rmr b, choosing Wk = [Wk−1, wk], where wk is the component ofJkpk orthogonal to Wk−1.

For these last two schemes, the minimization problem (5.9) was solved bythe Gauss-Newton variant described in [54]. The necessary subspaces for thedirection pk or the projected problem were obtained by 10 steps of GMRES,or (in the third example) also by at most 50 iterations of the generalized CGSvariant CGS2 [37].

In all cases the exact Jacobian was used. Furthermore, we used orthonormalmatrices Vk and Wk, obtained from a modified Gram-Schmidt process andrestricted to the last 10 columns in an attempt to save computational work.The computations were done on a Sun Sparc 20 in double precision and theiterations were stopped when ‖rk‖2 ≤ 10−6. A method failed, either whenthe convergence was too slow, i.e., when | ‖rk+1‖2−‖rk‖2 | < 10−6‖rk+1‖2, orwhen to number of nonlinear iterations (per step) exceeded 200.

Since the computational cost of the methods is approximately proportionalto the costs of the number of function evaluations and matrix multiplications,the following counters are given in the tables:

• ni, the number of nonlinear iterations;• fe, the number of function evaluations;• mv, the number of multiplications by the Jacobian;• pre, the number of applications of the preconditioner;• total, the sum of fe, mv and pre.

5.8.1. A 1D Burgers’ equation. As a first test problem we considerthe following 1D Burgers’ Equation [52]

∂u

∂t+ sin(2u)

∂u

∂x= µ

∂2u

∂x2 ,

u(x, 0) = g(x), x ∈ Ω,u(x, t) = ψ(x, t), x ∈ ∂Ω,

(5.12)

where Ω = [0, 1].

Page 140: Diederik Fokkema - Thesis

126 Chapter 5. Accelerated Inexact Newton schemes

Method ni fe mv total

linesearch 594 1818 4853 6671dogleg 644 3559 6140 9699nngcg 229 4426 11769 16195gnks 187 852 7067 7919rmr a 230 926 4471 5397rmr b 236 856 4606 5462

Table 5.1. Results for Burgers’ Equation.

We discretized the spatial variable x with finite differences with 64 gridpoints and for the time derivative we used

θun+1 + (1− θ)un =un+1 − un

∆t,

with θ = 23 and ∆t = 10−2. un denotes the solution at time tn = t0 +n∆t. For

this test the solution un was computed for n = 1, 2, . . . , 30 and as an initialguess to un+1 we took un. No preconditioning was used.

In table Tab. 5.1 we show the results for problem (5.12) with

g(x) = π − 2πx, ψ(x, t) = g(x), and µ = 10−2.

A plot of the solutions u1, u2, . . . , u30 is given in Fig. 5.1. The table showsthe cumulative value of the counters for each method after completing thecomputation of u30.

If we look at the number of nonlinear iterations (ni), we see that accel-eration indeed reduces this number. However, in the case of gnks this doesnot result in less work, because the number of matrix multiplications (mv)increases too much. Here both the Galerkin approaches rmr a and rmr b areless expensive than all the other methods. rmr a being the winner.

5.8.2. The Bratu problem. As a second test problem we consider theBratu problem [43, 17]. We seek a solution (u, λ) of the nonlinear boundaryvalue problem:

(5.13) −∆u− λeu = 0 in Ω, u = 0 on ∂Ω.

For Ω we took the unit square and we discretized with finite differences on a31 × 31 regular grid. It is known, cf. [43], that there exist a critical value λ∗

such that for 0 < λ < λ∗, problem (5.13) has two solutions and for λ > λ∗

problem (5.13) has no solutions. In order to locate this critical value we use

Page 141: Diederik Fokkema - Thesis

Section 5.8. Numerical experiments 127

10 20 30 40 50 60

−3

−2

−1

0

1

2

3

x

u

Fig. 5.1. Solution of Burgers’ Equation.

the arc length continuation method as described in [43, section 2.3 and 2.4].Problem (5.13) is replaced by a problem of the form

F (us, λ(s)) = 0,`(us, λ(s), s) = 0,

where `, a scalar valued function, is chosen such that s is some arc lengthon the solution branch and us is the solution of (5.13) for λ = λ(s). Wepreconditioned GMRES by ILU(0) [62] of the discretized Laplace operator ∆.

The first table Tab. 5.2 shows the results after a full continuation run:starting from the smallest solution (u, λ) with λ = 1 the solution branch isfollowed along the (discretized) arc with sn = s0 + n∆s for step-size ∆s = 1and n = 1, 2, . . . , 80. Again we see that acceleration may be useful, in spiteof the fact that there is little room for it, because on the average approxi-mately only 4.5 Newton iterations where necessary to compute the solutionper continuation step. In this example rmr b performs better than rmr a.

Table Tab. 5.3 shows the results for the case where we solve (5.13) forfixed λ = 6.8 (near the critical value). In this case Galerkin acceleration iseven more useful and the differences are more pronounced.

The sup norm of the solution for the different values of λ are plotted inFig. 5.2. The two solutions at λ ≈ 4 along the diagonal of the unit square areshown in Fig. 5.3.

5.8.3. The driven cavity problem. In this Section we present testresults for the classical driven cavity problem from incompressible fluid flow.

Page 142: Diederik Fokkema - Thesis

128 Chapter 5. Accelerated Inexact Newton schemes

Method ni fe mv pre total

linesearch 391 1013 3732 3421 8166dogleg 381 2664 3010 3010 8684nngcg 361 1297 4243 3091 8631gnks 358 1056 6896 2780 10732rmr a 389 539 4005 3399 7943rmr b 361 414 3806 3091 7311

Table 5.2. Results for the Bratu Problem, solved by the arc length continuationmethod.

Method ni fe mv pre total

linesearch 29 85 336 308 729dogleg 27 151 494 260 905nngcg 9 49 196 88 333gnks 38 119 1806 370 2295rmr a 6 13 77 55 145rmr b 6 12 79 55 146

Table 5.3. Single solve of the Bratu Problem, u0 = 0, λ = 6.8.

We follow closely the presentations in [43, 17]. In stream function-vorticityformulation the equations are

ν∆ω + (ψx2ωx1 − ψx1ωx2) = 0 in Ω,−∆ψ = ω in Ω,ψ = 0 on ∂Ω,

∂ψ

∂n(x1, x2)|∂Ω =

1 if x2 = 1,0 if 0 ≤ x2 < 1,

where Ω is the unit square and the viscosity ν is the reciprocal of the Reynoldsnumber Re. In terms of ψ alone this can be written as

ν∆2ψ + (ψx2(∆ψ)x1 − ψx1(∆ψ)x2) = 0 in Ω,

subject to the same boundary conditions. This equation was discretized withfinite differences on a 25× 25 grid, see Fig. 5.4. The grid lines are distributedas the roots of the Chebychev polynomial of degree 25. As preconditioner weused the Modified ILU(2) [46] decomposition of the biharmonic operator ∆2.Starting from the solution for Re = 0, we computed several solutions, using

Page 143: Diederik Fokkema - Thesis

Section 5.8. Numerical experiments 129

0 1 2 3 4 5 6 70

1

2

3

4

5

6

7

8

lambda

sup(

u)

Fig. 5.2. Sup norms of the solu-tion u along the arc.

0 5 10 15 20 25 300

0.5

1

1.5

2

2.5

3

3.5

4

Domain

uFig. 5.3. Solutions u at λ ≈ 4

along the diagonal of the domain.

GMRESMethod ni fe mv pre total

linesearch fails at Re = 400 after a total of 545.dogleg fails at Re = 100 after a total of 113.nngcg fails at Re = 2200 after a total of 19875gnks 641 2315 30206 6210 38731rmr a fails at Re = 2000 after a total of 13078rmr b fails at Re = 800 after a total of 7728

CGS2Method ni fe mv pre total

linesearch fails at Re = 1300 after a total of 4342.nngcg 141 555 7003 6119 13677rmr a 137 297 6266 5969 12532rmr b 137 167 6277 5937 12381

Table 5.4. Results for the Driven Cavity problem, solved by the arc lengthcontinuation method for Re = 100, . . . , 3000.

the the arc length continuation method (cf. the previous example, and [43])with step sizes ∆s = 100 for 0 ≤ Re ≤ 1400, ∆s = 200 for 1400 < Re ≤ 2600,and ∆s = 400 for Re = 3000.

Tab. 5.4 shows the results of this test when using 10 steps of GMRES andCGS2 [37] for the correction equation. In the case of CGS2 we approximatelysolved the correction equation to a relative residual norm precision of 2−k,

Page 144: Diederik Fokkema - Thesis

130 Chapter 5. Accelerated Inexact Newton schemes

Fig. 5.4. Grid for the Driven Cav-ity problem, (25× 25).

0 0.2 0.4 0.6 0.8 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Fig. 5.5. Stream lines of theDriven Cavity problem, Re = 100.

where k is the current Newton step [30], with a maximum of 50 steps. Clearly,the methods using (the basis produced by) 10 steps of GMRES perform verypoorly for this example. Only gnks is able to complete the full continuationrun, but requires a large number of Newton steps. If we look at the resultsfor the AIN schemes for which CGS2 is used, we see that, except for thelinesearch method, these methods perform much better. The RestrictedMinimal Residual methods are again the most efficient ones.

This test also reveals a possible practical drawback of methods like dog-leg and gnks. These methods exploit an affine subspace to find a suitableupdate for the approximation. This may fail, when the problem is hard orwhen the preconditioner is not good enough. In that case the dimension ofthe affine subspace must be large, which may be, because of storage require-ments and computational overhead, not feasible. For the schemes that useapproximate solutions of the correction equation, delivered by some arbitrary,iterative method, e.g., CGS2, one can easily adapt the precision, which leavesmore freedom.

Plots of the stream lines for the values

ψ =− 0.12, −0.1, −0.08, −0.06, −0.04, −0.02,0.0, 0.0025, 0.001, 0.0005, 0.0001, 0.00005

(cf. [43]) are given in Fig. 5.5–5.9. The plots show virtually the same solutionsas in [43].

5.9. Conclusions. We have shown how the classical Newton iterationscheme for nonlinear problems can be accelerated in a similar way as standard

Page 145: Diederik Fokkema - Thesis

Section 5.9. Conclusions 131

0 0.2 0.4 0.6 0.8 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Fig. 5.6. Stream lines of theDriven Cavity problem, Re = 400.

0 0.2 0.4 0.6 0.8 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Fig. 5.7. Stream lines of theDriven Cavity problem, Re = 1600.

0 0.2 0.4 0.6 0.8 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Fig. 5.8. Stream lines of theDriven Cavity problem, Re = 2000.

0 0.2 0.4 0.6 0.8 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Fig. 5.9. Stream lines of theDriven Cavity problem, Re = 3000.

Richardson-type iteration schemes for linear equations. This leads to the AINframework in which many well-known iterative methods for linear, eigen, andgeneral nonlinear problems fit. From this framework an overwhelming numberof possible iterations schemes can be formulated. We have selected a fewand shown by numerical experiments that especially the Restricted MinimalResidual methods can be very useful for further reducing computational costs.

Page 146: Diederik Fokkema - Thesis

132 Chapter 5. Accelerated Inexact Newton schemes

Page 147: Diederik Fokkema - Thesis

Chapter 6

JACOBI-DAVIDSON STYLE QR AND QZ ALGORITHMS FORTHE PARTIAL REDUCTION OF MATRIX PENCILS

DIEDERIK R. FOKKEMA , GERARD L. G. SLEIJPEN , AND

HENK A. VAN DER VORST

Abstract. The Jacobi-Davidson subspace iteration method offers possibilities for solv-ing a variety of eigenproblems. In practice one has to apply restarts because of memorylimitations, in order to restrict computational overhead, and also if one wants to computeseveral eigenvalues. In general, restarting has negative effects on the convergence of subspacemethods. We will show how effective restarts can be incorporated in the Jacobi-Davidsonmethods, very similar to the implicit restart procedure for the Arnoldi process. We willpresent two algorithms, JDQR for the standard eigenproblem, and JDQZ for the general-ized eigenproblem, that are based on the iterative construction of the (generalized) partialSchur form with the Jacobi-Davidson approach. The algorithms are suitable for the efficientcomputation of several (even multiple) eigenvalues, and the corresponding eigenvectors, neara user-specified target value in the complex plane.

Key words. Linear eigenproblems; Generalized eigenproblems; Schur form; GeneralizedSchur form; QR-algorithm; QZ-algorithm; Jacobi-Davidson; Iterative methods

AMS subject classifications. 65F15, 65N25

6.1. Introduction. In this paper we propose two iterative methods, onefor computing solutions of the standard eigenproblem

(6.1) (A− λ I)q = 0,

and the other for computing solutions for the generalized eigenproblem∗

(6.2) (βA− αB)q = 0,

where A and B are large and sparse (n× n)-matrices, which may be complexand/or non-normal. Of course, with B = I the generalized eigenproblemreduces to a standard eigenproblem, and we could have restricted ourselves to

∗The family A − λB is called a matrix pencil and the generalized eigenvalues 〈α, β〉,solutions of (6.2), are also called eigenvalues of the matrix pencil (cf. e.g., [96]).

Page 148: Diederik Fokkema - Thesis

134 Chapter 6. Jacobi-Davidson style QR and QZ algorithms

the generalized eigenproblem case. However, simplifications are possible whenB = I, that help reduce the memory requirements and the computationalcomplexity. For this reason, and also since the standard problem allows fora less complicated description, we have chosen to consider both situations indetail.

Our algorithms are based on the Jacobi-Davidson method described in [90],and adapted for generalized eigenproblems (and other polynomial eigenprob-lems) in [84]. We have chosen the Jacobi-Davidson approach for the compu-tation of a partial Schur form for the standard eigenproblem, and for a partialgeneralized Schur form for the generalized eigenproblem. The partial Schurforms have been chosen mainly for numerical stability, since they involve or-thogonal bases. These bases are also useful for deflation, another ingredient ofour algorithms.

In the Jacobi-Davidson approach a search subspace is generated onto whichthe given eigenproblem is projected. The much smaller projected eigenprob-lem is solved and this leads to approximations for the wanted eigenvectors andeigenvalues of the given larger problem. This is the ‘Davidson’ part of themethod. Then, a correction equation for a selected eigenpair is considered.The solution of the correction equation defines an orthogonal correction forthe current eigenvector approximation (in fact if the exact value for the eigen-value would have been known, then the correction equation defines the exacteigenvector); this is the ‘Jacobi’ part of the algorithm. The correction is thenused for the expansion of the search subspace and the process is repeated.The correction equation may be solved by any method of choice, and for largeproblems it is often more efficient to solve this equation only approximatelyby some iterative method. The speed of convergence of this iterative methodmay be improved by preconditioning, and this is where in the Jacobi-David-son method preconditioning takes place. It should be noted that the precon-ditioning does not affect the given eigenproblem. By including shifts in theJacobi-Davidson method, and by a proper selection of the approximate eigen-pair for the correction equation, the process can be guided to find eigenpairsclose to a given target value. More details will be given in Section 6.2.1 andSection 6.3.1, and for a complete description of the Jacobi-Davidson methodwe refer to [90, 84].

A problem in the Jacobi-Davidson method is that convergence towards aspecific eigenvalue is favored, and for efficient computation of several eigen-values, one has to apply the usual restart with a different target. Because ofmemory limitations one may also be forced to restart, even before an eigenpairis found. Restarts have the disadvantage that a subspace, that may containvery useful information, is replaced by one single vector, so that much valuableinformation is lost. This problem has been solved elegantly for the Arnoldimethod [94], and our approach (cf. Section 6.2.2 and Section 6.3.2) is related to

Page 149: Diederik Fokkema - Thesis

Section 6.1. Introduction 135

this (see also [90, Section 5.3]). For the Jacobi-Davidson method this problemis solved by our new algorithms. In these algorithms the given large system isprojected on a suitably filtered subspace, and this leads to a similar, but muchsmaller, problem. The projected problem is reduced to Schur form by eitherthe QR [38] or the QZ [63] method. Also the construction of the subspace andthe projected system may be viewed as iterative inexact forms of QR and QZ.For this reason we have named our new methods JDQR and JDQZ, respec-tively. JDQR generates a partial Schur form for the standard eigenproblem, apartial “QR-decomposition”; JDQZ produces a partial generalized Schur formfor the generalized eigenproblem, a partial “QZ-decomposition”.

Our Section 6.2 focuses on the standard eigenproblem and is organized asfollows. The Jacobi-Davidson method is briefly discussed in Section 6.2.1. InSection 6.2.2, the original algorithm of [90] is slightly adapted, by incorporatingan ordered Schur decomposition of the projected eigenproblem. An orderedSchur form can be used to select the approximate eigenpair and to select aproperly limited sized subspace for continuing the process. This culminatesin the construction of the JDQR method, in Section 6.2.3: by combining theSchur decomposition of the projected problem with the iteratively obtainedpartial Schur decomposition of the given large problem, a simple and efficientalgorithm is obtained. The rate of convergence of Jacobi-Davidson depends onthe accuracy by which the correction equation is solved. If it is solved itera-tively, then it may be attractive to include preconditioning. This requires extracare because of the projection operations included in the correction equation;attention to this will be paid in Section 6.2.4. In our approach, a precondi-tioner constructed for one Ritz pair appears to be effective also for nearby Ritzpairs (see Section 6.2.7). Some observations on the selection of approximateeigenpairs are made in Section 6.2.5. In Section 6.2.6, it is explained thatthe search subspace for the obtained partial Schur decomposition provides asuitable limited subspace for continuing the iterative process.

The generalized eigenproblem is central in Section 6.3, where JDQR isgeneralized to JDQZ. The JDQZ approach basically allows for two differentchoices for constructing the projected problem (cf. Sections 6.3.1 and 6.3.5),one of which is very useful for computing interior eigenvalues. For such eigen-values, it appears to be more effective to select more carefully the approxi-mate eigenpairs than to strive for optimal expansion of the search subspace(cf. Section 6.3.5). The derivation of JDQZ is given in Section 6.3.3, while inSection 6.3.4 it is explained how preconditioning for the correction equationcan be incorporated.

In Section 6.4, we illustrate the convergence behavior of JDQR and JDQZwith numerical experiments for a number of eigenproblems. Aspects that areinvestigated concern, amongst others, the accuracy of the solution of the cor-rection equation (Section 6.4.1), the effect of preconditioning (Section 6.4.2),

Page 150: Diederik Fokkema - Thesis

136 Chapter 6. Jacobi-Davidson style QR and QZ algorithms

multiple eigenvalues (Section 6.4.3 and Section 6.4.7), interior eigenvalues (Sec-tion 6.4.4 and Section 6.4.8), and different approaches for the construction ofthe projected problem (Section 6.4.4 and Section 6.4.8), and implicit versusexplicit deflation (Section 6.4.6).

Section 6.5 contains our conclusions.

Remark 6.1 All computations can be done in complex arithmetic if necessary.An alternative for real matrices would be to use quasi Schur forms with 2× 2blocks on the diagonal, which can be done in real arithmetic. It is possible toderive a variant of Jacobi-Davidson based on this blocked form. However, thisvariant will necessarily also involve a blocked version of the correction equation,which will double the computational work per iteration step. The constructionof a suitable block-preconditioner may be a problem as well. Hence, it is notclear whether implementations with quasi Schur forms may be competitive,and we will not discuss this possibility further in this paper.

Remark 6.2 With bold face letters we indicate that variables are associatedwith the large n-dimensional space, and for low dimensional spaces we useitalic letters.We use a tilde to indicate that a quantity approximates the correspondingquantity without tilde: q approximates q, etc.. The algorithms are given inMATLAB-style. We use the MATLAB conventions when we refer to entriesin matrices and vectors. In particular, where in the algorithms new valuesoverwrite old ones, the tildes are deleted.

6.2. The standard eigenproblem. We will focus on the standard eigen-problem (6.1) in this section.

6.2.1. Jacobi-Davidson. For the standard eigenproblem, Jacobi-David-son selects the approximate eigenvector from a search subspace spanV thatis expanded in each step. Each step consists of two parts. In the first part,the ‘Davidson’ part, the projected eigenproblem

(6.3) (V∗AV − λV∗V)u = 0,

is solved and a solution (u, λ) is selected. The Ritz value λ and the Ritz vectorq ≡ Vu form an approximate eigenvalue and eigenvector, respectively, withresidual r ≡ (A− λ I) q (we will assume that ‖q‖2 = 1). Observe that r ⊥ q.In the second part, the ‘Jacobi’ part, the search subspace is expanded by avector v ⊥ q, that solves (approximately) the correction equation

(6.4) q∗v = 0 and (I− q q∗)(A− λ I)(I− q q∗)v = −r.

The expanded search subspace is spanV,v. In exact arithmetic, V is anorthogonal matrix, V∗V = I. We have used modified Gram-Schmidt in our

Page 151: Diederik Fokkema - Thesis

Section 6.2. The standard eigenproblem 137

computations for the construction of an orthogonal basis of the search sub-space.

As observed in the introduction, if λ is replaced in the correction equa-tion (6.4) by an eigenvalue λ, then the associated eigenvector is contained inthe space spanned by V and the exact solution of the correction equation.Usually we have no better estimate for λ than the Ritz value λ and then thesolution of the correction equation is the best we can do for expansion. If thiscorrection equation (6.4) is solved exactly, then the speed of convergence forthe selected Ritz values is asymptotically quadratical (cf. [90, 84]).

In our applications, the projected problem (6.3) will be of relatively smalldimension, i.e., dim(spanV) n, and can be solved efficiently by standardalgorithms for dense problems.

6.2.2. Practical selection and implicit restart. If we reduce the pro-jected eigenproblem (6.3) to Schur form by the QR algorithm [38], then we canexploit the Schur form for the selection of a Ritz pair (q, λ), and for restrictionof the dimension of the subspace spanV, in the following way.

Suppose we are interested in the eigenpair(s) with eigenvalue close to somespecified target value τ , and suppose that the Schur form of the interactionmatrix M ≡ V∗AV, given by

MU = US, U∗U = I, and S upper triangular,

is ordered such that

(6.5) |S(1, 1)− τ | ≤ |S(2, 2)− τ | ≤ · · · ≤ |S(j, j)− τ |,

where j is the dimension of spanV. Then

(6.6) (q, λ) ≡ (VU(:, 1), S(1, 1))

is the Ritz approximation corresponding to the projected system (6.3) withRitz value closest to the target τ . Furthermore, VU(:, 1:i), with i < j, spansthe subspace that has the best information for the i eigenvalues closest to τ .Therefore, if we want to reduce the dimension of the search subspace from j tojmin, jmin < j, then we discard the columns vjmin+1 through vj , and continuethe JD algorithm with

(6.7) V = VU(:, 1:jmin).

It is convenient that VU(:, 1:jmin) is already orthogonal.We refer to this reduction strategy as implicit restart.

Remark 6.3 Our restart strategy follows similar ideas as in the ImplicitlyRestarted Arnoldi (IRA) [94]. However, in [94] implicit shifts are used to

Page 152: Diederik Fokkema - Thesis

138 Chapter 6. Jacobi-Davidson style QR and QZ algorithms

Part dots axpys MVs

The correction equation variableThe projected problem 3j j − 1 1a

Ritz approximation 1 j 1b

Restart 0 2jmin 0

aIf Krylov subspace methods are used to solve the correction equation, then theproduct Av is often already available, as a side-product. No MV is needed in thispart then.

bInstead of computing the residual r as (A − λ I)q, r may also be computed

as VAU(:, 1) − λq, where VA ≡ AV (cf. Alg. 6.1); depending on the number ofnonzeros in A and the value of j, this may be more efficient.

Table 6.1. The computational costs of implicitly restarted JD per iteration. jis the dimension of spanV.

delete the unwanted part, instead of explicitly selecting the wanted portionof the Krylov subspace as we do. The situation for IRA is more complicatedbecause the reduced search subspace has to be a Krylov subspace. For furtherdetails, see [94, 58].

A reordering algorithm for the Schur form can be found in, for instance, [95,44, 76]; a Fortran implementation is available from LAPACK [1]. A simpleMATLAB implementation for reordering with respect to a target value τ , isgiven in Appendix 6.B. For completeness, a theoretical justification is giventhere as well.

In Alg. 6.1, an implementation of the JD algorithm for the standard eigen-problem is given in MATLAB-style. This implementation includes the implicitrestart option based on ordered Schur forms. It also includes reordering, and isadjusted for one eigenvalue closest to a target τ . This “basic” algorithm will beextended for the computation of a number of eigenvalues in the neighborhoodof τ (in Section 6.2.3), and preconditioning will be included (Section 6.2.4).

Remark 6.4 In the implementations of our algorithms, we consider an ap-proximate eigenpair (q, λ) converged if the residual r is sufficiently small(‖r‖ ≤ ε); then (q, λ) is a “detected” eigenpair. Weighted residuals (e.g.,‖r‖ ≤ ε‖A‖) or more sophisticated stopping criteria can be employed as well(cf. [21]).

In Tab. 6.1 we have listed the main computation-intensive ingredients periteration of JD.

Page 153: Diederik Fokkema - Thesis

Section 6.2. The standard eigenproblem 139

function [q, λ ] = JD (A, τ,v0, ε, jmax, jmin)V = [ ]; VA = [ ]; M = [ ];j = 0; found = 0;while ∼ found,

if j == 0,v = v0;

else— the correction equation —Solve v (approximately) from:

q∗v = 0 and(I− qq∗)(A− λ I)(I− qq∗)v = −r.

end— the projected problem —v = mgs (V,v); v = v/‖v‖2; vA = Av;M = [M,V∗vA;v∗VA,v∗vA];V = [V,v ]; VA = [VA,vA];[U, S ] = schur (M); [U, S ] = qrsort (τ, U, S);j = j + 1;— Ritz approximation —λ = S(1, 1); q = VU(:, 1);r = (A− λ I)q;found = (‖r‖2 < ε),— “found and implicit restart” —if found,

break;elseif j == jmax,

— implicit restart —j = jmin; J = [ 1:j ];V = VU(:, J); VA = VA U(:, J);S = S(J, J); M = S; U = I;

endend

JD returns an eigenpair (q, λ) of the matrix A with λ near the target τ . v0 is aninitial guess, and ε is the stopping tolerance. jmax and jmin specify the dimension ofthe subspace V before and after implicit restart, respectively. schur is a MATLABfunction that computes a Schur decomposition MU = US. The functions mgs(modified Gram-Schmidt) and qrsort (Sort Schur form) are given in Appendix 6.B.

Alg. 6.1. JD with implicit restart.

Page 154: Diederik Fokkema - Thesis

140 Chapter 6. Jacobi-Davidson style QR and QZ algorithms

6.2.3. JDQR. Now we focus on the efficient computation of severaleigenpairs. The idea is to use the JD algorithm for the computation of apartial Schur form, which is defined as follows (cf. [80]).

Definition 6.1 A partial Schur form of dimension k for a matrix A is thefollowing decomposition:

AQk = QkRk

where Qk is an orthogonal (n × k)-matrix, and Rk is an upper triangular(k × k)-matrix. A column qi of the matrix Qk is a Schur vector, and the pair(qi, λi), with λi = Rk(i, i), is a Schur pair.

The diagonal entries of the matrix Rk represent eigenvalues of A, and if(x, λ) is an eigenpair of Rk then (Qkx, λ) is an eigenpair of A.

Steps I, II, and III below represent the JDQR algorithm for computing apartial Schur form. A MATLAB implementation of JDQR is not given untilSection 6.2.4, where preconditioning for the correction equations is discussed.I. For the first Schur pair, we apply the JD algorithm. This leads to a searchsubspace V. For the interaction matrix M ≡ V∗AV we compute an orderedSchur form MU = US. The first Schur pair of the projected problem is takenas the approximation to a Schur pair of the original large eigenproblem. Thisis used for the correction equation (6.4), of which the (approximate) solutionv gives the expansion of the subspace (V is expanded with the orthogonalcomplement v′ of v to V). With the expanded subspace V = [V,v′] we con-struct again the Schur form for the corresponding interaction matrix, and thisprocess is repeated until a Schur pair has been detected. Upon convergence,when spanV is of dimension j, say, the subspace reduced by the detectedSchur vector, V = VU(:, 2:j), can be used as the starting subspace for a newSchur pair.II. Now suppose that k − 1 Schur pairs have been detected, i.e., we alreadyhave the partial Schur form AQk−1 = Qk−1Rk−1. We want to expand Qk−1,with a suitable q, so that

(6.8) A[Qk−1 q

]=

[Qk−1 q

] [Rk−1 s

0 λ

].

The new Schur pair (q, λ) should satisfy

Q ∗k−1q = 0 and (A− λ I)q−Qk−1s = 0,

or, since s = Q ∗k−1(A− λ I)q,

Q ∗k−1q = 0 and (I−Qk−1Q ∗

k−1)(A− λ I)q = 0.

Page 155: Diederik Fokkema - Thesis

Section 6.2. The standard eigenproblem 141

Hence, (q, λ) satisfies

(6.9) Q ∗k−1q = 0 and (I−Qk−1Q ∗

k−1)(A− λ I)(I−Qk−1Q ∗k−1)q = 0,

and the Schur pair (q, λ) is therefore also an eigenpair of the deflated matrix

(6.10) (I−Qk−1Q ∗k−1)A(I−Qk−1Q ∗

k−1).

We solve this eigenproblem, by the procedure sketched in I., for the deflatedmatrix (6.10). More precisely, the JD algorithm for the deflated matrix (6.10)constructs a subspace spanV for finding approximate eigenpairs, and V isan orthogonal matrix such that V∗Qk−1 = 0. For the deflated interactionmatrix M we have

(6.11) M ≡ V∗(I−Qk−1Q ∗k−1)A(I−Qk−1Q ∗

k−1)V = V∗AV.

The ordered Schur form MU = US (see (6.5)) gives an approximation (q, λ) ≡(VU(:, 1), S(1, 1)) for a wanted eigenpair of the deflated matrix (6.10). Then,according to the Jacobi-Davidson approach, the search subspace spanV isexpanded by the orthogonal complement of v to V, where v is the (approxi-mate) solution of the deflated correction equation(6.12)

Q ∗k−1v = 0, q∗v = 0 and

(I− q q∗)(I−Qk−1Q ∗k−1)(A− λ I)(I−Qk−1Q ∗

k−1)(I− q q∗)v = −r,

where r ≡ (I−Qk−1Q ∗k−1)(A− λ I)(I−Qk−1Q ∗

k−1) q.Note that the projections in (6.12) can be subdivided into two parts; the

part (I − q q∗) associated with Jacobi-Davidson, and the deflation part (I −Qk−1Q ∗

k−1). Observe also that Q∗k−1r = 0 and q∗r = 0.

III. When the Schur pair (q, λ) is sufficiently close to (q, λ), then we maycontinue for still another Schur pair. In that case, the matrix V of dimensionn × j, say, is reduced to VU(:, 2:j), in order to obtain a subspace orthogonalto spanQk−1, q, and we continue the process.

Remark 6.5 Two deflation techniques can be found in literature for methodslike Arnoldi. They are referred to as explicit and implicit deflation (cf., e.g.,[80, Ch. VI, Section 2.3]). In explicit deflation, the computation is continuedwith a deflated matrix after detection of Schur vectors. For efficiency reasons,A −QΛQ∗ is used (Schur-Wielandt deflation), rather than the more stablerepresentation (I−QQ∗)A(I−QQ∗). In implicit deflation, each new vectorfor the search subspace is generated with A itself and is then made orthogonalto the detected Schur vectors, before adding it to the search subspace. Ourapproach, is a mixture of both techniques. In the correction equation we use

Page 156: Diederik Fokkema - Thesis

142 Chapter 6. Jacobi-Davidson style QR and QZ algorithms

the deflated matrix. Since the solutions of the deflated correction equations areorthogonal to the detected Schur vectors, there is no need to use the deflatedmatrix for obtaining the deflated interaction matrix M ; we compute M asM = V∗AV.

When we use Krylov subspace methods for the solution of the correctionequation, then the work with either of the two representations of the deflatedmatrix is the same (cf. Remark 6.9).

Exclusively implicit deflation is possible as well: solve the correction equa-tion approximately with the non-deflated A and put the resulting solutionorthogonal to the detected Schur vectors. In this approach we avoid expen-sive matrix vector multiplications, but explicit deflation appears to improvethe condition number of the linear system, and this leads to a faster converg-ing process for the correction equation (6.4). The decrease of the number ofiteration steps, for the correction equation, appears often to compensate forthe more expensive multiplications (for a numerical illustration of this, seeSection 6.4.6).

Moreover, the deflated correction equations (6.12) appear to lead to morestable results. This can be understood as follows. Without deflation the re-sulting solution of the correction equation may have a significant componentin the space spanned by the detected Schur vectors. By subtracting this com-ponent (as in implicit deflation) cancellation may occur. If we work with anexplicitly deflated matrix, such cancellation is avoided.

Remark 6.6 As in implicitly deflated Arnoldi methods, the accuracy of anapproximate Schur pair in our method does not only depend on the norm of theresidual and the condition number of the pair, but also on the approximationerrors in the previously detected Schur pairs (cf. e.g., [80, Ch. IV, Section 2.5]and [58, Section 6.4.1]): in the derivation of the algorithms it is assumedthat V∗Q = 0 implies V∗AQ = 0, which is true for exact Schur vectors. Inpractice, spanAQ will not be contained in spanQ.

6.2.4. Preconditioning. In this section we will discuss preconditioningfor the correction equation. Preconditioning is not straight forward, becauseof the projections involved. We will derive explicit expressions for left andright preconditioned correction equations.

In each iteration step we need to solve a deflated correction equation (6.12),for a given q and λ. For the approximate solution of this equation we may usea Krylov subspace method, e.g., GMRES [82], or BiCGstab(`) [85]. The rate ofconvergence and the efficiency of Krylov subspace methods is often improvedby preconditioning. The identification of an effective preconditioner may be aproblem. For instance, for interior eigenvalues the construction of an effective

Page 157: Diederik Fokkema - Thesis

Section 6.2. The standard eigenproblem 143

incomplete LU-factorization [62, 46] for A−λI may require much fill-in†, whichmakes the construction expensive. As we will argue in Section 6.2.7, it maybe a good strategy to compute a preconditioner K for A− τI for a fixed valueof τ only, and to use

(6.13) K ≡ (I− q q∗)(I−Qk−1Q ∗k−1)K(I−Qk−1Q ∗

k−1)(I− q q∗)

as the preconditioner for various q and λ. Note that the projections on K arenecessary to let K operate on the proper subspace (cf. [84]).

We will now derive the expressions for the preconditioned correction equa-tion. For convenience, we introduce the following notations:

Notation 6.1

Qk ≡ [Qk−1, q ], the matrix Qk−1 expanded by the approximateSchur vector q,

Yk ≡ K−1Qk,the matrix of the preconditioned “Schur” vec-tors,

Hk ≡ Q ∗k Yk , the projected preconditioner Q ∗

k K−1Qk.

A typical use of the preconditioner in a Krylov subspace method, for ourpurposes looks like:

(6.14)solve t,with Q ∗

k t = 0, from

(I− QkQ ∗k )K (I− QkQ ∗

k ) t = sfor s, with Q ∗

k s = 0,

where K is a preconditioner for A− τ I.The following identities, formulated in a lemma, are useful for obtaining

an explicit expression for the solution of (6.14).

Lemma 6.1 If Hk is nonsingular, then

(I− Yk H−1k Q ∗

k )(I− QkQ ∗k ) = (I− QkQ ∗

k ),(6.15)

(I− QkQ ∗k )(I− Yk H

−1k Q ∗

k ) = (I− Yk H−1k Q ∗

k ),(6.16)

(I− Yk H−1k Q ∗

k )K−1(I− QkQ ∗k ) = (I− Yk H

−1k Q ∗

k )K−1.(6.17)

†These incomplete factorizations have not been designed for linear systems related toeigenproblems. The solutions for which these factorizations are most effective are usuallyrather smooth, which means that components of slowly varying eigenvectors are favored bythe preconditioning.

Page 158: Diederik Fokkema - Thesis

144 Chapter 6. Jacobi-Davidson style QR and QZ algorithms

Proof. These identities follow straight forward from expanding the products.For example:

(I− Yk H−1k Q ∗

k )(I− QkQ ∗k ) = (I− Yk H

−1k Q ∗

k )− (I− Yk H−1k Q ∗

k ) QkQ ∗k

= (I− Yk H−1k Q ∗

k )− (QkQ ∗k − Yk H

−1k Q ∗

k )

= (I− QkQ ∗k ).

The following lemma gives us an explicit expression for the solution tof (6.14), in terms of easily computable matrix vector products with H−1

k andK−1. The lemma generalizes Prop. 7.5 in [84]. Note that Hk is of small di-mension, so it is easily inverted. K has never to be explicitly inverted, insteadv = K−1s can be computed by solving v from Kv = s.

Lemma 6.2 If Hk is nonsingular, then the solution t of equation (6.14) isgiven by

(6.18) t = (I− Yk H−1k Q ∗

k )K−1s,

Proof. The expression (6.18) follows from multiplying (6.14) by (I −Yk H

−1k Q ∗

k )K−1, and using identities of Lemma 6.1.

Remark 6.7 If one stores the matrix Yk−1 ≡ K−1Qk−1 of preconditionedSchur vectors, one only has to compute the last column K−1q of the matrixYk = [Yk−1 ,K−1q ], at each iteration step. Furthermore, when storing theprojected preconditioner Hk−1 ≡ Q ∗

k−1 K−1Qk−1, only the last column andlast row of

Hk =[Hk−1 Q ∗

k K−1qq∗Yk q∗K−1q

]have to be computed in an iteration step.

Remark 6.8 If the preconditioner K is indefinite, then the matrix Hk maybecome singular, for an “unlucky” choice of approximate Ritz pair (q, λ). Thiscauses a breakdown, but it never happened in our experiments. The breakdownmay be cured by selecting a different nearby approximating Ritz pair (q′, λ′)temporarily, for the current Jacobi-Davidson iteration.

Left preconditioning. From Lemma 6.2, it follows that the left preconditionedcorrection equation is equivalent with(6.19)

Q ∗k v = 0 and (I− Yk H

−1k Q ∗

k )K−1(A− λ I)(I− Yk H−1k Q ∗

k )v = −r,

where r ≡ (I− Yk H−1k Q ∗

k )K−1r (cf. [84, Th. 7.4]).

Page 159: Diederik Fokkema - Thesis

Section 6.2. The standard eigenproblem 145

Note that the projection has to be applied explicitly to the residual. For theunpreconditioned case there was no need for explicit projection, since there,the fact that the residual is associated with a deflated matrix and with a Ritzpair, implied orthogonality to Qk.

Observe that, for K = I, this equation (6.19) is equivalent to the one in(6.12).

Right preconditioning. Also right preconditioning for the correction equationmay be used.With Yk ≡ (K∗)−1Qk, this leads to

(6.20) Y∗k v = 0 and (I−QkH

−1k Y∗

k )(A−λ I)K−1(I−QkH−1k Y∗

k )v = −r,

where r ≡ (I − QkH−1k Y∗

k ) r. The vector v can be obtained from v by v =K−1v.

Remark 6.9 If one uses Krylov subspace methods for solving the second equa-tion in (6.19), then one encounters matrix vectors products of the form

(6.21) (I− Yk H−1k Q ∗

k )K−1(A− λ I)(I− Yk H−1k Q ∗

k ) t,

with t of the form t = (I− Yk H−1k Q ∗

k ) s. Then, obviously, Q ∗k t = 0, and for

the approximate solution v it holds that Q ∗k v = 0, if that is the case for the

initial guess. Moreover, the projection (I− Yk H−1k Q ∗

k ) in front of t in (6.21)is redundant then, and (6.21) reduces to

(6.22) (I− Yk H−1k Q ∗

k )K−1(A− λ I) t,

A similar remark applies for (6.20).

A pseudo-code for the preconditioned Jacobi-Davidson QR algorithm isgiven in Alg. 6.2.

In Tab. 6.2 we have listed the main computational ingredients per iterationof JDQR.

6.2.5. The selection of Ritz pairs. At each iteration step of the Jacobi-Davidson method, an approximate eigenpair (q, λ) has to be selected from theRitz pairs (Vui, θi), that are solutions of the projected eigenproblem (V∗AV−θ I)u = 0. For the selected Ritz pair, the correction equation provides theoptimal expansion of the search subspace. However, the speed of convergencealso depends on the ability to identify the most suitable Ritz pair (see also [90,Section 5]).

A poor choice of the Ritz pair will lead to an expansion of the search sub-space in a poor direction. This affects the convergence to the wanted eigenvec-tor, and this is a situation that we want to avoid. For limiting the dimension

Page 160: Diederik Fokkema - Thesis

146 Chapter 6. Jacobi-Davidson style QR and QZ algorithms

function [Q, R ] = JDQR (A,K, τ,v0, ε, kmax, jmax, jmin)Q = [ ]; R = [ ]; Y = [ ]; H = [ ];V = [ ]; VA = [ ]; M = [ ];k = 0; j = 0;while k < kmax,

if j == 0,v = v0;

else— the correction equation —r = (I− YH−1Q∗)K−1r;Solve v (approximately) from:

Q∗v = 0 and

(I− YH−1Q∗)K−1(A− λ I)(I− YH−1Q∗)v = −r.end— the projected problem —v = mgs (V,v); v = v/‖v‖2; vA = Av;M = [M,V∗vA;v∗VA,v∗vA ];V = [V,v ]; VA = [VA,vA ];[U, S ] = schur (M); [U, S ] = qrsort (τ, U, S);j = j + 1; found = 1;while found,

— Ritz approximation —λ = S(1, 1); q = VU(:, 1); y = K−1q;r = (A− λ I)q; [ r, s ] = mgs (Q, r);Q = [Q,q ]; Y = [Y,y ]; H = [H,Q∗y;q∗Y,q∗y ];

...“found and implicit restart part”, see Alg. 6.3

...end

end

JDQR returns a partial Schur form (Q, R) of the matrix A of dimension kmax witheigenvalues near the target τ . K is a preconditioner for A − τ I, v0 is an initialguess, and ε is the stopping tolerance. jmax and jmin specify the dimension of thesubspaces V before and after implicit restart, respectively. schur is a MATLABfunction that computes a Schur decomposition. The functions mgs (modified Gram-Schmidt) and qrsort (Sort Schur form) are given in Appendix 6.B.

Alg. 6.2. Preconditioned JDQR.

Page 161: Diederik Fokkema - Thesis

Section 6.2. The standard eigenproblem 147

found = (‖r‖2 < ε) & (j > 1 | k = kmax − 1);if found,

— found —Q = Q; R = [R, s; zeros (1, k), λ ];k = k + 1; if k == kmax, break; end

Y = Y; H = H;J = [ 2:j ]; j = j − 1;V = VU(:, J); VA = VA U(:, J);S = S(J, J); M = S; U = I;

elseif j == jmax,— implicit restart —j = jmin; J = [ 1:j ];V = VU(:, J); VA = VA U(:, J);S = S(J, J); M = S; U = I;

end

Alg. 6.3. “Found and implicit restart part” of JDQR.

Part dots axpys MVs KThe correction equation variableThe projected problem 3j j − 1 1a 0Ritz approximation k + 1 j + k 1b 1Found 0 2j − 2 0 0Restart 0 2jmin 0 0

aIf Krylov subspace methods are used to solve the correction equation, then theproduct Av is often already available as a side-product. No MV is needed in thispart then.

bInstead of computing the residual r as (A − λ I) q, r may also be computed

as VAU(:, 1) − λ q, where VA ≡ AV (cf. Alg. 6.2); depending on the number ofnonzeros in A and the value j, this may be more efficient.

Table 6.2. The computational costs of JDQR per iteration. The integers j andk are the dimensions of spanV and spanQ, respectively.

of the search subspace (cf. Section 6.2.2), it is even more important to avoidpoor selections, because by discarding correct information, convergence can behampered, and even completely destroyed.

Suppose we are interested in the eigenpair(s) with eigenvalue close to somespecified target value τ . By selecting the pair with Ritz value closest to thetarget value, we hope to have the best approximation that is available in the

Page 162: Diederik Fokkema - Thesis

148 Chapter 6. Jacobi-Davidson style QR and QZ algorithms

search subspace. With respect to extremal eigenvalues, at least for standardnormal eigenproblems, this approach can be justified theoretically as follows.

Recall that, for normal matrices, Ritz values are convex combinations ofeigenvalues, and consider the Ritz value λ that is close to an extremal eigen-value λ (an extreme point of the field of values). Then the λ-component in theconvex combination for λ will be the largest with a size depending on the sepa-ration of λ and the distance of λ to λ. Correspondingly, among all eigenvectorcomponents of the Ritz vector associated with λ, the component of the Ritzvector, in the eigenvector direction associated with λ, will be the largest inmodulus (the components for eigenvectors are square roots of the correspond-ing components of eigenvalues). If λ is still not close to λ, as in the initialstage of the process, the fact that (for symmetric problems) extremal eigen-values optimize the Rayleigh quotient on the whole space, while extremal Ritzvalues optimize this quotient on the search subspace, may provide some confi-dence that the extremal Ritz values are the most appropriate approximationsfor the extremal eigenvalues. For interior eigenvalues λ, convex combinationsof eigenvalues, in which the λ-component is small or even zero, can be close (oreven equal) to λ: the Ritz value closest to the target value may be associatedwith a Ritz vector of which the angle with the target eigenvector is much largerthan for other Ritz vectors. In [65, 70, 90] it is suggested to use harmonic Ritzpairs for these eigenvalues. As we will see in Section 6.3.5.1, the harmonic Ritzvalue closest to the target value can be viewed as an extremal Ritz values fora related problem. Therefore, we also adopt this approach. However, sincethe definition of harmonic Ritz values fits better in the context of generalizedeigenproblems, we postpone our discussion on this subject to our treatmentof generalized eigenproblems in Section 6.3.1. For the standard problem, weconsider also a strategy for selecting standard Ritz values closest to the targetvalue, also if the target is in the interior of the spectrum.

6.2.5.1. Identification of suitable Ritz values (tracking). If theRitz vector in the previous iteration is already a fair approximation, thenthe norm of the residual gives information on the selected Ritz vector in thecurrent step: in case of a poor selection, the new residual can be much largerthan the previous one. It would then require additional computational workto find a Ritz pair with small residual norm (and still close enough to thetarget τ). A cheap alternative in this case is to select a Ritz value that isclose to a previously accepted one (and forget about τ). In our experimentswe have replaced in such cases the target by the Ritz value that is selectedand accepted in the previous step, where we consider a Ritz value acceptableif the associated residual is smaller than some specified threshold εtr. Afterconvergence of the Ritz pair, the original target value is restored at the startof the computation for the next eigenpair.

Page 163: Diederik Fokkema - Thesis

Section 6.2. The standard eigenproblem 149

This tracking strategy does not require any additional computational costs perstep, while it appears to reduce the number of steps significantly.

In view of the discussion in Section 6.2.5 for extremal eigenvalues, im-provement for these eigenvalues may not expected with the tracking strategyfor normal problems.

6.2.6. Notes on the speed of convergence. The JDQR algorithm hasnice properties with respect to the overall performance. While adjusting forone Schur pair, the subspace spanV also accumulates components for otherSchur pairs. As a result, after one Schur pair has been detected, other Schurpairs may follow more quickly than after a complete restart. These componentswill appear in a similar way as for the Shift-and-Invert Arnoldi [80] process,with a shift λ for a (deflated) eigenproblem, as can be understood as follows.

For simplicity, suppose that A has a complete set of eigenpairs (xi, λi) withλ1 < λ2 < · · · < λn and that we are trying to find an approximation (q, λ) for(x1, λ1). The exact solution of (6.4) is given by

(6.23) v = −q + (A− λ I)−1qε,

with ε = 1/(q∗(A − λ I)−1q) (cf. [90, Section 4.1]). Writing q as∑γixi, it

follows that

(6.24) (A− λ I)−1q =∑

i

γi

λi − λxi.

We may assume, without loss of generality, that γi 6= 0, because q is a Ritzvector which means that γi = 0 either if ∠(xi,V) = 0 or π/2. The latter caseis unlikely to happen, due to rounding errors, and the first case indicates fullconvergence.

Hence, eigenvector components corresponding to eigenvalues closer to λwill be amplified more in (A − λ I)−1q. The component orthogonal to q isused as an expansion for V and thus, as soon as q has a large componentin the direction of x1, say that the angle is less than π/4, then necessarilycomponents other than x1 become dominant. That is

(6.25) v ∼∑i 6=1

γi

λi − λxi.

In Fig. 6.1 we have illustrated this phenomenon. The bullets represent theamplification factors 1/|λi − λ| for components in the direction of xi (i =2, 3, 4); THETA represents λ.In the subsequent iterations similar amplifications will occur and the closer λi

is to λ, the more rapid the angle ∠(xi,V) will decrease.

Page 164: Diederik Fokkema - Thesis

150 Chapter 6. Jacobi-Davidson style QR and QZ algorithms

LAMBDA 1 LAMBDA 2 LAMBDA 3 LAMBDA 4

THETA

2

3

4

Fig. 6.1. Amplification factors of eigenvectors

This argument is repetitive: if the angle ∠(x2,V) becomes very small,then the corresponding γ2 will be very small and other components, due toorthogonalization, will become more dominant.

Consequently, while the process converges to a Schur pair, the search sub-space V will provide good initial approximations for the nearby Schur pairs.Moreover, slow convergence during one stage may be compensated for by fasterconvergence in the next stage, because the subspace spanV will be enrichedwith more components of other Schur pairs, due to repeated amplifications.This is observed in our numerical experiments, see Section 6.4.

6.2.7. The quality of the deflated preconditioner. Even when thepreconditioner K is constructed for a fixed τ , then the correction equationstill involves projections that become more expensive after each Schur pairthat has been detected, but this does not necessarily lead to a more expensivecomputational process (compared with explicit restart). When iterative solversare used, they may converge faster because the field of values of the projectedoperator (I −QkQ ∗

k )(A − λ I)(I −QkQ ∗k ) is contained in the field of values

of A − λ I, and that may be smaller, specially after exterior eigenvalues havebeen detected.

The projections may also have a positive effect on the preconditioner.With (A− τ I) = K−R it follows that

(6.26) (I−QkQ ∗k )(A− λ I)(I−QkQ ∗

k ) =

(I−QkQ ∗k )K (I−QkQ ∗

k )− (I−QkQ ∗k )R (I−QkQ ∗

k )− (τ− λ)(I−QkQ ∗k ),

We see that, on the one hand, the preconditioning error is enlarged by a small

Page 165: Diederik Fokkema - Thesis

Section 6.3. The generalized eigenproblem 151

shift (τ − λ)I, but on the other hand, the projections diminish the error byfiltering out the detected Schur vectors. If the error R is large with respectto eigenvectors corresponding to eigenvalues near τ , then the projected error(I −QkQ ∗

k )R (I −QkQ ∗k ) will be significantly smaller, and the only penalty

is a (small) shift due to τ − λ. It seems plausible (cf. [100, Ch. IV]) that thiswill not lead to a significantly less effective preconditioner, and it may help toexplain the effectiveness of a fixed preconditioner running with JDQR in ourexperiments.

6.3. The generalized eigenproblem. We now consider the generalizedeigenproblem (6.2) and derive the JDQZ algorithm along the lines as for JDQR.

Convention 6.1 We denote a generalized eigenvalue of the matrix pair (A,B)as a pair 〈α, β〉. This approach is preferred because underflow or overflow forλ = α/β in finite precision arithmetic may occur when α and/or β are zero orclose to zero, in which case the pair is still meaning– and useful [63, 77], [96,Ch. VI].

Remark 6.10 Observe that, for each γ 6= 0, the pairs 〈α, β〉 and 〈γα, γβ〉correspond to the same generalized eigenvalue. Rather than scaling the co-efficients of 〈α, β〉 in our algorithms (for instance, such that β ∈ [0, 1] andβ2 + |α|2 = 1), we follow the advise in [63], and we show the results as pro-duced by the QZ-algorithm: the size of α and β may give valuable informationon the conditioning of the computed eigenpair. However, in the constructionof our algorithm, scaling does play a role.

6.3.1. Jacobi-Davidson. For standard eigenproblems, the search sub-space and the test subspace in Jacobi-Davidson are identical, but for general-ized problems, other choices appear to be more natural (cf. [84]). A similarobservation applies to the projectors in the correction equation.

As appears from the analysis in [84], for asymptotic quadratic speed ofconvergence we are restricted in our choices, although there are still a numberof possibilities. As we will see, the computation of a partial generalized Schurform, will lead naturally to basically two specific choices for the test subspace,and to two related choices for the projectors in the correction equation.

For generalized eigenproblems, a partial generalized Schur form is definedas follows.

Definition 6.2 A partial generalized Schur form of dimension k for a matrixpair (A,B) is the decomposition

(6.27) AQk = ZkSk, BQk = ZkTk,

Page 166: Diederik Fokkema - Thesis

152 Chapter 6. Jacobi-Davidson style QR and QZ algorithms

where Qk and Zk are orthogonal (n×k)-matrices, and Sk and Tk are upper tri-angular (k×k)-matrices. A column qi of Qk is referred to as a generalized Schurvector, and we refer to a pair (qi, 〈αi, βi〉), with 〈αi, βi〉 = 〈Sk(i, i), Tk(i, i)〉 asa generalized Schur pair.

The formulation in (6.27) is equivalent with

(6.28) Z∗kAQk = Sk and Z∗

kBQk = Tk.

Further, if (x, 〈α, β〉) is a generalized eigenpair of (Sk, Tk) then (Qkx, 〈α, β〉)is a generalized eigenpair of (A,B).

For presentation purposes, we will briefly describe Jacobi-Davidson for thegeneralized eigenproblem (6.2); for details we refer to [84].

As for standard eigenproblems, in each step the approximate eigenvectorq is selected from a search subspace spanV. This approximation with as-sociated approximate generalized eigenvalue 〈α, β〉 is “tested” with respect tosome subspace spanW:

(6.29) βAq− αBq ⊥ spanW.

For the generalized case, it is, in view of (6.27) and (6.28), natural to takethe test subspace spanW different from the search subspace: the Petrov-Galerkin approach. Search subspace and test subspace are of the same dimen-sion, say j. Equation (6.29) leads to the projected eigenproblem

(6.30) (βW∗AV − αW∗BV)u = 0,

that can be solved by conventional techniques, and a solution (u, 〈α, β〉) isselected. Observe that (6.30) is a j-dimensional problem, and u is a j-vector.The Petrov vector q ≡ Vu and the residual r ≡ βAq− αBq, associated withthe Petrov value 〈α, β〉, are computed. The subspaces spanV and spanWare expanded in each step of the iterative process. For certain vectors p, z,and y, the search subspace is expanded by a vector v that is orthogonal to pand that solves approximately the correction equation

(6.31)(I− z y∗

y∗z

)(βA− αB)

(I− q p∗

p∗q

)v = −r.

In the next step, spanV,v is the new search subspace. Under special butobvious conditions that prevent y∗z, and similar other expressions, from con-verging towards 0, the choice y in spanW and z in spanAq,Bq leads toquadratic convergence, see [84, Th. 3.2]. In the general context in [84], thereare no other restrictions on p, z, and y.

Page 167: Diederik Fokkema - Thesis

Section 6.3. The generalized eigenproblem 153

In our present approach we want orthogonal matrices V and W, similarto Z and Q in (6.27), and we favor orthogonal projections. Therefore, weconstruct V and W to be orthogonal: new columns of V and W are orthogo-nalized by modified Gram-Schmidt. With p = q the right projection in (6.31)is orthogonal. With y = z the left projection is orthogonal also, and, as wewill see, this choice is in line with the natural choice for the test subspace,without violating the restrictions for quadratic convergence.

We use the QZ algorithm [63] to reduce (6.30) to a generalized Schur form.With j the dimension of spanV, this algorithm yields orthogonal (j × j)-matrices UR and UL, and upper triangular (j × j)-matrices SA and SB , suchthat

(6.32) UL∗(W∗AV)UR = SA and UL

∗(W∗BV)UR = SB .

As for the standard case, for this generalized situation, there is also an algo-rithm that reorders this decomposition such that the first column of UR andthe (1, 1)-entries of SA and SB represent the wanted Petrov solution of (6.30).We will discuss this algorithm in Section 6.3.2 and Appendix 6.C.With the decomposition in (6.32), we construct an approximate partial general-ized Schur form (cf. (6.27)): VUR approximates a Qk, and WUL approximatesthe associated Zk. The Jacobi-Davidson method generates a V for which VUR

approximates a Qk (in general the first column will be in leading position).Since spanZk = spanAQk = spanBQk (cf. (6.27)), it makes sense tochoose W such that, for some scalars ν0, µ0 with, say, |ν0|2 + |µ0|2 = 1, thespace spanW coincides with spanν0AV+µ0BV. This choice is also in linewith the restriction w = z and the other restrictions on w and z, mentionedabove.

In summary, for suitable fixed scalars ν0, µ0, we propose the following Ja-cobi-Davidson method:• reduce the projected problem (6.30) to an ordered generalized Schur decom-position (6.32) and select as approximate generalized eigenpair:

(q, 〈α, β〉) ≡ (VUR(:, 1), 〈SA(1, 1), SB(1, 1)〉);

• for

(6.33) γ z ≡ ν0Aq + µ0Bq, and r ≡ βAq− αBq,

where γ is a normalization constant, compute an approximate solution v ⊥ qof the resulting correction equation

(6.34) q∗v = 0 and (I− z z∗)(βA− αB)(I− q q∗)v = −r;

• expand V with v and W with w, where

Page 168: Diederik Fokkema - Thesis

154 Chapter 6. Jacobi-Davidson style QR and QZ algorithms

(6.35) w ≡ ν0 Av + µ0 Bv.

It can be shown that, with the above choices for z and W,

(6.36) z = WUL(:, 1).

In this approach, the relation between the partial generalized Schur form forthe large problem and the complete generalized Schur form for the small prob-lem (6.30) via right vectors (q = VUR(:, 1)) is similar to the relation via leftvectors (z = WUL(:, 1)). The fact that z = WUL(:, 1), is also convenient forrestart purposes, as we will see in Section 6.3.2.

Finally, we will explain how to select the scalars ν0 and µ0. The restriction|ν0|2 + |µ0|2 = 1 is for scaling and avoids trivial expansions. We pursue threeapproaches. The first two, in Sections 6.3.1.1–6.3.1.2, are closely related, andcan be viewed as a generalizations of the approach by Ritz values for standardeigenproblems, for optimal expansion of the test subspace. The third one,in Section 6.3.5.1, is more closely related to the approach by harmonic Ritzvalues, and aims for optimal selection of Petrov pairs.

6.3.1.1. Fixed values for ν0 and µ0. If v is the expansion vector forthe search subspace then, in the general setting, we have to expand the testsubspace by ν0Av+µ0Bv. Note that, if q is the new approximate eigenvectorthen expanding the old search subspace by v is equivalent to expanding itby q, so that the new test subspace can also be obtained by expanding withν0Aq + µ0Bq. For B = I, the obvious choice would be, ν0 = 0 and µ0 = 1.However, if A = I, the obvious choice would be ν0 = 1 and µ0 = 0. In thiscase, although Bq is in the direction of q, if q is close to some eigenvector q,multiplication by B may diminish the most important eigenvector componentsof q, if the eigenvalue of B associated to q is (very) small. Therefore, expandingthe test space by Bq may be (much) less optimal than expanding by q. In thepresence of rounding errors, this effect may be even more prominent.

For the standard case, where either A = I or B = I, Aq = αq andBq = βq, for 〈α, β〉 with either α = 1 or β = 1, the optimal choice withrespect to the q-components seems to be

(6.37) ν0 =α√

|α|2 + |β|2and µ0 =

β√|α|2 + |β|2

,

since this choice maximizes

‖ν0Aq + µ0Bq‖2 (= |ν0α+ µ0β| ‖q‖2).

Also, for the generalized problem, where Aq = αz and Bq = βz, if (q, 〈α, β〉)is the desired eigenpair, we can select ν0 and µ0 as in (6.37). With respect to

Page 169: Diederik Fokkema - Thesis

Section 6.3. The generalized eigenproblem 155

q, this choice maximizes

‖ν0Aq + µ0Bq‖2 (= |ν0α+ µ0β| ‖z‖2).

This approach can be viewed as an attempt to expand the test subspacespanW optimally in the direction of z, where z is the normalized vectorAq (or Bq).

Since we have to choose ν0 and µ0 before we even know the generalizedeigenvalue 〈α, β〉, the best we can do, certainly in the initial phase of theprocess, is to select

(6.38) ν0 ≡τ√

1 + |τ |2and µ0 ≡

1√1 + |τ |2

,

where τ is the target value.

6.3.1.2. Adaptive values for ν0 and µ0. neededFor a well-balanced expansion of the test subspace, the expressions in (6.37)

suggest that we take advantage of the current approximations 〈α, β〉 for thegeneralized eigenpair. Intuitively

(6.39) ν0 ≡α√

|α|2 + |β|2and µ0 ≡

β√|α|2 + |β|2

might be a good choice. Ideally, at convergence, the space spanW shouldcoincide with spanαAV + βAV. Since V is expanded by v, this suggests toexpand W by

(6.40) w ≡ ν0Av + µ0Bv.

Unfortunately, since all intermediate ν0 and µ0 are different, this does notguarantee that at convergence αAq + βBq ∈ spanW. Nevertheless thisadaptive variant (6.39)-(6.40) turns out to work better in practice than thefixed variant in Section 6.3.1.1. For the z in the correction equation (6.34) wetook WUL(:, 1) (see (6.36)). This vector is in the direction of the orthogonalprojection of ν0Aq+µ0Bq onto spanW and, in practice, the angle betweenthe vectors WUL(:, 1) and ν0Aq + µ0Bq appears to converge rapidly towardszero.

Remark 6.11 If, for standard eigenproblems, test subspaces coincide with thecorresponding search subspaces, then we refer to the approximate eigenpairs asRitz pairs: the approximate eigenpairs are associated with the Ritz-Galerkinapproximation. If the subspaces do not coincide, we prefer the name Petrov

Page 170: Diederik Fokkema - Thesis

156 Chapter 6. Jacobi-Davidson style QR and QZ algorithms

pairs, because of its relation with Petrov-Galerkin approximation. Petrov val-ues associated with the standard eigenproblem for A and the choice W = AVare called harmonic Ritz values. The reference to “Ritz” in their name ex-presses the fact that these Petrov values are the reciprocals of the Ritz valuesassociated with the standard eigenproblem for A−1 with test and search sub-space both equal to AV.

For generalized eigenproblems, there is no canonical relation between searchand test subspace (except for unitary B) and we believe that the name Petrovpairs is appropriate here. However, in our approach, orthogonality and the QZ-algorithm are central. As we have explained above, this leads quite naturallyto some specific choice of the test subspaces. Therefore, we call the Petrovpairs associated with the choice made in Section 6.3.1.1 the standard Petrovpairs.

6.3.2. Practical selection and implicit restart. When we reduce theprojected eigenproblem (6.30) to a generalized Schur form by the QZ algo-rithm [63], then we can exploit the generalized Schur form for various pur-poses: — selection of a Petrov pair (q, 〈α, β〉), — selection of the correspond-ing left vector z, — restriction of the dimension of the subspaces spanV andspanW, if necessary. We will explain the first and last point in more detail.

Suppose that the generalized Schur form of the interaction pair

(MA,MB) ≡ (W∗AV,W∗BV),

given byU∗

LMAUR = SA and U∗LMBUR = SB ,

is ordered with respect to τ such that(6.41)|SA(1, 1)/SB(1, 1)− τ | ≤ |SA(2, 2)/SB(2, 2)− τ | ≤ · · · ≤ |SA(j, j)/SB(j, j)− τ |,

where j is the dimension of spanV. Then

(q, 〈α, β〉) ≡ (VUR(:, 1), 〈SA(1, 1), SB(1, 1)〉))

is the Petrov approximation corresponding to the projected system (6.30) withPetrov value closest to the target τ . The corresponding left vector is given byz ≡WUL(:, 1). Furthermore, VUR(:, 1:i), with i < j, spans the subspace thatcontains the i most promising Petrov vectors. The corresponding test subspaceis given by WUL(:, 1:i). Therefore, similar to the approach in Section 6.2.2(cf. [90, Section 5.3]), when we want to reduce the dimension of the subspace(“implicit restart”) to jmin, jmin < j, then we simply discard the columnsvjmin+1 through vj , and wjmin+1 through wj , and continue the Jacobi-David-son algorithm with

V = VUR(:, 1:jmin) and W = WUL(:, 1:jmin).

Page 171: Diederik Fokkema - Thesis

Section 6.3. The generalized eigenproblem 157

For a reordering algorithm for the generalized Schur form, see, for instance,[106, 107]. A simple MATLAB implementation for reordering with respect toa target value τ is given in Appendix 6.C. A theoretical explanation is giventhere as well.

6.3.3. JDQZ. In this section we focus on the efficient computation of aset of generalized eigenpairs. The idea is to use the Jacobi-Davidson methodfor generalized eigenproblems (Section 6.3.1) for the computation of a partialgeneralized Schur form.

Suppose that we have the partial generalized Schur form

AQk−1 = Zk−1Sk−1 and BQk−1 = Zk−1Tk.

Analogously to (6.8), we want to expand this partial generalized Schur formwith a suitable q and z, to

(6.42)BA

[Qk−1 q

]=

[Zk−1 z

] [Sk−1 s

0 α

]and

B[Qk−1 q

]=

[Zk−1 z

] [Tk t0 β

].

From this we deduce that the generalized Schur pair (q, 〈α, β〉) satisfies

(6.43) Q∗k−1q = 0 and (βA− αB)q− Zk−1u = 0,

for u ≡ Z ∗k−1(βA− αB)q. This leads to

Q∗k−1q = 0 and (I− Zk−1 Z ∗

k−1)(βA− αB)q = 0.

Hence, (q, 〈α, β〉) satisfies

(6.44) Q ∗k−1q = 0 and (I−Zk−1Z ∗

k−1)(βA−αB)(I−Qk−1Q ∗k−1)q = 0.

and the generalized Schur pair (q, 〈α, β〉) is therefore also an eigenpair of thedeflated matrix pair

(6.45) ( (I−Zk−1Z ∗k−1)A(I−Qk−1Q ∗

k−1), (I−Zk−1Z ∗k−1)B(I−Qk−1Q ∗

k−1) ).

In JDQZ we solve this eigenproblem with the Jacobi-Davidson method for thegeneralized eigenproblem.

Page 172: Diederik Fokkema - Thesis

158 Chapter 6. Jacobi-Davidson style QR and QZ algorithms

In more detail, the procedure is as follows. Let V and W be orthogonal(n× j)-matrices such that V∗Qk−1 = W∗Zk−1 = 0. Let

MA ≡W∗(I− Zk−1Z ∗k−1)A(I−Qk−1Q ∗

k−1)V = W∗AV andMB ≡W∗(I− Zk−1Z ∗

k−1)B(I−Qk−1Q ∗k−1)V = W∗BV,

and denote the generalized Schur form of the matrix pair (MA,MB) by

(6.46) U∗LMAUR = SA and U∗

LMBUR = SB .

If this generalized Schur form is ordered with respect to the target value τ ,then

(q, 〈α, β〉) ≡ (VUR(:, 1), 〈SA(1, 1), SB(1, 1)〉)is a Petrov pair approximation for a solution of (6.44). The corresponding leftvector is given by

z ≡WUL(:, 1).

The Jacobi-Davidson method expands V with the orthogonal complement of vthat is an (approximate) solution of the generalized deflated correction equation(6.47)

Q ∗k−1v = 0, q∗v = 0, and

(I− z z∗)(I− Zk−1Z ∗k−1)(βA− αB)(I−Qk−1Q ∗

k−1)(I− q q∗)v = −r,

where r ≡ (I−Zk−1Z ∗k−1)(βA− αA)(I−Qk−1Q ∗

k−1) q. We also have to ex-pand W; we expand with the orthogonal complement of (I−Zk−1Z ∗

k−1)(ν0 A+µ0 B)(I−Qk−1Q ∗

k−1) q to W.When the generalized Schur pair (q, 〈α, β〉) is sufficiently close to (q, 〈α, β〉),

then we may continue for still another generalized Schur pair. In that case Vand W are replaced by VUR(:, 2:j) and WUL(:, 2:j), in order to obtain anew search subspace orthogonal to spanQk−1, q, and a new test subspaceorthogonal to spanZk−1, z, respectively, and we continue the process.

6.3.4. Preconditioning. In this section we discuss preconditioning forthe generalized deflated correction equation.

The correction equation (6.44) involves an operator for which the domainand the image space differ. This means that Krylov subspace methods can notbe applied right away. Fortunately, this can be fixed easily by incorporatingpreconditioning.

Similarly to Section 6.2.4, we propose to use

(6.48) (I− z z∗)(I− Zk−1Z ∗k−1)K(I−Qk−1Q ∗

k−1)(I− q q∗).

for some preconditioner K ≈ A− τ B.We modify our notation slightly (cf. Notation 6.1):

Page 173: Diederik Fokkema - Thesis

Section 6.3. The generalized eigenproblem 159

Notation 6.2

Qk ≡ [Qk−1, q ], the matrix Qk−1 expanded by q,

Zk ≡ [Zk−1, z ], the matrix Zk−1 expanded by z,

Yk ≡ K−1Zk, the expanded matrix of preconditioned vectors,

Hk ≡ Q ∗k Yk , the projected preconditioner Q ∗

k K−1Zk.

In this notation the left preconditioned correction equation for the gener-alized correction equation can be written as(6.49)Q ∗

k v = 0 and (I− Yk H−1k Q ∗

k )K−1(βA− αB)(I− Yk H−1k Q ∗

k )v = −r,

where r ≡ (I − Yk H−1k Q ∗

k )K−1r. Observe that, for K = I, this equation isequivalent with the one in (6.47).

Of course, right preconditioned generalized correction equations can bederived in a similar manner. With Yk ≡ (K∗)−1Qk,

Y∗k v = 0 and (I− ZkH

−1k Y∗

k )(βA− αB)K−1(I− ZkH−1k Y∗

k ) v = −r,

where r ≡ (I− ZkH−1k Y∗

k ) r. Then v = K−1v.Note that for the operators in the preconditioned correction equation, the

domain and the image space coincide, so that Krylov subspace methods canbe used.

A pseudo-code for the preconditioned Jacobi-Davidson QZ-algorithm withharmonic Petrov values (to be discussed in Section 6.3.5.1) is given in Alg. 6.4.

In Tab. 6.3 we have listed the main computational ingredients per iterationof JDQZ.

6.3.5. The selection of Petrov pairs. In the approaches with fixedand adaptive parameters for the generalized case in Section 6.3.1.1 and Sec-tion 6.3.1.2, our goal is optimal expansion of the test subspace, implicitlyleading to optimal expansion of the search subspace as well. But the speedof convergence of a Jacobi-Davidson algorithm also depends on the ability toselect the “correct” Petrov pairs (cf. Section 6.2.5).

Of course, here the selection can be improved too by a tracking strategy,as explained in Section 6.2.5.1. We need some confidence that we are trackingthe correct Petrov value. In Section 6.2.5.1, we proposed to rely on the normof the previous residual. Unfortunately, this strategy will not be helpful in theinitial stage of the process, where there are no small residuals.

In Section 6.3.5.1 we will introduce harmonic Petrov values. We will seethat the harmonic Petrov values, that are closest to a target, can be obtained

Page 174: Diederik Fokkema - Thesis

160 Chapter 6. Jacobi-Davidson style QR and QZ algorithms

function [Q,Z, RA, RB ] = JDQZ (A,B,K, τ,v0, ε, kmax, jmin, jmax)Q = [ ]; Z = [ ]; RA = [ ]; RB = [ ]; Y = [ ]; H = [ ];V = [ ]; VA = [ ]; VB = [ ]; W = [ ]; MA = [ ]; MB = [ ];γ =

√1 + |τ |2; α0 = τ/γ, β0 = 1/γ; k = 0; j = 0;

while k < kmax,if j == 0,

v = v0;else

— the correction equation —r = (I− YH−1Q∗)K−1r;Solve v (approximately) from:

Q∗v = 0 and

(I− YH−1Q∗)K−1(βA− αB)(I− YH−1Q∗)v = −r.end— the projected problem —v = mgs (V,v); v = v/‖v‖2; vA = Av; vB = Bv;w = (β0vA − α0vB); w = mgs (Z,w); w = mgs (W,w); w = w/‖w‖2;MA = [MA,W∗vA;w∗VA,w∗vA ]; MB = [MB ,W∗vB ;w∗VB ,w∗vB ];V = [V,v ]; VA = [VA,vA ]; VB = [VB ,vB ]; W = [W,w ];[UL, UR, SA, SB ] = qz (MA,MB);[UL, UR, SA, SB ] = qzsort (τ, UL, UR, SA, SB);j = j + 1; found = 1;while found,

— harmonic Petrov approximation —α = SA(1, 1); β = SB(1, 1);q = VUR(:, 1); z = WUL(:, 1); y = K−1z;r = Aq; [ r, sA] = mgs (Z, r); rB = Bq; [ rB , sB ] = mgs (Z, rB);r = β r− α rB ;Q = [Q,q ]; Y = [Y,y ]; H = [H,Q∗y;q∗Y,q∗y ];

“found and implicit restart part”, see Alg. 6.5

endend

JDQZ returns a partial generalized Schur form (Q,Z, RA, RB) of dimension kmax of thematrix pair (A,B) with generalized eigenvalues near the target τ . K is a preconditionerfor A− τB, v0 is an initial guess, and ε is the stopping tolerance. jmax and jmin specifythe dimension of the search subspace before and after implicit restart, respectively. qzis a MATLAB function that computes a generalized Schur decomposition. The functionsmgs (modified Gram-Schmidt) and qzsort (Sort generalized Schur form) can be found inAppendix 6.C.

Alg. 6.4. Preconditioned JDQZ, using harmonic Petrov values.

Page 175: Diederik Fokkema - Thesis

Section 6.3. The generalized eigenproblem 161

found = (‖r‖2 < ε) & (j > 1 | k = kmax − 1);if found,

— found —Q = Q; Z = Z;RA = [RA, sA; zeros (1, k), α ]; RB = [RB , sB ; zeros (1, k), β ];k = k + 1; if k = kmax, break; end

Y = Y; H = H;J = [ 2:j ]; j = j − 1;V = VUR(:, J); VA = VA UR(:, J); VB = VB UR(:, J);W = WUL(:, J); SA = SA(J, J); SB = SB(J, J);MA = SA; MB = SB ; UR = I; UL = I;

elseif j == jmax,— implicit restart —j = jmin; J = [ 1:j ];V = VUR(:, J); VA = VA UR(:, J); VB = VB UR(:, J);W = WUL(:, J); SA = SA(J, J); SB = SB(J, J);MA = SA; MB = SB ; UR = I; UL = I;

end

Alg. 6.5. “Found and implicit restart part” of preconditioned JDQZ, with har-monic Petrov values.

as extremal Ritz values for a specific test subspace, also if the target is inthe interior of the spectrum. Specifically for such a situation, the harmonicPetrov values appear to be attractive competitors for the standard Petrovvalues of the approaches in Section 6.3.1.1 and Section 6.3.1.2: for generalizedeigenproblems the costs for the computation of the standard Petrov valuesis the same as for harmonic Petrov values, and, because of the extremalityproperty, harmonic Petrov values closest to the target appear to be the bestchoices, also in early stages of the process (cf. Section 6.2.5). A trackingstrategy is not required nor helpful in this case.

6.3.5.1. A harmonic Petrov value approach. We first consider thecomputation of the eigenvalues of a standard eigenproblem (B = I), thatare close to some target value τ in the interior of (the convex hull of) thespectrum. The transformation λ 1/(λ − τ) maps these eigenvalues λ toextremal eigenvalues of (A − τ I)−1 and in that case the “correct” eigenpairapproximations can be obtained easily (cf. Section 6.2.5). But, we want toavoid matrix inversion. With some formula manipulation, it can be shownthat this can be achieved by taking the search subspace and the test subspaceboth equal to span(A−τ I)V (cf. [90, Section 5.1]): the resulting eigenvalue

Page 176: Diederik Fokkema - Thesis

162 Chapter 6. Jacobi-Davidson style QR and QZ algorithms

Part dots axpys MVs KThe correction equation variableThe Projected problem 6j + k 2j − 1 2a 0The Petrov approximation 2k + 1 2j + 3k 2b 1Found 0 4j − 4 0 0Restart 0 4jmin 0 0

a If Krylov subspace methods are used to solve the correction equation, then theproducts Av and Bv are often already available, as side-products. No MVs areneeded in this part then.

b Instead of computing the residual r as (β A−αB) q, r may also be computed as

β VAU(:, 1)−αVBU(:, 1), where VA ≡ AV and VB ≡ BV (cf. Alg. 6.4); dependingon the number of nonzeros in A, B and the value of j, this may be more efficient.

Table 6.3. The computational costs of JDQZ per iteration. The integers j andk are the dimensions of spanV and spanQ, respectively.

approximations λ for A are then the solutions of

(6.50) W∗AVu− λW∗Vu = 0, where W ≡ (A− τ I)V.

The solutions λ are called harmonic Ritz values of A, with respect to τ (cf.[70, 90], and also [65]); Vu is the associated harmonic Ritz vector. Since Wand γW, with γ ≡ 1/

√1 + |τ |2, span the same space, the harmonic Ritz values

appear as Petrov values for the test subspace generated as in (6.35), with

(6.51) ν0 ≡1√

1 + |τ |2and µ0 ≡ −

τ√1 + |τ |2

.

For generalized problems, with ν0 and µ0 as in (6.51), the Petrov valuesclosest to the target value correspond to absolute largest Ritz values of thestandard eigenproblem, with matrix (A− τ B)−1(τA+B). Therefore, for thisgeneralized case also a better selection of appropriate eigenpair approximationsmay be expected. We refer to the Petrov values associated with this choice oftest subspace as harmonic Petrov values.

Observe that it does not make sense to try to improve the mixture W ofAV and BV by taking ν0 = β and µ0 = −α, if a better generalized eigenvalueapproximation 〈α, β〉 becomes available (cf. Section 6.3.1.2). On the contrary,as is explained in Section 6.3.1.1, this would spoil precisely the interestingcomponents in the expansion vector of W. However, recall that, with theharmonic approach in (6.51), our goal is not an optimal mixture, but a lessrisky selection procedure.

From the above arguments, it will be clear that the harmonic approach willnot be better than the adaptive approach, when we want extremal eigenvalues:

Page 177: Diederik Fokkema - Thesis

Section 6.4. Numerical experiments 163

no better selection may be expected, but the expansion of the test subspacewill be less optimal. However, for interior eigenvalues, experiments show (cf.Section 6.4.4 and Section 6.4.8) that the harmonic approach can work muchbetter than the adaptive approach, even if the latter one is enhanced with thetracking strategy.

6.4. Numerical experiments. In this section we present numerical re-sults, obtained with JDQR and JDQZ, for several eigenproblems and general-ized eigenproblems. The purpose of these experiments is to get a good impres-sion of the actual behavior of these methods. We have not tried to find themost efficient parameter choices for each particular problem. We will illustratethe effect of a more accurately solving the correction equation, and the effect ofincluding appropriate preconditioning. We will show that the harmonic Petrovvalue choice for the test subspace may lead to superior convergence behavior,not only for the generalized eigenproblem, but also for the standard eigen-problem. We will demonstrate that the projections in the correction equation(6.12), involving detected Schur vectors, are essential components of the algo-rithms. We will see that the tracking strategy (Section 6.2.5.1) can be veryhelpful. We will also consider eigenproblems where multiple eigenvalues areinvolved.

The computations were done in double complex precision (≈ 15 digits) ona Sun workstation. To facilitate comparison, we have selected for all casesjmax = 15, jmin = 10 (the dimension of the subspace before and after implicitrestart, respectively), and a fixed random real vector v0 as an initial guess(cf. Alg. 6.2 and Alg. 6.4).

As iterative solvers for the correction equation, we have considered full GM-RES [82] with a maximum of m steps, denoted by GMRESm, and BiCGstab(2)[85]. For BiCGstab(2) a maximum of 100 matrix multiplications was allowed.As stopping criterion for the iterative methods for the correction equation, wehave used ‖ri‖2 < 2−j‖r0‖2, where r0 is the initial residual, ri is the resid-ual corresponding to the approximate solution produced by the inner method,and j is the iteration number for the current eigenvalue approximation in theouter iteration. Hence, as the outer iterations proceed, the inner iterations aresolved more accurately. This choice was inspired by the fact that the Jacobi-Davidson method may be viewed as a Newton process [84, 87], and for Newtonprocesses this stopping criterion may lead to efficient algorithms [30]. As theinitial guess for the inner iteration method we always took the null-vector.The tracking strategy of Section 6.2.5.1 has been used in all examples, exceptwhere stated differently.

In the figures of the convergence behavior for JDQR and JDQZ, the per-formance is plotted in terms of the actual amount of work, in millions offloating point operations (flops), versus log10 of the residual norm. The rea-

Page 178: Diederik Fokkema - Thesis

164 Chapter 6. Jacobi-Davidson style QR and QZ algorithms

son for this is that the computational work in JDQR and JDQZ consists oftwo parts of a different nature: one part is for the inner iteration process, inwhich a correction equation is (approximately) solved; the other part is for theouter iteration, in which an approximation for the (generalized) Schur pair isconstructed. If in the inner iteration the correction equation is solved moreaccurately, then the number of outer iterations may decrease. Therefore, itwould be misleading to monitor the total number of matrix multiplications. Itmight give a bad impression of the total costs, because most of the matricesare sparse and therefore the dot products and vector updates in the outer andthe inner iteration represent substantial costs in JDQR and JDQZ.

Furthermore, we have plotted the entire convergence behavior. This meansthat the convergence history of the residuals of all sub-sequentially selectedapproximate eigenpairs is plotted. Whenever the residual norm curve dropsbelow the acceptation level, indicated by the dotted horizontal line, an eigen-value is accepted and the search process for the next one is continued. A largeresidual norm in the step immediately after acceptation marks the start of anew search.

Construction of suitable initial subspaces. Specifically in the first few stepsof the process the Ritz or Petrov vectors are usually poor approximations ofthe wanted eigenvectors, and the target value τ may be relatively (much)closer to the wanted eigenvalues than any of the approximate eigenvalues.In these cases, the correction equations (6.19) and (6.49), lead to relativelypoor expansions of the search subspace. To see this, recall that the wantedeigenvector would be in the new search subspace if this space would have beenexpanded by the exact solution for the correction equation with the wantedeigenvalue instead of λ (cf. Section 6.2.1). This observation indicates how toimprove the expansion in the first few steps: take in the correction equation τinstead of λ. To detect whether λ is close enough to replace τ , we monitor thenorm of the residual: we take λ (〈α, β〉) instead of τ (〈τ, 1〉) in the correctionequation as soon as the first residual norm drops below a threshold value εtr.

Moreover, in all experiments we used GMRES1 for the first jmin iterations,in order to build up a search subspace spanV in a relatively inexpensive way.Especially when a preconditioner is involved, this approach can be justifiedwith arguments similar those in the preceding paragraph (cf. [84, Section 9.4]).

In our experiments we will vary values for some of the parameters in JDQRand JDQZ. For easy reference, we recall their meaning:

parameter descriptionτ the target valuekmax the number of wanted Schur pairsε the stopping tolerance in the outer iterationεtr the tracking threshold (cf. Section 6.2.5.1)

Page 179: Diederik Fokkema - Thesis

Section 6.4. Numerical experiments 165

6.4.1. The influence of the correction equation. The purpose ofthis example is to show the effect of a more accurate solution of the correctionequation. We consider the Square Dielectric Waveguide standard eigenproblemDW1024 of order 2048 [6]. The problem comes from an integrated circuitapplication. The rightmost eigenvalues and their eigenvectors are wanted.

We took τ = 1.0, kmax = 4, ε = 10−9, εtr = 10−4, and we have not usedpreconditioning.

The computed eigenvalues are given in Tab. 6.4. The convergence historyis plotted in Fig. 6.2 for JDQR, for GMRES1 and GMRES10. A summaryof the number of iterations, the number of matrix multiplications (MVs), andthe number of flops is given in Tab. 6.5.

When solving the correction equation more accurately, the number of MVsis increased, but the number of outer iterations is reduced significantly (seeTab. 6.5), resulting in a much better overall performance.

With GMRES1 the search subspace is the span of the residuals, and inthat case JD (with implicit restart) generates the same subspaces as ImplicitlyRestarted Arnoldi [94]. The eigenvalues are not well separated in this case andtherefore Arnoldi converges only slowly. This explains the poor convergenceof JDQR with GMRES1.

Note that after after two hobbles, JDQR converges quite fast. For the nexteigenvalues there is no such initial stagnation. Apparently, in the iterationsfor the first eigenvalue, components for the next Schur vectors are alreadycollected in spanV (cf. Section 6.2.6).

9.6473e − 019.6551e − 019.7780e − 019.7880e − 01

Table 6.4. 4 eigenvalues of DW1024, computed by JDQR (cf. Section 6.4.1).

Method for thecorrection equation

JDQRiterations MVs flops× 106

GMRES1 185 185 1.023e+ 02GMRES10 43 296 4.661e+ 01

Table 6.5. Summary of results for DW1024 (cf. Section 6.4.1).

6.4.2. The effect of preconditioning. When increasing the number ofsteps in GMRES, the correction equation will be solved more accurately, andthe number of outer iterations may decrease as we have seen. But sometimeswe need too many inner iterations with GMRES for acceptable convergence of

Page 180: Diederik Fokkema - Thesis

166 Chapter 6. Jacobi-Davidson style QR and QZ algorithms

-10

-5

0

20 40 60 80 100 120

log1

0 of

res

idua

l nor

m

number of flops x 1e6

GMRES1GMRES10

Fig. 6.2. Convergence history for DW1024, showing the effect of solving thecorrection equations more accurately (cf. Section 6.4.1).

the outer iterations. However, with appropriate preconditioning, we may seea dramatic improvement.

We consider the standard eigenproblem BWM2000 of order 2000 for theBrusselator wave model [6, 80]. The problem models the concentration wavesfor reaction and transport interaction of chemical solutions in a tubular reactor.Our task is to determine the eigenvalues with largest real part in order to verifywhether their real parts are positive or negative (corresponding to stable orunstable modes).

For this problem, we have selected: τ = 1.0, kmax = 5, ε = 10−9, andεtr = 10−4.

The computed eigenvalues are listed in Tab. 6.6. The convergence historyis plotted in Fig. 6.3 for JDQR with unpreconditioned GMRES10, and withGMRES10 + ILU(0) preconditioning. A summary of the results is given inTab. 6.7.

From Fig. 6.3 we see that JDQR with GMRES10 does not converge (wechecked even up to GMRES50, with little or no improvement), but with pre-conditioning JDQR performs rather well. Again we see that the speed ofconvergence for the first eigenvalue is somewhat slower than the speed of con-vergence for the other eigenvalues. Note that, although the projections in thecorrection equation become more expensive with each detected eigenvalue, thecomputational work for each eigenvalue is roughly constant, except for the first

Page 181: Diederik Fokkema - Thesis

Section 6.4. Numerical experiments 167

-10

-5

0

0 10 20 30 40 50 60 70

log1

0 of

res

idua

l nor

m

number of flops x 1e6

GMRES10GMRES +ILU(0)10

Fig. 6.3. Convergence history for BWM2000, illustrating the effect of includingpreconditioning in the solver of the correction equation (cf. Section 6.4.2).

eigenvalue.

−1.8000e + 00 + 3.0327e + 00 i−6.7500e − 01 − 2.5287e + 00 i−6.7500e − 01 + 2.5287e + 00 i

2.4427e − 07 − 2.1395e + 00 i2.4427e − 07 + 2.1395e + 00 i

Table 6.6. 5 eigenvalues of BWM2000, computed by JDQR (cf. Section 6.4.2).

Method for the correctionequation

JDQRiterations MVs flops× 106

GMRES10 (no convergence) ∗ ∗ ∗GMRES10 + ILU(0) 45 213 4.518e+ 01

Table 6.7. Summary of results for BWM2000 (cf. Section 6.4.2).

6.4.3. Multiple eigenvalues. In this example multiple eigenvalues areinvolved: the Chuck Matrix of order 656 (CK656) [6]. The goal is to computethe eigenvalues with magnitude greater than 1.0. The eigenvalues appear inclusters: each cluster consists of two pairs of almost multiple eigenvalues.

Page 182: Diederik Fokkema - Thesis

168 Chapter 6. Jacobi-Davidson style QR and QZ algorithms

For this problem, we have selected: τ = 5.0, kmax = 10, ε = 10−9, andεtr = 10−4.

The computed eigenvalues are listed in Tab. 6.8. The convergence historyis plotted in Fig. 6.4 for JDQR with GMRES1, GMRES10, and BiCGstab(2),all with ILU(2) preconditioning, for the correction equation. A summary ofthe results is given in Tab. 6.9.

For all three combinations the multiple eigenvalues are easily detected. Forthis example, GMRES10 results in a somewhat better overall performance incomparison with GMRES1, but the combination with BiCGstab(2) is the clearwinner (cf. Tab. 6.9).

The initial fast convergence may be explained by the fact the target τ isclose to the rightmost double eigenvalue, which is relatively well separatedfrom the other eigenvalues.

1.1980e + 00 1.1980e + 001.5940e + 00 1.5940e + 001.4120e + 00 1.4120e + 001.4190e + 00 1.4190e + 005.5024e + 00 5.5024e + 00

Table 6.8. 10 eigenvalues of CK656, computed by JDQR (cf. Section 6.4.3).

Method for the correc-tion equation

JDQRiterations MVs flops× 106

GMRES1 121 121 3.346e+ 01GMRES10 64 291 2.959e+ 01BiCGstab(2) 48 226 2.260e+ 01

Table 6.9. Summary of results for CK656 (cf. Section 6.4.3).

6.4.4. Harmonic Ritz values. The JDQR algorithm computes a par-tial Schur form for the standard eigenproblem with Ritz pairs for the Schurpairs. However, with JDQZ for B = I, we can also compute a partial Schurform for the standard eigenproblem with harmonic Petrov pairs. Here we givean example that illustrates the improved convergence behavior for harmonicPetrov values.

We consider the Quebec Hydroelectric Power System problem QH882 oforder 882 [6]. This matrix represents the Hydro-Quebec power system’s small-signal model. The eigenvalues λ of interest are the eigenvalues in the box−300 < Re(λ) < 100, 0 < Im(λ) < 120π in the complex plane.

For this problem, we have selected: τ = −150.0 + 180.0 i, kmax = 5, ε =10−6, and εtr = 10−3.

Page 183: Diederik Fokkema - Thesis

Section 6.4. Numerical experiments 169

-10

-5

0

GMRES1

-10

-5

0

log1

0 of

res

idua

l nor

m

GMRES10

-10

-5

0

0 5 10 15 20 25 30 35

number of flops x 1e6

BiCGstab(2)

Fig. 6.4. Convergence history for CK656. Also multiple eigenvalues are easilydetected (cf. Section 6.4.3).

The computed eigenvalues are given in Tab. 6.10. The convergence his-tory is plotted in Fig. 6.7, for JDQR, JDQZ with the adaptive choice of testsubspace (cf. Section 6.3.1.2), and JDQZ with the harmonic choice (cf. Sec-tion 6.3.5.1).

This problem is rather difficult: the eigenvalues in the neighborhood of τare in the interior of the spectrum, see Fig. 6.5 and 6.6. For all three methods,the correction equation was solved with GMRES20, preconditioned with theexact inverse of A− τ I. A summary of the results is given in Tab. 6.9.

Although the computational complexity of JDQR is less than the compu-tational complexity of JDQZ (cf. Tab. 6.2 and 6.3), it is not the most efficientmethod here. From the irregular convergence behavior of JDQR in Fig. 6.7we may conclude that JDQR has problems in selecting the “correct” Ritz pairsand as a result the convergence is delayed. As anticipated (cf. Section 6.3.1),JDQZ with the harmonic choice of test subspace makes better selections, asis indicated by the smooth convergence, and hence, its performance is muchbetter. The adaptive version of JDQZ converges faster than JDQR, but notfaster than the harmonic version of JDQZ. Apparently, for fast convergence inthis case, it is more important to have “correct” Petrov approximations, than

Page 184: Diederik Fokkema - Thesis

170 Chapter 6. Jacobi-Davidson style QR and QZ algorithms

-4e+06

-2e+06

0

2e+06

4e+06

-8e+06 -6e+06 -4e+06 -2e+06 0

imag

inar

y ax

is

real axis

Fig. 6.5. Spectrum of QH882 (cf.Section 6.4.4).

0

50

100

150

200

250

300

350

400

-300-250-200-150-100 -50 0 50 100

imag

inar

y ax

is

real axis

eigenvaluestarget

Fig. 6.6. Part of the spectrum ofQH882.

to focus on a more optimal test subspace.

−1.8665e + 02 + 1.9464e + 02 i−1.6661e + 02 + 1.9768e + 02 i−1.6349e + 02 + 1.9524e + 02 i−1.4913e + 02 + 1.9729e + 02 i−1.3607e + 02 + 2.0215e + 02 i

Table 6.10. 5 eigenvalues of QH882, computed by JDQR (cf. Section 6.4.4).

Method Iterations MVs flops× 106

JDQR 99 1482 1.221e+ 02JDQZ Adaptive 62 802 8.252e+ 01JDQZ Harmonic 57 665 7.133e+ 01

Table 6.11. Summary of results for QH882 (cf. Section 6.4.4).

6.4.5. Tracking. Tracking was proposed in Section 6.2.5.1, in order toavoid the performance degeneration, that is caused by irregular convergencebehavior of Ritz values. Here we illustrate (in Fig. 6.8) the effects one may seewithout tracking for JDQR. We applied JDQR to the example of Section 6.4.4with the same choice of parameters, except for εtr (εtr = 0 here).

In the previous example we have already seen that the convergence behav-ior of JDQR was rather irregular. By leaving out the tracking mechanism,the irregularities are even more pronounced. Eventually JDQR loses trackcompletely and stagnates. The peaks in the convergence behavior show thatsometimes the Ritz pair, that is selected in the JDQR process, does not corre-spond to the close-by Schur pair. As a result the search subspace is expanded

Page 185: Diederik Fokkema - Thesis

Section 6.4. Numerical experiments 171

-5

0

JDQR

-5

0

log1

0 of

res

idua

l nor

m

JDQZ Adaptive

-5

0

0 20 40 60 80 100 120

number of flops x 1e6

JDQZ Harmonic

Fig. 6.7. Convergence history for QH882 obtained with the tracking strategy (forall variants). Although QH882 is a standard eigenproblem, for computing interioreigenvalues it is more efficient to use test subspaces that are different from the searchsubspaces (middle and lower figure). A better selection of the Petrov pair (lowerfigure) appears to compensate for a less optimum expansion of the test subspace. (cf.Section 6.4.4).

in a poor direction. Clearly, for this example, this may lead to failure ofconvergence.

It also appears that, as was anticipated, the convergence behavior of JDQZwith the harmonic choice of test subspace is hardly affected by leaving out thetracking mechanism. Also the adaptive choice does pretty well without, butthis does not mean that it always selects the “correct” Ritz pairs, as we willsee in our final example in Section 6.4.8.

6.4.6. The influence of Qk and Zk in the correction equation.In this example we show that the projections with detected Schur vectors(cf. (6.47)) are very essential in the correction equation (cf. Section 6.2.6) andwe show what happens when these projections are neglected. Note that wetake the Jacobi projections (with q and z) still into account.

We consider the Bounded Finline Dielectric Waveguide generalized eigen-problem BFW782 [6] of order 782. This problem stems from a finite element

Page 186: Diederik Fokkema - Thesis

172 Chapter 6. Jacobi-Davidson style QR and QZ algorithms

-5

0

JDQR

-5

0

log1

0 of

res

idua

l nor

m

JDQZ Adaptive

-5

0

0 20 40 60 80 100 120

number of flops x 1e6

JDQZ Harmonic

Fig. 6.8. Convergence history for QH882 without tracking. For interior eigen-values, the tracking strategy improves JDQR significantly (compare the present upperfigure with the upper figure in Fig. 6.7), while there is no improvement for the twoJDQZ variants (compare the two middle figures and the two lower figures of thepresent figure and Fig. 6.7) (cf. Section 6.4.5)

discretization of the Maxwell equation for propagating modes and magneticfield profiles of a rectangular waveguide filled with dielectric and PEC struc-tures. The resulting matrix A is nonsymmetric and the matrix B is positivedefinite. Of special interest are the generalized eigenvalues 〈α, β〉 with positivereal part (i.e., Re(α/β) ≥ 0) and their corresponding eigenvectors.

For this problem, the parameters were set to: τ = 2750.0, kmax = 5,ε = 10−9, and εtr = 10−6.

The spectrum of this matrix pair is shown in Fig. 6.9. A magnification ofthe region of interest is plotted in Fig. 6.10. The computed generalized eigen-values, represented as α/β, are given in Tab. 6.12. With JDQZ we discoveredall 4 positive generalized eigenvalues.

The convergence history is plotted in Fig. 6.11, for the harmonic versionof JDQZ with GMRES10, and for BiCGstab(2). A summary of the results isgiven in Tab. 6.13. We see that JDQZ converges quite nicely for GMRES10 andBiCGstab(2). It should be noted that although it seems that with BiCGstab(2)

Page 187: Diederik Fokkema - Thesis

Section 6.4. Numerical experiments 173

only 4 generalized eigenvalue are computed, in fact 5 generalized eigenvalueare computed: the 2 rightmost generalized eigenvalue, that are relatively close,are found almost simultaneously.

In Fig. 6.12 the convergence behavior of JDQZ with GMRES10, and withBiCGstab(2), is given for the case where the correction equation (6.47) is solvedwithout taking into account the projections involving Qk and Zk. Of course,the correction equations that are used include the rank one projection involvingq and z: these projections are essential for Jacobi-Davidson. Furthermore,deflation in this case is realized by making the approximate solution of thecorrection equation orthogonal to the detected Schur vectors with modifiedGram-Schmidt. By doing the latter twice, the overall performance improvedsignificantly: in the results shown here (cf. Fig. 6.12) modified Gram-Schmidtis applied twice.

However, as explained in Section 6.2.6, we do not benefit from an improvedoperator in the inner iteration. Although the resulting algorithm is computa-tionally cheaper, Fig. 6.12 shows that this does not lead to an overall betterperformance: the speed of convergence becomes increasingly slower and evenstagnates eventually.

−1.1373e + 035.6467e + 021.2634e + 032.4843e + 032.5233e + 03

Table 6.12. 5 generalized eigenvalues of BFW782, computed by JDQZ (cf.Section 6.4.6).

Method for the correc-tion equation

JDQZiterations MVs flops× 106

GMRES10 37 233 3.17e+ 01BiCGstab(2) 32 429 3.88e+ 01

Table 6.13. Summary of results for BFW782 (cf. Section 6.4.6).

6.4.7. More multiple eigenvalues. We consider the eigenproblem

∆u = λu,

with Neumann boundary conditions on the cube [0, 4]3. Finite element dis-cretization of this equation on an 11 × 11 × 11 regular grid, with tetrahedralelements and linear interpolation functions, leads to a generalized eigenprob-lem of order 1331 (AC1331). It has one positive generalized eigenvalue 〈α, β〉

Page 188: Diederik Fokkema - Thesis

174 Chapter 6. Jacobi-Davidson style QR and QZ algorithms

-8000

-6000

-4000

-2000

0

2000

4000

6000

8000

-3e+06 -2e+06 -1e+06 0e+00

imag

inar

y ax

is

real axis

Fig. 6.9. Spectrum of BFW782(cf. Section 6.4.6).

-1-0.8-0.6-0.4-0.2

00.20.40.60.8

1

-1e+04 -5e+03 0e+00 5e+03

imag

inar

y ax

is

real axis

eigenvaluestarget

Fig. 6.10. Part of the spectrumof BFW782.

-10

-5

0

log1

0 of

res

idua

l nor

m

GMRES Harmonic10

-10

-5

0

0 20 40 60 80 100 120

number of flops x 1e6

BiCGstab(2) Harmonic

Fig. 6.11. Convergence history for BFW782.

relatively close to zero (i.e., α/β ≈ 0). The other generalized eigenvalues arealso positive and may be doublets or even triplets.For this problem, the parameters were set to: τ = 0.0, kmax = 15, ε = 10−9,and εtr = 10−4.

The computed 15 leftmost generalized eigenvalues, represented as α/β aregiven in Tab. 6.14. The residual norm versus the number of flops is plot-ted in Fig. 6.13 for the harmonic version of JDQZ with GMRES10 and withBiCGstab(2), respectively. A summary of the results is given in Tab. 6.15.

From the plots we see the effect that multiple generalized eigenvalues mayhave on the convergence behavior. JDQZ converges initially quite fast until thepoint that it “discovers” that the generalized eigenvalue is actually double ortriple. The convergence speed stagnates for a few iterations (2 or 3 peaks in theplot with GMRES, and a plateau in the plot with BiCGstab(2)), after which

Page 189: Diederik Fokkema - Thesis

Section 6.4. Numerical experiments 175

-10

-5

0

log1

0 of

res

idua

l nor

m

GMRES Harmonic without Q and Z10

-10

-5

0

0 20 40 60 80 100 120

number of flops x 1e6

BiCGstab(2) Harmonic without Q and Z

Fig. 6.12. Convergence history for BFW782 without deflating the matrices inthe correction equations, with respect to the detected Schur vectors. Without deflationthe convergence of the linear solver for the correction is much slower (compare theabove figures with those in Fig. 6.11) (cf. Section 6.4.6).

3.8178e − 02 1.4503e + 05 2.9540e + 057.1673e + 04 1.4503e + 05 3.7044e + 057.1673e + 04 2.1811e + 05 3.7044e + 057.1673e + 04 2.9411e + 05 3.7044e + 051.4503e + 05 2.9411e + 05 3.7242e + 05

Table 6.14. 15 generalized eigenvalues of AC1331, computed by JDQZ (cf.Section 6.4.7).

they are discovered quickly one after another. This behavior is in agreementwith Section 6.2.6: during the stagnation phase components of other Schurvectors are amplified in the inner iteration and collected in the search subspace,leading to faster convergence for the next Schur pairs. The stagnation canbe explained by the fact, that with rank 1 Jacobi projections the correctionequation may become (nearly) singular when selecting Petrov approximationsfor multiple generalized eigenvalues. The iterative methods used for solvingthe correction equation often suffer from this (see also [98]). (Variable) blockversions of the correction equation that take this multiplicity into account maybe preferable in such cases, but this falls outside the scope of this paper.

6.4.8. Harmonic Ritz values for generalized problems. Our lastexample shows again that for interior generalized eigenvalues the harmonicversion JDQZ is superior to the adaptive version.

We consider the MHD416 generalized eigenproblem of order 416 [6, 84, 12].This problem stems from a magnetohydrodynamics (MHD) model, where the

Page 190: Diederik Fokkema - Thesis

176 Chapter 6. Jacobi-Davidson style QR and QZ algorithms

Method for the correc-tion equation

JDQZiterations MVs flops× 106

GMRES10 93 601 2.325e+ 03BiCGstab(2) 61 1253 3.368e+ 03

Table 6.15. Summary of results for AC1331 (cf. Section 6.4.7).

-10

-5

0

log1

0 of

res

idua

l nor

m

GMRES Harmonic10

-10

-5

0

0 50 100 150 200 250 300

log1

0 of

res

idua

l nor

m

number of flops x 1e6

BiCGstab(2) Harmonic

Fig. 6.13. Convergence history for AC1331: stagnation followed by fast detec-tion of triple generalized eigenvalues (cf. Section 6.4.7).

interaction of hot plasma and a magnetic field is studied. The matrix A isnon-Hermitian and the matrix B is Hermitian positive definite. Our goalis to compute interior generalized eigenvalues corresponding to the so called“Alfven” branch of the spectrum, see Fig. 6.14 and 6.15.

For this problem, the parameters were set to: τ = −0.1 + 0.5 i, kmax = 20,ε = 10−9, and εtr = 10−4.

The computed generalized eigenvalues are plotted in Fig. 6.16. The con-vergence history for the adaptive and the harmonic version of JDQZ withGMRES1 are plotted in Fig. 6.17. The exact inverse of A− τ B (for τ fixed)was used as preconditioner.

Note the irregular behavior of the adaptive version of JDQZ. The tracking

Page 191: Diederik Fokkema - Thesis

Section 6.5. Conclusions 177

-600

-400

-200

0

200

400

600

-50 -40 -30 -20 -10 0

imag

inar

y ax

is

real axis

Fig. 6.14. Spectrum of MHD416(cf. Section 6.4.8).

0

0.2

0.4

0.6

0.8

1

-1.0 -0.8 -0.6 -0.4 -0.2 0.0

imag

inar

y ax

is

real axis

Fig. 6.15. Alfven branch ofMHD416 (cf. Section 6.4.8).

0.45

0.5

0.55

0.6

0.65

0.7

-0.25 -0.2 -0.15 -0.1 -0.05 0

imag

inar

y ax

is

real axis

eigenvaluestarget

Fig. 6.16. 20 generalized eigenvalues computed by JDQZ for MHD416 (cf. Sec-tion 6.4.8).

mechanism fails and the convergence becomes more and more problematic asthe iteration count increases. It even stagnates after a while. The harmonicversion of JDQZ does not encounter such problems here. For all generalizedeigenvalues the rate of convergence is almost the same: in the computation forone Schur pair, the search subspace apparently accumulates components fornext Schur pairs as well.

6.5. Conclusions. We have proposed two algorithms, JDQR and JDQZ,for computing several selected eigenpair approximations for standard and gen-

Page 192: Diederik Fokkema - Thesis

178 Chapter 6. Jacobi-Davidson style QR and QZ algorithms

-10

-5lo

g10

of r

esid

ual n

orm

GMRES Harmonic1

-10

-5

0 10 20 30 40 50 60

log1

0 of

res

idua

l nor

m

number of flops x 1e6

GMRES Adaptive1

Fig. 6.17. Convergence history of JDQZ for MHD416. harmonic Petrov valuesallow a good selection of Petrov pairs for computing interior generalized eigenvalues(upper figure), also for generalized problems (cf. Section 6.4.8).

eralized eigenproblems, respectively. The methods are based on the Jacobi-Da-vidson method and compute iteratively a partial (generalized) Schur form with(generalized) eigenvalues near a user-specified target value. For both methods,no exact inversion of any matrix is strictly necessary, so that they are suitablefor solving large eigenproblems.

Fast convergence is obtained with a projected correction equation that issolved (approximately) by iterative methods with appropriate precondition-ing. The convergence of JDQR and JDQZ is asymptotically quadratical ifthis correction equation is solved exactly. Furthermore, while converging to aparticular Schur pair, the search subspace accumulates components of otherSchur pairs with (generalized) eigenvalues near the target as well. This usuallyleads to faster convergence for the next eigenpairs.The dimension of the involved subspaces can be controlled by an efficientimplicit restart technique in such a way that the most relevant part of thesubspace is maintained at restart.

The algorithms incorporate simple mechanisms for selecting the wantedeigenpair approximations. Also multiple (generalized) eigenvalues can be de-

Page 193: Diederik Fokkema - Thesis

Appendix 6.A. Modified Gram-Schmidt 179

tected.Whereas in the Jacobi-Davidson method the test subspace can be chosen

arbitrarily, in the JDQZ algorithm essentially two choices for the test subspaceremain: the (adaptive) standard Petrov value choice, and the harmonic Petrovvalue choice. It is argued, and confirmed as well by our experiments, thatespecially for interior eigenvalues, the harmonic approach is also superior forgeneralized eigenproblems

Acknowledgements. We acknowledge helpful discussions with Paul Smitand with Beresford Parlett (on naming conventions). Martin van Gijzen kindlyprovided the matrices for example AC1331.

APPENDIX

6.A. Modified Gram-Schmidt. Here we give a MATLAB implemen-tation of Modified Gram-Schmidt. As input it takes a (n× j)-matrix V, withV∗V = I, and a n-vector v. On return, v is made orthogonal to spanV.The j-vector s holds the values of the coefficients involved.

function [v, s ] = mgs (V,v)j = size (V, 2);s = [ ];for i = 1:j,

s = [ s,V(:, i)′ ∗ v ];v = v −V(:, i) ∗ s(i);

end

6.B. Sorting the Schur form. Before giving MATLAB functions forsorting a Schur form, we indicate how the diagonal entries of the upper tri-angular matrix S in a Schur form can be reordered in any order by unitarytransformations without destroying the upper triangular form.

Clearly, it is sufficient to discuss the 2× 2 case, and to show that the orderof the diagonal entries can be reversed:

S ≡[λ γ0 µ

].

With

T ≡ S − µI =[λ− µ γ

0 0

],

Page 194: Diederik Fokkema - Thesis

180 Chapter 6. Jacobi-Davidson style QR and QZ algorithms

let G be the Givens rotation such that the first column of TG is zero. Sincethe first column of G∗TG and the (2, 1)-entry of G∗IG = I are both zero, wenecessarily must have that

G∗SGe1 = G∗TGe1 + µG∗IGe1 =[µ0

].

Therefore, G∗SG is upper triangular and similar to S and, consequently, theorder of the diagonal entries of G∗SG is reversed with respect to those of S.

The MATLAB functions below implement the sorting of a Schur decom-position MU = US. As input qrsort takes the target τ , a unitary matrix Uand an upper triangular matrix S. On return, the diagonal entries of S areordered with respect to τ and the matrix U is updated correspondingly.

The function select detects the position in a sequence of a scalar closest toa value τ .With plane-rotations, the function swap swaps the diagonal entries S(k, k) andS(k + 1, k + 1) for for k = j − 1, j − 2, . . . , i, assuming that j > i. It updatesthe other entries of S and U accordingly. The resulting matrix S contains atposition (i, i) the value S(j, j) of the original matrix, while the values in theleft (i− 1× i− 1) upper block are unchanged.

function [U, S ] = qrsort (τ, U, S)k = size (S, 1);for i = 1:k − 1,

s = diag (S(i :k, i :k));j = select (τ, s) + i− 1;[U, S ] = swap (U, S, j, i);

end

function j = select (τ, s)[a, j] = min(abs (τ − s));

function [U, S ] = swap (U, S, j, i)for k = j − 1:− 1:i,

x = [S(k, k + 1), S(k, k)− S(k + 1, k + 1)];G([2, 1], [2, 1]) = planerot (x∗)∗;S(:, [k, k + 1]) = S(:, [k, k + 1])G;S([k, k + 1], :) = G∗S([k, k + 1], :)U(:, [k, k + 1]) = U(:, [k, k + 1])G;

end

6.C. Sorting the generalized Schur form. Before giving the MAT-LAB functions, we explain how the generalized Schur form can be sorted.

Page 195: Diederik Fokkema - Thesis

Appendix 6.C. Sorting the generalized Schur form 181

Clearly, it is sufficient to consider the 2×2 case, and to show that the orderof the eigenvalue pairs can be reversed. Thereto, consider

SA ≡[α1 γA0 α2

], SB ≡

[β1 γB0 β2

].

With

T ≡ β2SA − α2SB =[β2α1 − α2β1 β2γA − α2γB

0 0

],

let GR be the Givens rotation such that the first column of TGR is zero andlet GL be the Givens rotation such that, for some scalar γ,

γG∗LSBGRe1 =

[β2

0

].

Since the first column of G∗LTGR and the (2, 1)-entry of G∗

LSBGR are both zero,we necessarily must have that

γG∗LSAGRe1 =

[α2

0

].

Hence, both G∗LSAGR and G∗

LSBGR are upper triangular and similar to SA andSB and consequently the order of the eigenvalue pairs are reversed, where pairsare considered to be identical if the associated quotients are equal.

The MATLAB functions below implement the sorting of a generalized Schurdecomposition MAUR = ULSA and MBUR = ULSB . As input qzsort takes thetarget τ , the upper triangular matrices SA and SB , and the unitary matrices UL

and UR. On return, the eigenvalue pairs of (SA, SB) are ordered with respectto τ and the matrices UL and UR are updated correspondingly.

The function select detects the position of the scalar closest τ .The function swap transfers the eigenvalue pairs 〈SA(j, j), SB(j, j)〉 to the po-sition (i, i) by way of plane-rotations, leaving the pairs in the positions (1, 1),. . ., (i − 1, i − 1) unchanged. The other entries of SA, SB , UL and UR areupdated correspondingly.

function [UL, UR, SA, SB ] = qzsort (τ, UL, UR, SA, SB)k = size (SA, 1);for i = 1:k − 1,

s = diag (SA(i :k, i :k));t = diag (SB(i :k, i :k));j = select (τ, s, t) + i− 1;[UL, UR, SA, SB ] = swap (UL, UR, SA, SB , j, i);

end

Page 196: Diederik Fokkema - Thesis

182 Chapter 6. Jacobi-Davidson style QR and QZ algorithms

function j = select (τ, s, t)[a, j] = min(abs (τ − s ./ t));

function [UL, UR, SA, SB ] = swap (UL, UR, SA, SB , j, i)for k = j − 1:− 1:i,

x = SB(k + 1, k + 1)SA(k, k + 1)− SA(k + 1, k + 1)SB(k, k + 1);x = [x, SB(k + 1, k + 1)SA(k, k)− SA(k + 1, k + 1)SB(k, k)];G([2, 1], [2, 1]) = planerot (x∗)∗;SA(:, [k, k + 1]) = SA(:, [k, k + 1])G;SB(:, [k, k + 1]) = SB(:, [k, k + 1])G;UR(:, [k, k + 1]) = UR(:, [k, k + 1])G;x = SA(k, k);x = [x;SA(k + 1, k)];G = planerot (x);SA([k, k + 1], :) = GSA([k, k + 1], :);SB([k, k + 1], :) = GSB([k, k + 1], :);UL([k, k + 1], :) = UL([k, k + 1], :)G∗;

end

Page 197: Diederik Fokkema - Thesis

References

[1] E. Anderson, Z. Bai, C. Bischof, J. Demmel, J. Dongarra, J. D. Croz,A. Greenbaum, S. Hammarling, A. McKenney, S. Ostrouchov, and D. C.Sorensen, LAPACK Users’ Guide, SIAM, Philadelphia, 1992.

[2] W. E. Arnoldi, The principle of minimized iterations in the solution of the matrixeigenvalue problem, Quart. Appl. Math., 9 (1951), pp. 17–29.

[3] O. Axelsson, Iterative Solution Methods, Cambridge University Press, 1994.[4] O. Axelsson and A. T. Chronopoulos, On nonlinear generalized conjugate gradi-

ent methods, Numer. Math., 69 (1994), pp. 1–16.[5] O. Axelsson and P. S. Vassilevski, A black box generalized conjugate gradient

solver with inner iterations and variable-step preconditioning, SIAM J. MatrixAnal. Appl., 12 (1991), pp. 625–644.

[6] Z. Bai, R. Barret, D. Day, and J. Dongarra, Nonsymmetric test matrix collection,research report, Department of Mathematics, University of Kentucky, 1995.

[7] Z. Bai, D. Day, and Q. Ye, ABLE: An adaptive block Lanczos method for non-Hermitian eigenvalue problems, Research report 95-04, Department of Mathe-matics, University of Kentucky, May 1995.

[8] Z. Bai and G. W. Stewart, SSRIT—a FORTRAN subroutine to calculate the dom-inant invariant subspace of a nonsymmetric matrix, Report 2908, Department ofComputer Science, University of Maryland, 1992. Submitted to ACM TOMS.

[9] R. E. Bank and T. F. Chan, An analysis of the composite step bi-conjugate gradientmethod, Numer. Math., 66 (1993), pp. 295–319.

[10] , A composite step bi-conjugate gradient algorithm for nonsymmetric linearsystems, Numerical Algorithms, 7 (1994), pp. 1–16.

[11] R. Barrett, M. Berry, T. Chan, J. Demmel, J. Donato, J. Dongarra, V. Ei-jkhout, R. Pozo, C. Romine, and H. Van der Vorst, Templates for the so-lution of linear systems: Building Blocks for Iterative Methods, SIAM, Philadel-phia, 1994.

[12] J. G. L. Booten, D. R. Fokkema, G. L. G. Sleijpen, and H. A. Van der Vorst,Jacobi-Davidson methods for generalized MHD-eigenvalue problems, in ICIAMproceedings, July 3–7 1995. To appear in Zeitschrift fur Angewandte Mathematikund Mechanik (ZAMM).

[13] J. G. L. Booten, H. A. Van der Vorst, P. M. Meijer, and H. J. J. te Riele, Apreconditioned Jacobi-Davidson method for solving large generalized eigenvalueproblems, Report NM-R9414, Dept. Num. Math., CWI, Amsterdam, 1994.

[14] H. G. Brachtendorf, Simulation des eingeschwungenen Verhaltens elektronischerSchaltungen, PhD thesis, Universitat Bremen, 1994.

[15] C. Brezinski, M. Redivo Zaglia, and H. Sadok, Avoiding breakdown and near-breakdown in Lanczos type algorithms, Numer. Math., 1 (1991), pp. 261–284.

[16] , A breakdown-free Lanczos type algorithm for solving linear systems, Numer.Math., 63 (1992), pp. 29–38.

[17] P. N. Brown and Y. Saad, Hybrid Krylov methods for nonlinear systems of equa-

Page 198: Diederik Fokkema - Thesis

184 References

tions, SIAM J. Sci. Statist. Comput., 11 (1990), pp. 450–481.[18] T. F. Chan, L. de Pilles, and H. Van der Vorst, A transpose-free squared Lanczos

algorithm and application to solving nonsymmetric linear systems, Preprint 690,Department of Mathematics, Utrecht University, October 1991.

[19] T. F. Chan, E. Gallopoulos, V. Simoncini, T. Szeto, and C. H. Tong, A quasi-minimal residual variant of the Bi-CGSTAB algorithm for nonsymmetric sys-tems, SIAM J. Sci. Comput., 15 (1994), pp. 338–347.

[20] F. Chatelin, Eigenvalues of Matrices, Wiley, New York, NY, 1993.[21] F. Chatelin and V. Fraysse, Qualitative computing; elements of a theory for finite

precision computation, tech. report, Thomson-CSF, June 10 1993.[22] M. Crouzeix, B. Philippe, and M. Sadkane, The Davidson method, SIAM J. Sci.

Comput., 15 (1994), pp. 62–76.[23] J. Cullum, Lanczos algorithms for large scale symmetric and nonsymmetric matrix

eigenvalue problems, in Proceedings of the Cornelius Lanczos International Cen-tenary Conference, J. D. Brown, M. T. Chu, D. C. Ellison, and R. J. Plemmons,eds., Philadelphia, PA., 1994, SIAM, pp. 11–31.

[24] J. Cullum and A. Greenbaum, Relations between Galerkin and norm-minimizingiterative methods for solving linear systems, SIAM J. Matrix Anal. Appl., (1996),pp. 223–247.

[25] J. Cullum, W. Kerner, and R. Willoughby, A generalized nonsymmetric Lanczosprocedure, Comput. Phys. Commun., 53 (1989), pp. 19–48.

[26] E. R. Davidson, The iterative calculation of a few of the lowest eigenvalues andcorresponding eigenvectors of large real symmetric matrices, J. Comp. Phys., 17(1975), pp. 87–94.

[27] D. Day, Semi-duality in the two-sided Lanczos algorithm, PhD thesis, U. C. Berkely,1993.

[28] E. De Sturler, Iterative Methods on Distributed Memory Computers, PhD thesis,Technische Universiteit Delft, 1994.

[29] E. De Sturler and D. R. Fokkema, Nested Krylov methods and preserving theorthogonality, in Sixth Copper Mountain Conference on Multigrid Methods, N. D.Melson, T. A. Manteuffel, and S. F. McCormick, eds., vol. Part 1 of NASAConference Publication 3324, NASA, 1993, pp. 111–126.

[30] R. S. Dembo, S. C. Eisenstat, and T. Steihaug, Inexact Newton methods, SIAMJ. Numer. Anal., 19 (1982), pp. 400–408.

[31] J. E. Dennis, Jr. and R. B. Schnabel, Numerical Methods for Unconstrained Opti-mization and Nonlinear Equations, Prentice-Hall, Englewood Cliffs, New Yersey07632, 1983.

[32] J. J. Dongarra, I. S. Duff, D. C. Sorensen, and H. A. Van der Vorst, SolvingLinear Systems on Vector and Shared Memory Computers, SIAM Publications,Philadelphia, PA, 1991.

[33] I. S. Duff and J. A. Scott, Computing selected eigenvalues of large sparse unsym-metric matrices using subspace iteration, ACM Trans. Math. Software, 19 (1993),pp. 127–159.

[34] S. C. Eisenstat, H. C. Elman, and M. H. Schultz, Variational iterative methodsfor nonsymmetric systems of linear equations, SIAM J. Numer. Anal., 20 (1983),pp. 345–357.

[35] V. Faber and T. Manteuffel, Necessary and sufficient conditions for the existenceof a conjugate gradient method, SIAM J. Numer. Anal., 21 (1984), pp. 352–362.

[36] R. Fletcher, Conjugate gradient methods for indefinite systems, in Numerical Anal-ysis Dundee 1975, Lecture Notes in Mathematics 506, G. A. Watson, ed., Berlin,Heidelberg, New York, 1976, Springer-Verlag, pp. 73–89.

[37] D. R. Fokkema, G. L. G. Sleijpen, and H. A. Van der Vorst, Generalized con-jugate gradient squared, J. Comput. Appl. Math., 71 (1996), pp. 125–146.

Page 199: Diederik Fokkema - Thesis

185

[38] J. G. F. Francis, The QR transformation: A unitary analogue to the LR transfor-mation, parts I and II, Comput. J., 4 (1961), pp. 265–272, 332–345.

[39] R. Freund, A transpose-free quasi-minimal residual algorithm for non-Hermitianlinear systems, SIAM J. Sci. Comput., 14 (1993), pp. 470–482.

[40] R. W. Freund, M. Gutknecht, and N. M. Nachtigal, An implementa-tion of the look-ahead Lanczos algorithm for non-Hermitian matrices, SIAMJ. Sci. Statist. Comput., 14 (1993), pp. 137–158.

[41] R. W. Freund and N. M. Nachtigal, QMR: A quasi minimal residual method fornon-Hermitian linear systems, Numer. Math., 60 (1991), pp. 315–339.

[42] R. W. Freund and T. Szeto, A transpose-free quasi-minimal residual squared algo-rithm for non-Hermitian linear systems, in Advances in Computer Methods forPartial Differential Equations – VII, V. et al., ed., IMACS, 1992, pp. 258–264.

[43] R. Glowinski, H. B. Keller, and L. Reinhart, Continuation-conjugate gradientmethods for the least squares solution of nonlinear boundary value problems,SIAM J. Sci. Statist. Comput., 6 (1985), pp. 793–832.

[44] G. H. Golub and C. F. van Loan, Matrix Computations, The Johns Hopkins Uni-versity Press, Baltimore and London, 1989. Second Edition.

[45] A. Greenbaum, Estimating the attainable accuracy of recursively computed residualmethods, preprint, Courant Institute of Math. Sc., 1995.

[46] I. Gustafsson, A class of first order factorizations methods, BIT, 18 (1978), pp. 142–156.

[47] M. H. Gutknecht, The unsymmetric Lanczos algorithms and their relations to Padeapproximation, continued fraction and the QD algorithm, in Proceedings of theCopper Mountain Conference on Iterative Methods, 1990.

[48] M. H. Gutknecht, A completed theory of the unsymmetric Lanczos process andrelated algorithms, part 1, SIAM J. Matrix Anal. Appl., 13 (1992), pp. 594–639.

[49] , Variants of BiCGStab for matrices with complex spectrum, SIAM J. Sci.Comput., 14 (1993), pp. 1020–1033.

[50] , A completed theory of the unsymmetric Lanczos process and related algo-rithms, part 2, SIAM J. Matrix Anal. Appl., 15 (1994), p. ???

[51] M. R. Hestenes and E. Stiefel, Methods of conjugate gradients for solving linearsystems, J. Res. Nat. Bur. Stand., 49 (1954), pp. 409–436.

[52] E. Hopf, The partial differential equation ut + uux = µuxx, Communications PureApplied Mathematics, 3 (1950), pp. 201–230.

[53] Y. Huang and H. A. Van der Vorst, Some observations on the convergence be-haviour of GMRES, Tech. Report 89-09, Delft University of Technology, Facultyof Tech. Math., 1989.

[54] I. E. Kaporin and O. Axelsson, On a class of nonlinear equation solvers based onthe residual norm reduction over a sequence of affine subspaces, SIAM J. Sci.Comput., 16 (1995).

[55] T. Kerkhoven and Y. Saad, Acceleration techniques for decoupling algorithms insemiconductor simulation, Report UIUCDCS-R-87-1363, Dep. of Comp. Sci.,University of Illinois, Urbana, 1987.

[56] C. Lanczos, An iteration method for the solution of the eigenvalue problem of lin-ear differential and integral operators, J. Res. Nat. Bur. Standards, 45 (1950),pp. 255–282. Research paper 2133.

[57] , Solution of systems of linear equations by minimized iteration, J. Res. Nat.Bur. Standards, 49 (1952), pp. 33–53.

[58] R. B. Lehoucq, Analysis and Implementation of an Implicitly Restarted ArnoldiIteration, PhD thesis, Department of Computational and Applied Mathematics,Rice University, Houston, Texas, 1995.

[59] R. B. Lehoucq and J. A. Scott, An evaluation of software for computing eigenval-ues of sparse nonsymmetric matrices, tech. report, Mathematics and Computer

Page 200: Diederik Fokkema - Thesis

186 References

Science Division, Argonne National Laboratory, Argonne, 1996.[60] A. Liegmann, Efficient Solution of Large Sparse Linear Systems, PhD thesis, ETH

Zurich, 1995.[61] U. Meier Yang, Preconditioned conjugate gradient-like methods for nonsymmetric

linear systems, tech. report, Center for Research and Development, University ofIllinois at Urbana-Champaign, 1992.

[62] J. A. Meijerink and H. A. Van der Vorst, An iterative solution method for linearsystems of which the coefficient matrix is a symmetric M-matrix, Math. Comp.,31 (1977), pp. 148–162.

[63] C. B. Moler and G. W. Stewart, An algorithm for generalized matrix eigenvalueproblems, SIAM J. Numer. Anal., 10 (1973), pp. 241–256.

[64] J. J. More, The Levenberg-Marquardt algorithm: Implementation and theory, inNumerical Analysis, G. A. Watson, ed., vol. 630 of Lecture Notes in Mathematics,Springer-Verlag, Berlin, Heidelberg, New York, 1977, ch. 105-116.

[65] R. B. Morgan, Computing interior eigenvalues of large matrices, Linear AlgebraAppl., 154/156 (1991), pp. 289–309.

[66] , Generalizations of Davidson’s method for computing eigenvalues of large non-symmetric matrices, J. Comput. Phys., 101 (1992), pp. 287–291.

[67] N. M. Nachtigal, S. C. Reddy, and L. N. Trefethen, How fast are nonsymmetricmatrix iterations?, SIAM J. Matrix Anal. Appl., 13 (1992), pp. 778–795.

[68] A. Neumaier. Oral presentation at the Oberwolfach meeting, April 1994.[69] J. M. Ortega and W. C. Rheinboldt, Iterative Solutions of Nonlinear Equations

in Several Variables, Academic Press, 111 Fifth Avenue, New York, New York10003, 1970.

[70] C. C. Paige, B. N. Parlett, and H. A. Van der Vorst, Approximate solutionsand eigenvalue bounds from Krylov subspaces, Linear Algebra Appl., 2 (1995),pp. 115–133.

[71] B. N. Parlett, The Symmetric Eigenvalue Problem, Prentice-Hall, Englewood Cliffs,NJ, 1980.

[72] B. N. Parlett, D. R. Taylor, and Z. A. Liu, A look-ahead Lanczos algorithm forunsymmetric matrices, MathComp, 44 (1985), pp. 105–124.

[73] S. J. Polak, C. den Heijer, W. H. A. Schilders, and P. Markowich, Semi-conductor device modelling from the numerical point of view, Int. J. for Num.Methods in Eng., 24 (1987), pp. 763–838.

[74] C. Pommerell and W. Fichtner, PILS: An iterative linear solver packagefor ill-conditioned systems, in Supercomputing ’91, Los Alamitos, Ca., 1991,ACM/IEEE Computer Society Press, pp. 588–599.

[75] J. Ruge and K. Stuben, Efficient solution of finite difference and finite elementequations, in Multigrid Methods for Integral and Differential Equations, D. J.Paddon and H. Holstein, eds., Oxford, 1985, Clarendon Press, pp. 200–203.

[76] A. Ruhe, Perturbation bounds for means of eigenvalues and invariant subspaces,BIT, 10 (1970), pp. 343–354.

[77] , Rational Krylov algorithms for nonsymmetric eigenvalue problems II. MatrixPairs, Linear Algebra Appl., 197/198 (1994), pp. 283–295.

[78] , Rational Krylov algorithms for nonsymmetric eigenvalue problems III. Com-plex shifts for real matrices, BIT, 34 (1994), pp. 165–176.

[79] Y. Saad, Krylov subspace method for solving large unsymmetric linear systems,Math. Comp., 37 (1981), pp. 105–126.

[80] , Numerical Methods for Large Eigenvalue Problems, Manchester UniversityPress, Manchester, 1992.

[81] , A flexible inner-outer preconditioned GMRES algorithm, SIAM J. Sci. Com-put., 14 (1993), pp. 461–469.

[82] Y. Saad and M. H. Schultz, GMRES: A generalized minimum residual algorithm

Page 201: Diederik Fokkema - Thesis

187

for solving nonsymmetric linear systems, SIAM J. Sci. Statist. Comput., 7 (1986),pp. 856–869.

[83] J. A. Scott, An Arnoldi code for computing selected eigenvalues of sparse real un-symmetric matrices, ACM Trans. Math. Software, 64 (1995), pp. 181–193.

[84] G. L. G. Sleijpen, J. G. L. Booten, D. R. Fokkema, and H. A. Van derVorst, Jacobi-Davidson type methods for generalized eigenproblems and poly-nomial eigenproblems, Preprint 923, Department of Mathematics, Utrecht Uni-versity, Utrecht, The Netherlands, Revised version, November 1995. To appearin BIT.

[85] G. L. G. Sleijpen and D. R. Fokkema, BiCGstab(`) for linear equations involvingmatrices with complex spectrum, Electronic Transactions on Numerical Analysis,1 (1993), pp. 11–32.

[86] G. L. G. Sleijpen and H. A. Van der Vorst, Optimal iteration methods for largelinear systems of equations, in Numerical Methods for Advection-Diffusion Prob-lems, C. B. Vreugdenhil and B. Koren, eds., vol. 45, Vieweg, Braunschweig, 1993,ch. 12, pp. 291–320.

[87] , The Jacobi-Davidson method for eigenvalue problems and its relation to accel-erated inexact Newton schemes, preprint, Department of Mathematics, UtrechtUniversity, Utrecht, The Netherlands, 1995. To appear in the Proceedings of the“Second IMACS International Symposium on Iterative Methods in Linear Alge-bra”, June 17-20, 1995, Blagoevgrad, “Contemporary Mathematics (CONM)” ofthe AMS.

[88] , Maintaining convergence properties of BiCGstab methods in finite precisionarithmetic, Numerical Algorithms, 10 (1995), pp. 203–223.

[89] , An overview of approaches for the stable computation of hybrid BiCG meth-ods, Preprint 908, Department of Mathematics, Utrecht University, Utrecht, TheNetherlands, March 1995. To appear in Appl. Numer. Math.

[90] , A Jacobi-Davidson iteration method for linear eigenvalue problems, SIAM J.Matrix Anal. Appl., 17 (1996), pp. 401–425.

[91] , Reliable updated residuals in hybrid Bi-CG methods, Computing, 56 (1996),pp. 141–163.

[92] G. L. G. Sleijpen, H. A. Van der Vorst, and D. R. Fokkema, BiCGstab(`) andother hybrid Bi-CG methods, Numerical Algorithms, 7 (1994), pp. 75–109.

[93] P. Sonneveld, CGS, a fast Lanczos-type solver for nonsymmetric linear systems,SIAM J. Sci. Statist. Comput., 10 (1989), pp. 36–52.

[94] D. C. Sorensen, Implicit application of polynomial filters in a k-step Arnoldi method,SIAM J. Matrix Anal. Appl., 13 (1992), pp. 357–385.

[95] G. W. Stewart, Algorithm 406 HQR3 and EXCHNG: Fortran subroutines for cal-culating and ordering eigenvalues of a real upper Hessenberg matrix, ACM Trans.Math. Software, 2 (1976), pp. 275–280.

[96] G. W. Stewart and J. Sun, Matrix Pertubation Theory, Academic Press, San Diego,California, 1990.

[97] W. J. Stewart and A. Jennings, ALGORITHM 570: LOPSI: a simultaneous it-eration method for real matrices [F2], ACM Trans. Math. Software, 7 (1981),pp. 230–232.

[98] A. Van der Sluis and H. A. Van der Vorst, The rate of convergence of conjugategradients, Numerische Mathematik, 48 (1986), pp. 543–560.

[99] , The convergence behavior of Ritz values in the presence of close eigenvalues,Linear Algebra Appl., 88/89 (1987), pp. 651–694.

[100] H. A. Van der Vorst, Preconditioning by Incomplete Decompositions, PhD thesis,Utrecht University, Utrecht, The Netherlands, 1982.

[101] , The convergence behavior of preconditioned CG and CG-S in the presence ofrounding errors, in Lecture Notes in Math., 1457, Springer-Verlag, Berlin, 1990,

Page 202: Diederik Fokkema - Thesis

188 References

pp. 126–136.[102] , Bi-CGSTAB: A fast and smoothly converging variant of Bi-CG for the solu-

tion of nonsymmetric linear systems, SIAM J. Sci. Statist. Comput., 13 (1992),pp. 631–644.

[103] H. A. Van der Vorst and G. L. G. Sleijpen, The effect of incomplete decompo-sition preconditioning on the convergence of conjugate gradients, in IncompleteDecompositions, Proceedings of the Eight GAMM Seminar, Braunschweig, 1992,Vieweg Verlag.

[104] H. A. Van der Vorst and C. Vuik, The superlinear convergence behaviour of GM-RES, J. Comput. Appl. Math., 48 (1993), pp. 327–341.

[105] , GMRESR: A family of nested GMRES methods, Linear Algebra Appl., 1(1994), pp. 369–386.

[106] P. Van Dooren, A generalized eigenvalue approach for solving Ricatty equations,SIAM J. Sci. Comput., 2 (1981), pp. 121–135.

[107] , Algorithm 590, DUSBSP and EXCHQZ: FORTRAN subroutines for com-puting deflating subspaces with specified spectrum, ACM Trans. Math. Software,8 (1982), pp. 376–382.

[108] C. Vuik, Further experiences with GMRESR, Tech. Report 92-12, Faculty of Tech-nical Mathematics and Informatics, Delft University of Technology, Delft, TheNetherlands, 1992.

[109] J. H. Wilkinson, The Algebraic Eigenvalue Problem, Oxford University Press, Ox-ford, 1965.

[110] D. M. Young and K. C. Jea, Generalized conjugate-gradient acceleration of non-symmetrizable iterative methods, Linear Algebra Appl., 34 (1980), pp. 159–194.

[111] L. Zhou and H. F. Walker, Residual smoothing techniques for iterative methods,SIAM J. Sci. Comput., 15 (1994), pp. 297–312.

Page 203: Diederik Fokkema - Thesis

Summary

In this thesis we describe new computational methods for the iterative solutionof linear, nonlinear, and eigenproblems. The solution of this kind of problemsplays an important role in scientific models for helping to answer questionsregarding: wheather forecasting, car safety, flying properties of an aircraft, theprotection of dykes against flooding, the characteristics of a semiconductor, theload a bridge can take, the way in which chemical reactions take place, etc.

Handling this kind of problem can be done by means of partial differentialequations. The size of the set equations, obtained after discretization, maychallenge the possibilities of the existing direct methods. In fact, in actualcomputation a significant part of the computing time is required for solvingthese linear algebra subproblems, and this makes it paramount to consideralternatives. In particular, it may be more efficient or even necessary to useappropriate iterative methods.

Iterative methods are relevantly different from direct methods, in that theydo not attempt to solve the given problem in one complete step of given compu-tational complexity. Instead, they attempt to improve a given approximationin a number of successive steps. Each of these steps is of modest computa-tional complexity, and the number of steps is usually not known in advance.A popular iterative approach is to construct a subspace and to transform thegiven large problem into a much smaller problem. The solution of this mucheasier to handle smaller problem then leads to a correction for the existingapproximation. By selecting a suitable expansion for the subspace this pro-cess may be repeated. In real applications it is sometimes possible to selectan appropriate iterative method for which only a modest number of iterationsis sufficient to obtain an acceptable solution, and in such cases these iterativemethods are very attractive.

In the last decades much research has been devoted to the construction ofsuitable iterative methods, and many algorithms have been suggested. How-ever, the usage of these methods does not go without problems. Sometimes toomany iterations are needed to converge, and consequently too much cpu-timeis needed, and sometimes they simply do not converge to the desired answer.The lack of convergence may be due to the fact that the method is not appro-

Page 204: Diederik Fokkema - Thesis

190 Summary

priate for the given problem in view of required mathematical properties, butit may also happen that rounding errors spoil a potentially converging process.

The methods proposed in this thesis have improved properties with respectto the above mentioned problems. By carefully inspecting situations where aspecific method fails it may be deduced whether this is due to rounding errors,for which some of these methods can be improved, or whether this is inherentto the selection of a subspace for the method. In the latter case we can lookfor alternative selection strategies. By doing so, we can often obtain betterapproximate solutions as well save computing resources (computer memoryand cpu-time).

In Chapter 1–4 we focus on iterative methods for linear problems in partic-ular. The existing methods GMRES, CGS, and Bi-CGSTAB are investigatedand shortcomings are identified. Our investigations have led to methods withbetter convergence properties for relevant classes of problems. In particular wehave proposed the method GCRO, as an alternative for the existing methodGMRESR, the method GCGS, as an alternative for CGS in a Newton scheme,and Bi-CGSTAB(`), as alternative for the popular Bi-CGSTAB method. Theimproved properties are illustrated by their behavior on well-chosen numericalexamples.

In Chapter 5 we present a framework for the solution of general nonlinearproblems. Many existing algorithms are covered by this framework. Theframework is suggested, in a quite natural way, by the subspace approachesthat are used in various iterative methods. It deepens our understanding ofthe underlying relationships and it also brings new computational approachesto the surface. Numerical experiments give evidence that this may lead tomore efficient computational schemes for given problems.

In the last chapter, Chapter 6, we propose a new algorithm for the partialsolution of standard eigenproblems (JDQR), and one for generalized eigenprob-lems (JDQZ). An important difference, with respect to the standard Lanczosand Arnoldi methods, is that our methods may be combined with precondition-ing techniques. This may help to speed up the convergence and it makes thesolution of very large eigenproblems feasable. Our approaches are based uponthe recently published Jacobi-Davidson algorithms, and it includes strategiesfor keeping the required subspaces of low dimension. A number of numericalexperiments illustrates the potential of this approach.

Page 205: Diederik Fokkema - Thesis

Samenvatting

In deze dissertatie wordt een aantal nieuwe methoden beschreven voor hetiteratief oplossen van lineaire, niet-lineaire, en/of eigen problemen met behulpvan de computer. De oplossing van dit soort problemen speelt een belangrijkerol in wetenschappelijke modellen die helpen bij het beantwoorden van vragenals: wat voor het weer wordt het, hoe veilig is een auto, wat is het vlieggedragvan een vliegtuig, hoe bestendig zijn dijken tegen overstromingen, hoe snelwerkt een halfgeleider, hoeveel belasting kan een brug verdragen, hoe verloopteen chemische reactie, enzovoorts.

In de praktijk modeleert men dit soort vraagstukken met behulp van parti-ele differentiaal vergelijkingen. De grootte van de na discretisatie verkregenstelsels grenst in de regel aan de mogelijkheden van de bestaande directe oploss-ings methoden. In feite bestaat een significant percentage van de gebruiktecomputertijd, die gespendeerd wordt aan het oplossen van een bepaald prob-leem, uit het oplossen van deze deelproblemen. Dit maakt het interessantom alternatieven te overwegen. In het bijzonder kan het efficienter of zelfsnoodzakelijk zijn een geschikte iteratieve methode te gebruiken.

Een belangrijk verschil tussen directe en iteratieve methoden is dat iter-atieve methoden het probleem niet in een enkele stap van gegeven rekenkundigecomplexiteit oplossen. Een iteratieve methode probeert daarentegen een bestaandebenadering te verbeteren in snel opeenvolgde, kleinere stappen. Elk van dezestappen is van geringe rekenkundige complexiteit en het aantal stappen ligtnormaal gesproken niet van te voren vast. Een populaire iteratieve aanpakis om een deelruimte te construeren en daarmee het grote probleem te reduc-eren tot een veel kleiner, gelijksoortig probleem. De gemakkelijk te verkrijgenoplossing daarvan leidt dan tot een correctie van de meest recente benadering.Door de deelruimte adequaat uit te breiden kan dit proces herhaald worden.In veel toepassingen is het mogelijk een iteratieve methode te kiezen die maareen bescheiden aantal van zulke stappen nodig heeft om tot een acceptabeleoplossing te komen. In die gevallen is zo’n iteratieve methode natuurlijk zeeraantrekkelijk.

In de laatste decennia is heel wat onderzoek gewijd geweest aan de on-twikkeling van geschikte iteratieve methoden en al heel wat verschillende meth-

Page 206: Diederik Fokkema - Thesis

192 Samenvatting

oden zijn voorgesteld. Echter, een probleem blijft dat ze lang niet altijd naartevredenheid werken. Soms vergen ze te veel iteraties en dus te veel computer-tijd, en soms convergeren ze niet naar de gewenste oplossing. Het gebrek aanconvergentie kan te wijten zijn aan de ongeschikheid van de iteratieve methodvoor een gegeven probleem, gelet op vereiste wiskundige aspecten, maar hetkan ook gebeuren dat door afrondingsfouten de benaderde oplossing onaccept-abele afwijkingen gaat vertonen.

De in dit proefschrift voorgestelde nieuwe methoden brengen nu hierin ver-betering. Door zorgvuldig na te gaan waar het fout kan gaan, kan men afleidenof het aan afrondfouten ligt of dat het inherent is aan de keuze van de deel-ruimten. Men kan dan maatregelen inbouwen om afrondfouten te voorkomenof men kan geschiktere deelruimten kiezen. Zo kan in veel gevallen een betereapproximatie gevonden worden en bovendien de rekentijd aanzienlijk verkortworden.

In hoofdstuk 1 tot en met 4 staan iteratieve methoden voor lineaire proble-men centraal. De bestaande methoden GMRES, CGS, en Bi-CGSTAB wordenonder de loep genomen en een aantal tekortkomingen wordt blootgelegd. Ditleidt dan tot methoden met verbeterde convergentie-eigenschappen voor rel-evante klassen van problemen. In het bijzonder wordt de methode GCROvoorgesteld, als een alternatief voor GMRESR, de methode qGCGS, als eenalternatief voor CGS in een Newton schema, en BiCGstab(`), als een alter-natief voor de populaire Bi-CGSTAB methode. De verbeterde eigenschappenworden geıllustreerd met toepasselijke numerieke experimenten

In hoofdstuk 5 wordt een raamwerk geıntroduceerd voor het oplossen vanalgemene niet-lineaire problemen. Het raamwerk is geınspireerd op de overeenkom-sten van al bestaande deelruimte methoden en er vloeien vele bekende metho-den uit voort. Het vergroot het inzicht in de onderlinge relaties en het brengtook nieuwe mogelijkheden aan het licht. Numeriek experimenten laten zien datdeze aanpak kan leiden tot efficientere algorithmen voor een gegeven probleem.

In het laatste hoofdstuk, hoofdstuk 6, worden twee algorithmen beschreven,die geschikt zijn voor het berekenen van enkele eigenwaarden en eigenvectorenvan standaard en gegeneraliseerde eigenproblemen. Een zeer belangrijk ver-schil, in vergelijking met bestaande methoden zoals Lanczos en Arnoldi, is datdeze methoden, JDQR en JDQZ geheten, het mogelijk maken de convergentie-snelheid te verhogen door middel van preconditionering. Dit laatste brengt hetoplossen van zeer grote eigenproblemen onder handbereik. De methoden zijngebaseerd op de recent gepubliceerde Jacobi-Davidson algorithmen, en bevat-ten ondermeer strategieen om de dimensie van de deelruimten onder de duimte houden. Een aantal numerieke experimenten illustreren het potentieel vandeze aanpak.

Page 207: Diederik Fokkema - Thesis

Curriculum vitae

Diederik Redbad Fokkema werd geboren op 3 maart 1966 te Amsterdam. Nahet behalen van het diploma ongedeeld VWO aan Het Nieuwe Lyceum teBilthoven, begon hij in september 1984 aan de studie wiskunde aan de Uni-versiteit van Amsterdam. Naast de studie leerde hij ondermeer de sportievegeneugten van het wedstrijdroeien bij de A. S.R. Nereus kennen. De doctoraalfase, onder supervisie van Prof. dr. P. J. Hemker, werd afgerond met een scrip-tie “Multigrid Schemes and Defect Correction”. In augustus 1990 behaaldehij het doctoraal met industriele wiskunde als specialisatie. Daarna volgde demilitaire dienst.

In januari 1992 werd hij aangesteld als assistent in opleiding (AIO) aan deUniversiteit Utrecht bij de Vakgroep Wiskunde van de Faculteit der Wiskundeen Informatica. Het onder leiding van Prof. dr. H.A. Van der Vorst verrichteonderzoek heeft geleid tot dit proefschrift.

In augustus 1995 werd hij de gelukkige vader van zijn dochter Anne.Sinds januari 1996 werkt hij als numericus bij ISE Integrated Systems En-

gineering AG te Zurich. Hij werkt daar aan het oplossen van grote stelsellineaire, niet-lineaire, en/of eigen problemen die optreden bij de simulatie vanhalfgeleiders.