Skip to main content
NIHPA Author Manuscripts logoLink to NIHPA Author Manuscripts
. Author manuscript; available in PMC: 2014 Oct 16.
Published in final edited form as: ACM Trans Math Softw. 2014 Feb;40(2):10.1145/2527267. doi: 10.1145/2527267

Algorithm 937: MINRES-QLP for Symmetric and Hermitian Linear Equations and Least-Squares Problems

Sou-Cheng T Choi 1, Michael A Saunders 2
PMCID: PMC4199394  NIHMSID: NIHMS591419  PMID: 25328255

Abstract

We describe algorithm MINRES-QLP and its FORTRAN 90 implementation for solving symmetric or Hermitian linear systems or least-squares problems. If the system is singular, MINRES-QLP computes the unique minimum-length solution (also known as the pseudoinverse solution), which generally eludes MINRES. In all cases, it overcomes a potential instability in the original MINRES algorithm. A positive-definite pre-conditioner may be supplied. Our FORTRAN 90 implementation illustrates a design pattern that allows users to make problem data known to the solver but hidden and secure from other program units. In particular, we circumvent the need for reverse communication. Example test programs input and solve real or complex problems specified in Matrix Market format. While we focus here on a FORTRAN 90 implementation, we also provide and maintain MATLAB versions of MINRES and MINRES-QLP.

General Terms: Algorithms

Additional Key Words and Phrases: Krylov subspace method, Lanczos process, conjugate-gradient method, singular least-squares, linear equations, minimum-residual method, pseudoinverse solution, ill-posed problem, regression, sparse matrix, data encapsulation

1. INTRODUCTION

MINRES-QLP [Choi 2006; Choi et al. 2011] is a Krylov subspace method for computing the minimum-length and minimum-residual solution (also known as the pseudoinverse solution) x to the following linear systems or least-squares (LS) problems:

solveAx=b, (1)
minimizex2such thatAx=b, (2)
minimizex2such thatxargminxAxb2, (3)

where A is an n × n symmetric or Hermitian matrix and b is a real or complex n-vector. Problems (1) and (2) are treated as special cases of (3). The matrix A is usually large and sparse, and it may be singular.1 It is defined by means of a user-written subroutine Aprod, whose function is to compute the product y = Aυ for any given vector υ.

Let xk be the solution estimate associated with MINRES-QLP’s kth iteration, with residual vector rk = bAxk. Without loss of generality, we define x0 = 0. MINRES-QLP provides recurrent estimates of ‖xk‖, ‖rk‖, ‖Ark‖, ‖A‖, cond(A), and ‖Axk‖, which are used in the stopping conditions.

Other iterative methods specialized for symmetric systems Ax = b are the conjugate-gradient method (CG) [Hestenes and Stiefel 1952], SYMMLQ and MINRES [Paige and Saunders 1975], and SQMR [Freund and Nachtigal 1994]. Each method requires one product Aυk at each iteration for some vector υk. CG is intended for positive-definite A, whereas the other solvers allow A to be indefinite.

If A is singular, SYMMLQ requires the system to be consistent, whereas MINRES returns an LS solution for (3) but generally not the min-length solution; see [Choi 2006; Choi et al. 2011] for examples. SQMR without preconditioning is mathematically equivalent to MINRES but could fail on a singular problem. To date, MINRES-QLP is probably the most suitable CG-type method for solving (3).

In some cases, the more established symmetric methods may still be preferable.

  1. If A is positive definite, CG minimizes the energy norm of the error ‖xxkA in each Krylov subspace and requires slightly less work per iteration. However, CG, MINRES, and MINRES-QLP do reduce ‖xxkA and ‖xxk‖ monotonically. Also, MINRES and MINRES-QLP often reduce ‖rk‖ to the desired level significantly sooner than does CG, and the backward error for each xk decreases monotonically. (See Section 2.4 and Fong [2011] and Fong and Saunders [2012].)

  2. If A is indefinite but Ax = b is consistent (e.g., if A is nonsingular), SYMMLQ requires slightly less work per iteration, and it reduces the error norm ‖xxk‖ monotonically. MINRES and MINRES-QLP usually reduce ‖xxk‖ [Fong 2011; Fong and Saunders 2012].

  3. If A is indefinite and well conditioned and Ax = b is consistent, MINRES might be preferable to MINRES-QLP because it requires the same number of iterations but slightly less work per iteration.

  4. MINRES and MINRES-QLP require a preconditioner to be positive definite. SQMR might be preferred if A is indefinite and an effective indefinite preconditioner is available.

MINRES-QLP has two phases. Iterations start in the MINRES phase and transfer to the MINRES-QLP phase when a subproblem (see (8)) becomes ill-conditioned by a certain measure. If every subproblem is of full rank and well-conditioned, the problem can be solved entirely in the MINRES phase, where the cost per iteration is essentially the same as for MINRES. In the MINRES-QLP phase, one more work vector and 5n more multiplications are used per iteration.

MINRES-QLP described here is implemented in FORTRAN 90 for real double-precision problems. It contains no machine-dependent constants and does not use any features from later standards. It requires an auxiliary subroutine Aprod and, if a preconditioner is supplied, a second subroutine Msolve. We also provide a complex implementation for Hermitian problems. Precision other than double can be obtained by changing one line of code.

We also maintain a MATLAB implementation capable of solving both real and complex problems. All implementations are available at [SOL].

Table I lists the main notation used.

Table I.

Key Notation

‖ · ‖ matrix or vector two-norm
Ā Ā = A − σ I (see also σ below)
cond(A) condition number of A with respect to two-norm = max|λi|minλi0|λi|
ei ith unit vector
index of the last Lanczos iteration when βℓ+1 = 0
n order of A
null(A) null space of A defined as {x ∈ ℝn | Ax = 0}
range(A) column space of A defined as {Ax | x ∈ ℝn}
T (right superscript to a vector or a matrix) transpose
x unique minimum-length least-squares solution of problem (3)
𝒦k(A, b) kth Krylov subspace defined as span{b, Ab,…, Ak−1b}
ε machine precision
σ real scalar shift to diagonal of A

1.1. Least-Squares Methods

Further existing methods that could be applied to (3) are CGLS and LSQR [Paige and Saunders 1982a, 1982b], LSMR [Fong and Saunders 2011], and GMRES [Saad and Schultz 1986], all of which reduce ‖rk‖ monotonically. The first three methods would require two products Aυk and Auk each iteration and would be generating points in less favorable subspaces. GMRES requires only products Aυk and could use any nonsingular (possibly indefinite) preconditioner. It needs increasing storage and work each iteration, perhaps requiring restarts, but it could be more effective than MINRES or MINRES-QLP (and the other solvers) if few total iterations were required. Table II summarizes the computational requirements of each method.

Table II.

Comparison of Various Least-Squares Solvers on n × n Systems (3)

Solver Storage Work per
Iteration
Products per
Iteration
Systems to Solve per
Iteration with Preconditioner

MINRES 7n 9n 1 1
MINRES-QLP 7n – 8n 9n – 14n 1 1
GMRES(m) (m + 2)n (m + 3 + 1/m)n 1 1
CGLS 4n 5n 2 2
LSQR 5n 8n 2 2
LSMR 6n 9n 2 2

Storage refers to memory required by working vectors in the solvers. Work counts number of floating-point multiplications. On inconsistent systems, all solvers below except MINRES and GMRES with restart parameter m return the minimum-length LS solution (assuming no preconditioner).

1.2. Regularization

We do not discourage using CGLS, LSQR, or LSMR if the goal is to regularize an ill-posed problem using a small damping factor λ > 0 as follows:

minx[AλI]x[b0]. (4)

However, this approach destroys the original problem’s symmetry. The normal equation of (4) is (A2 + λ2 I)x = Ab, which suggests that a diagonal shift to A may well serve the same purpose in some cases. For symmetric positive-definite A, Ā = A − σ I with σ < 0 enjoys a smaller condition number. When A is indefinite, a good choice of σ may not exist, for example, if the eigenvalues of A were symmetrically positioned around zero. When this symmetric form is applicable, it is convenient in MINRES and MINRES-QLP; see (3), (5), and (15). We also remark that MINRES and MINRES-QLP produce good estimates of the largest and smallest singular values of Ā (via diagonal values of Rk or Lk in (7) and (11); see Choi et al. [2011, Section 4]).

Three other regularization tools in the literature (see Golub and Van Loan [1996, Sections 12.1.1–12.1.3] and Hansen [1998]) are LSQI, cross-validation, and L-curve. LSQI involves solving a nonlinear equation and is not immediately compatible with the Lanczos framework. Cross-validation takes one row out at a time and thus does not preserve symmetry. The L-curve approach for a CG-type method takes iteration k as the regularization parameter [Hansen 1998, Chap. 8] if both ‖rk‖ and ‖xk‖ are monotonic. By design, ‖rk‖ is monotonic in MINRES and MINRES-QLP, and so is ‖xk‖ when Ā is positive definite [Fong 2011]. Otherwise, we prefer the condition L-curve approach in Calvetti et al. [2000], which graphs cond(Tk) against ‖rk‖. Yet another L-curve feasible in MINRES-QLP is xk2(2) against ‖rk‖, since the former is also monotonic (but available two iterations in lag); see Section 2.4.

2. MATHEMATICAL BACKGROUND

Notation and details of algorithmic development from [Choi 2006; Choi et al. 2011] are summarized here. As noted earlier, “A” in (1)(3) is treated as A− σ I.

2.1. Lanczos Process

MINRES and MINRES-QLP use the symmetric Lanczos process [Lanczos 1950] to reduce A to a tridiagonal form Tk¯. The process is initialized with υ0 ≡ 0, β1 = ‖b‖, and β1υ1 = b. After k steps of the tridiagonalization, we have produced

pk=Aυkσυk,αk=υkTpk,βk+1υk+1=pkαkυkβkυk1, (5)

where we choose βk > 0 to give ‖υk‖ = 1. Numerically,

pk=Aυkσυkβkυk1,αk=υkTpk,βk+1υk+1=pkαkυk

is slightly better than (5) [Paige 1976], but we can express (5) in matrix form:

Vk[υ1υk],AVk=Vk+1Tk¯,Tk¯[Tkβk+1ekT], (6)

where Tk = tridiag(βi, αi, βi+1), i = 1, …, k. In exact arithmetic, the Lanczos vectors in the columns of Vk are orthonormal, and the process stops with k = ℓ when βℓ+1 = 0 for some ℓ ≤ n, and then AV = VT. The rank of T could be ℓ or ℓ − 1 (see Theorem 2.2).

2.2. MINRES Phase

MINRES-QLP typically starts with a MINRES phase, which applies a series of reflectors Qk to transform Tk¯ to an upper triangular matrix Rk¯:

Qk[Tk¯β1e1]=[Rktk0ϕk][Rk¯k+1], (7)

where

Qk=Qk,k+1[Qk11],Qk,k+1[Ik1ckskskck].

In the kth step, Qk,k+1 is effectively a Householder reflector of dimension 2 [Trefethen and Bau 1997, Exercise 10.4], and its action including its effect on later columns of Tj, k < j ≤ ℓ, is compactly described by

[ckskskck][γkδk+10βk+1αk+1βk+2|ϕk10]=[γk(2)δk+1(2)εk+20γk+1δk+2|τkϕk],

where the superscripts with numbers in parentheses indicate the number of times the values have been modified. The kth solution approximation to (3) is then defined to be xk = Vkyk, where yk solves the subproblem

yk=argminykTk¯yβ1e1=argminykRk¯yk+1. (8)

When k < ℓ, Rk is nonsingular and the unique solution of this subproblem satisfies Rkyk = tk. Instead of solving for yk, MINRES solves RkTDkT=VkT by forward substitution, obtaining the last column dk of Dk at iteration k. At the same time, it updates xk ∈ 𝒦k(A, b) (see Table I for definition) via x0 ≡ 0 and

xk=Vkyk=DkRkyk=Dktk=xk1+τkdk,τkekTtk, (9)

where one can show using Vk = DkRk that dk=(υkδk(2)dk1εkdk2)/γk(2).

2.3. MINRES-QLP Phase

The MINRES phase transfers to the MINRES-QLP phase when an estimate of the condition number of A exceeds an input parameter trancond. Thus, trancond > 1/ε leads to MINRES iterates throughout (where ε ≈ 10−16 denotes the floating-point precision), whereas trancond = 1 generates MINRES-QLP iterates from the start.

Suppose for now that there is no MINRES phase. Then MINRES-QLP applies left reflections as in (7) and a further series of right reflections to transform Rk to a lower triangular matrix Lk = RkPk, where

Pk=P1,2P1,3P2,3Pk2,kPk1,k,Pk2,k=[Ik3ck2sk21sk2ck2],Pk1,k=[Ik2ck3sk3sk3ck3].

In the kth step, the actions of Pk−2,k and Pk−1,k are compactly described by

[γk2(5)εkϑk1γk1(4)δk(2)γk(2)][ck2sk21sk2ck2][1ck3sk3sk3ck3]=[γk2(6)ϑk1(2)γk1(4)δk(3)ηkγk(3)][1ck3sk3sk3ck3]=[γk2(6)ϑk1(2)γk1(5)ηkϑkγk(4)]. (10)

The kth approximate solution to (3) is then defined to be xk = Vkyk = VkPkuk = Wkuk, where uk solves the subproblem

ukargminuus.t.uargminuk[Lk0]u[tkϕk]. (11)

For k < ℓ, Rk and Lk are nonsingular because Tk¯ has full column rank by Lemma 2.1 below. It is only when k = ℓ and b ∉ range(A) that Rk and Lk are singular with rank ℓ − 1 by Theorem 2.2, in which case one can show that ηk=γk(3)=ϑk=γk(4)=0 in (10) and L=[L1000] with Lℓ−1 nonsingular. In any case, we need to solve only the nonsingular lower triangular systems Lkuk = tk or Lℓ−1uℓ−1 = tℓ−1. Then, uk and yk = Pkuk are the min-length solutions of (11) and (8), respectively.

MINRES-QLP updates xk−2 to obtain xk by short-recurrence orthogonal steps:

xk2(2)=xk3(2)+μk2(3)wk2(4),wherexk3(2)Wk3(4)μk3(3), (12)
xk=xk2(2)+μk1(2)wk1(3)+μkwk(2), (13)

where wj refers to the jth column of Wk = VkPk and μi is the ith element of uk.

If this phase is preceded by a MINRES phase of k iterations (0 < k < ℓ), it starts by transferring the last three vectors dk−2, dk−1, dk to wk−2, wk−1, wk, and the solution estimate xk from (9) to xk2(2) in (12). This needs the last two rows of Lkuk = tk (to give μk−1, μk) and the relations Wk = DkLk and xk2(2)=xkμk1wk1μkwk. The cheaply available right reflections Pk and the bottom right 3 × 3 submatrix of Lk (i.e., the last term in (10)) need to have been saved in the MINRES phase in order to facilitate the transfer.

2.4. Norm Estimates and Stopping Conditions

Short-term recurrences are used to estimate the following quantities (where we assume σ = 0 for simplicity):

rkϕk=ϕk1sk,ϕ0=b(ϕk)Arkψk=ϕk[γk+1δk+2],(ψ=0)xk(2)χk2(2)=[χk3(2)μk2(3)],χ2=χ1=0(χk2(2))xkχk=[χk2(2)μk1(2)μk],χ0=0(χ=x)Axkωk=[ωk1τk],ω0=0(ωk)A𝒜k=max{𝒜k1,Tk¯ek,γ̅k},𝒜0=0(𝒜kA)cond(A)κk=𝒜k/γ̲k,κ0=1(κkcond(A)),

where γ̅k and γ̲k are the largest and smallest diagonals of Lk in absolute value. The up (down) arrows in parentheses indicate that the associated quantities increase (decrease) monotonically. The last two estimates tend to their targets from below; see Choi [2006] and Choi et al. [2011] for derivation.

MINRES-QLP has 14 possible stopping conditions in five classes that use the preceding estimates and optional user-input parameters itnlim, rtol, Acondlim, and maxxnorm:

  • (C1)
    from Lanczos and the QLP factorization:
    • k = itnlim; βk+1 < ε; |γk(4)|<ε
  • (C2)
    normwise relative backward errors (NRBE) [Paige and Strakoš 2002]:
    • rk‖/ (‖A‖ ‖xk‖ + ‖b‖) ≤ max(rtol, ε); ‖Ark‖/ (‖A‖ ‖rk‖) ≤ max(rtol, ε);
  • (C3)
    regularization attempts:
    • cond(A) ≥ min(Acondlim, 0.1/ε); ‖xk‖ ≥ maxxnorm;
  • (C4)
    degenerate cases:
    • β1 = 0 ⇒ b = 0 ⇒ x = 0 is the solution;
    • β2 = 0 ⇒ υ2 = 0 ⇒ Ab = α1b,
      • i.e., b and α1 are an eigenpair of A, and x = b1 solves Ax = b;
  • (C5)
    erroneous inputs:
    • A not symmetric; M not symmetric; M not positive definite;

where M is a preconditioner to be described in the next section. For symmetry of A, it is not practical to check eiTAej=ejTAei for all i, j = 1, …, n. Instead, we statistically test whether z = |xT(Ay)−yT(Ax)| is sufficiently small for two nonzero n-vectors x and y (e.g., each element in the vectors is drawn from the standard normal distribution). For positive definiteness of M, since M is positive definite if and only if M−1 is positive definite, we simply test that zkTM1zk=zkTqk>0 each iteration (see Section 3).

We find that the recurrence relations for ϕk and ψk hold to high accuracy. Thus xk is an acceptable solution of (3) if the computed value of ϕk or ψk is suitably small according to the NRBE tests in class (C2) above. When a condition in (C3) is met, the final xk may or may not be an acceptable solution.

The class (C1) tests for small βk+1 and γk(4) are included in the unlikely case in practice that the theoretical Lanczos termination occurs. Ideally, one of the NRBE tests should cause MINRES-QLP to terminate. If not, it is an indication that the problem is very ill-conditioned, in which case the regularization and preconditioning techniques of Sections 1.2 and 3 may be helpful.

2.5. Two Theorems

We complete this section by presenting two theorems from Choi et al. [2011] with slightly simpler proofs.

Lemma 2.1. rank(Tk¯)=k for all 1 ≤ k < ℓ.

Proof. For 1 ≤ k < ℓ, we have β2, …, βk+1 > 0 by definition. Hence, Tk¯ has full column rank.

Theorem 2.2. T is nonsingular if and only if b ∈ range(A). Furthermore, rank(T) = ℓ − 1 if b ∉ range(A).

Proof. We use AV = VT twice. First, if T is nonsingular, we can solve Ty = β1e1 and then AVy = VTy = Vβ1e1 = b. Conversely, if b ∈ range(A), then range(V) ⊆ range(A). Suppose T is singular. Then there exists z ≠ 0 such that VTz = AVz = 0. That is, 0 ≠ Vz ∈ null(A). But this is impossible because Vz ∈ range(A) and null(A) ∩ range(V) = 0. Thus, T must be nonsingular.

We have shown that if b ∉ range(A), T=[T1¯βe1α] is singular, and therefore ℓ > rank(T) ≥ rank(T1¯)=1 by Lemma 2.1. Therefore, rank(T) = ℓ − 1.

By Lemma 2.1 and Theorem 2.2, we are assured that the QLP decomposition without column pivoting [Stewart 1999; Choi et al. 2011] for Tk¯ is rank-revealing, which is a necessary precondition for solving a least-squares problem.

Theorem 2.3. In MINRES-QLP, x is the minimum-length solution of (3).

Proof. y comes from the min-length LS solution of Ty ≈ β1e1 and thus satisfies the normal equation T2y=Tβ1e1 and y ∈ range(T). Now x = Vy and Ax = AVy = VTy. Hence, A2x=AVTy=VT2y=VTβ1e1=Ab. Thus, x is an LS solution of (3). Since y ∈ range(T), y = Tz for some z, and so x = Vy = VTz = AVz ∈ range(A) is the min-length LS solution of (3).

3. PRECONDITIONING

Iterative methods can be accelerated if preconditioners are available and well-chosen. For MINRES-QLP, we want to choose a symmetric positive-definite matrix M to solve a nonsingular system (1) by implicitly solving an equivalent symmetric consistent system M12AM12=, where M12x=,=M12b, and cond(M12AM12)cond(A). This two-sided preconditioning preserves symmetry. Thus, we can derive preconditioned MINRES-QLP by applying MINRES-QLP to the equivalent problem and setting x=M12.

With preconditioned MINRES-QLP, we can solve a singular consistent system (2), but we will obtain a least-squares solution that is not necessarily the minimum-length solution (unless M = I). For inconsistent systems (3), preconditioning alters the least-squares norm to ‖ · ‖M−1, and the solution is of minimum length in the new norm space. We refer readers to Choi et al. [2011, Sect. 7] for a detailed discussion of various approaches to preserving the two-norm “minimum length.”

To derive MINRES-QLP, we define

zk=βkM12υk,qk=βkM12υk,so thatMqk=zk. (14)

Then, βk=βkυk=M12zk=zkM1=qkM=qkTzk, where the square root is well defined because M is positive definite, and the following expressions replace the quantities in (5) in the Lanczos iterations:

pk=Aqkσqk,αk=1βk2qkTpk,zk+1=1βkpkαkβkzkβkβk1zk1. (15)

We also need to solve the system Mqk = zk in (14) at each iteration.

In the MINRES phase, we define k=M12dk and update the solution of the original problem (1) by

k=(1βkqkδk(2)k1εkk2)/γk(2),xk=M12k=xk1+τkk.

In the MINRES-QLP phase, we define kM12Wk=(M12Vk)Pk and update the solution estimate of problem (1) by orthogonal steps:

k=(ck2/βk)qk+sk2k2(3),k2(4)=(sk2/βk)qk+ck2k2(3),k(2)=sk3k1(2)ck3k,k1(3)=ck3k1(2)+sk3k,xk2(2)=xk3(2)+μk2(3)k2(4),xk=xk2(2)+μk1(2)k1(3)+μkk(2).

Let k=M12(AσI)M12k=M12rk. Then, xk=M12k is an acceptable solution of (1) if the computed value of ϕk ≈ ‖k‖ = ‖rkM−1 is sufficiently small.

We can now present our pseudocode in Algorithm 1. The reflectors are implemented in Algorithm 2 SymOrtho(a, b) for real a and b, which is a stable form for computing r=a2+b20,c=ar, and s=br. The complexity is at most 6 flops and a square root. Algorithm 1 lists all steps of MINRES-QLP with preconditioning. For simplicity, k is written as wk for all relevant k. Also, the output x solves (A − σ I)xb, but other outputs are associated with the preconditioned system.

4. IMPLEMENTATION AND TESTING

A detailed description of the contents and structure of the Fortran 90 package implementing MINRES-QLP for real and complex data may be found in the user manual that accompanies the software (also available as Choi and Saunders [2012]).

Our design spares users from implementing reverse communication, in which the solver would return control to the calling program whenever Aprod or Msolve were to be invoked. (While reverse communication is widely used in scientific computing with FORTRAN 77, the resulting code usually appears formidable and unrecognizable from the original pseudocode; see Dongarra et al. [1995] and Oliveira and Stewart [2006] for two examples of CG and numerical integration coded in FORTRAN 77 and 90, respectively.) Our MINRES-QLP implementation achieves the purpose of reverse communication while preserving code readability and thus maintainability. The FORTRAN 90 module structure allows a user’s Ax products and Mx = y solves to be implemented outside MINRES-QLP in the same way that MATLAB’s function handles operate.

In our development of FORTRAN 90 MINRES-QLP, we have created a suite of 117 test cases including singular matrices representative of real-world applications [Foster 2009; Davis and Hu 2011]. The test program outputs results to MINRESQLP.txt. If users need to modify subroutine MINRESQLP, they can run these test cases and search for the word “ appear” in the output file to check whether all tests are reported to be successful. For more sophisticated unit testing frameworks employed in large-scale scientific software development, see O’Boyle et al. [2008]. Further details of the numerical examples are given in Choi and Saunders [2012].

Finally, note that the choice of parameter values can have a critical effect on the convergence of iterative solvers. While the default parameter values in MINRES-QLP work well in most tests, they may need to be fine-tuned by trial and error, and for some applications it may be worthwhile to implement full or partial reorthogonalization of the Lanczos vectors [Simon 1984].

ALGORITHM 1.

Pseudocode of preconditioned MINRES-QLP for solving (A − σ I)xb. In the right-justified comments, ÃM12(AσI)M12.

input: A, b, σ, M
1 z0 = 0, z1 = b, Solve Mq1 = z1, β1=bTq1,ϕ0=β1 [Initialize]
2 w0 = w−1 = 0, x−2 = x−1 = x0 = 0
3 c0, 1 = c0, 2 = c0, 3 = −1, s0, 1 = s0, 2 = s0, 3 = 0, τ0 = ω0 = χ−2 = χ−1 = χ0 = 0
4 κ0 = 1, 𝒜0 = δ1 = γ−1 = γ0 = η−1 = η0 = η1 = ϑ−1 = ϑ0 = ϑ1 = μ−1 = μ0 = 0
5 k = 0
6 while no stopping condition is satisfied do
7 graphic file with name nihms591419t1.jpg kk + 1
8 pk = Aqk − σqk, αk=1βk2qkTpk [Preconditioned Lanczos]
9
zk+1=1βkpkαkβkzkβkβk1zk1
10 Solve Mqk+1 = zk+1, βk+1=qk+1Tzk+1
11 if k = 1 then ρk = ‖ [αk βk+1] ‖ else ρk = ‖ [βk αk βk+1] ‖
12
δk(2)=ck1,1δk+sk1,1αk
[Previous left reflection…]
13 γk = sk−1, 1δkck−1, 1αk [on middle two entries of Tk¯ek…]
14 εk+1 = sk−1, 1βk+1 [produces first two entries in Tk+1¯ek+1]
15 δk+1 = −ck−1, 1βk+1
16
ck1,sk1,γk(2)SymOrtho(γk,βk+1)
[Current left reflection]
17
ck2,sk2,γk2(6)SymOrtho(γk2(5),εk)
[First right reflection]
18
δk(3)=sk2ϑk1ck2δk(2),γk(3)=ck2γk(2),ηk=sk2γk(2)
19
ϑk1(2)=ck2ϑk1+sk2δk(2)
20
ck3,sk3,γk1(5)Symortho(γk1(4),δk(3))
[Second right reflection…]
21
ϑk=sk3γk(3),γk(4)=ck3γk(3)
[to zero out δk(3)]
22 τk = ck1ϕk−1 [Last element of tk]
23 ϕk = sk1ϕk−1, ψk−1 = ϕk−1 ‖ [γk δk+1] ‖ [Updatek‖, ‖Ãr̄k−1‖]
24 if k = 1 then γmin = γ1 else γminmin{γmin,γk2(6),γk1(5),|γk(4)|}
25
𝒜k=max{𝒜k1,ρk,γk2(6),γk1(5),|γk(4)|}
[UpdateÃ‖]
26 ωk = ‖ [ωk−1 τk] ‖, κk ← 𝒜kmin [UpdateÃxk‖, cond(Ã)]
27
wk=(ck2/βk)qk+sk2wk2(3)
[Update wk−2, wk−1, wk]
28
wk2(4)=(sk2/βk)qk+ck2wk2(3)
29
ifk>2thenwk(2)=sk3wk1(2)ck3wk,wk1(3)=ck3wk1(2)+sk3wk
30
ifk>2thenμk2(3)=(τk2ηk2μk4(4)ϑk2μk3(3))/γk2(6)
[Update μk−2]
31
ifk>1thenμk1(2)=(τk1ηk1μk3(3)ϑk1(2)μk2(3))/γk1(5)
[Update μk−1]
32 if γk(4)0 then μk=(τkηkμk2(3)ϑkμk1(2))/γk(4) else μk = 0 [Compute μk]
33
xk2(2)=xk3(2)+μk2(3)wk2(3)
[Update xk−2]
34
xk=xk2(2)+μk1(2)wk1(3)+μkwk(2)
[Compute xk]
35
χk2(2)=[χk3(2)μk2(3)]
[Updatexk−2‖]
36
χk=[χk2(2)μk1(2)μk]
[Computexk‖]
37 x = xk, ϕ = ϕk, ψ = ϕk‖ [γk+1 δk+2] ‖, χ = χk, 𝒜 = 𝒜k, ω = ωk
output: x, ϕ, ψ, χ, 𝒜, κ, ω

ALGORITHM 2.

Algorithm SymOrtho.

input: a, b
1 if b = 0 then s = 0, r = |a|
2 if a = 0 then c = 1 else c = sign(a)
3 else if a = 0 then
4 graphic file with name nihms591419t2.jpg c = 0, s = sign(b), r = |b|
5 else if |b| ≥ |a| then
6 graphic file with name nihms591419t3.jpg τ = a/b, s=sign(b)/1+τ2, c = sτ, r = b/s
7 else if |a| > |b| then
8 graphic file with name nihms591419t4.jpg τ = b/a, c=sign(a)/1+τ2, s = cτ, r = a/c
output: c, s, r

ACKNOWLEDGMENTS

We thank Christopher Paige for his contribution to the theory of MINRES-QLP, including the simplified proof of Theorem 2.2. We also thank Tim Hopkins and David Saunders for testing and running our software on the NAG Fortran compiler and the Intel ifort compiler, resulting in more robust code. We are grateful to Zhaojun Bai and two anonymous reviewers for their patience and constructive comments. The first author also thanks Jed Brown, Ian Foster, Todd Munson, Gail Pieper, Stefan Wild, and Hong Zhang for their feedback, interest, and support during the development of this work. Finally, we express our gratitude to the SIAM SIAG/LA 2012 Linear Algebra Prize Committee for their favorable consideration of MINRES-QLP [Choi et al. 2011].

This work was supported in part by the Office of Advanced Scientific Computing Research, Office of Science, US Department of Energy contract DE-AC02-06CH11357; National Science Foundation grant CCR-0306662; Office of Naval Research grants N00014-02-1-0076 and N00014-08-1-0191; and US Army Research Laboratory through the Army High Performance Computing Research Center.

ACM acknowledges that this contribution was authored or coauthored by a contractor or affiliate of the U.S. Government. As such, the Government retains a nonexclusive, royalty-free right to publish or reproduce this article, or to allow others to do so, for Government purposes only.

Footnotes

Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies show this notice on the first page or initial screen of a display along with the full citation. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, to republish, to post on servers, to redistribute to lists, or to use any component of this work in other works requires prior specific permission and/or a fee. Permissions may be requested from Publications Dept., ACM, Inc., 2 Penn Plaza, Suite 701, New York, NY 10121-0701 USA, fax +1 (212) 869-0481, or permissions@acm.org.

1

A further input parameter σ (a real shift parameter) causes MINRES-QLP to treat “A” as if it were A−σ I. For example, “singular A” really means that A− σ I is singular.

Contributor Information

Sou-Cheng T. Choi, University of Chicago/Argonne National Laboratory

Michael A. Saunders, Stanford University

REFERENCES

  1. Calvetti Daniela, Lewis Bryan, Reichel Lothar. An L-curve for the MINRES method. In: Luk Franklin T., editor. Advanced Signal Processing Algorithms, Architectures, and Implementations X. Vol. 4116. SPIE; 2000. pp. 385–395. [Google Scholar]
  2. Choi Sou-Cheng Terrya. Ph.D. thesis. Stanford University, CA: ICME; 2006. Iterative methods for singular linear equations and least-squares problems. [Google Scholar]
  3. Choi Sou-Cheng T, Paige Christopher C, Saunders Michael A. MINRES-QLP: A Krylov subspace method for indefinite or singular symmetric systems. SIAM J. Sci. Comput. 2011;33(4):1810–1836. [Google Scholar]
  4. Choi Sou-Cheng T, Saunders Michael A. Tech. Rep. ANL/MCS-P3027-0812. Chicago, IL: Computation Institute, University of Chicago; 2012. Algorithm & documentation: MINRES-QLP for singular symmetric and Hermitian linear equations and least-squares problems. [Google Scholar]
  5. Davis Timothy A, Yifan Hu. The University of Florida sparse matrix collection. ACM Trans. Math. Softw. 2011;38(1):1:1–1:25. [Google Scholar]
  6. Dongarra Jack, Eijkhout Victor, Kalhan Ajay. Rep. UT-CS-95-291. University of Tennessee, TN; 1995. Reverse communication interface for linear algebra templates for iterative methods. [Google Scholar]
  7. Fong David C-L. Ph.D. thesis. Stanford, CA: ICME, Stanford University; 2011. Minimum-residual methods for sparse least-squares using Golub-Kahan bidiagonalization. [Google Scholar]
  8. Fong David C-L, Saunders Michael A. LSMR: An iterative algorithm for sparse least-squares problems. SIAM J. Sci. Comput. 2011;33:2950–2971. [Google Scholar]
  9. Fong David C-L, Saunders Michael A. CG versus MINRES: An empirical comparison. SQU J. Sci. 2012;17(1):44–62. [Google Scholar]
  10. Foster Leslie. 2009. San Jose State University singular matrix database. http://www.math.sjsu.edu/singular/matrices/. [Google Scholar]
  11. A new Krylov-Subspace method for symmetric indefinite linear systems. In: Freund Roland W, Nachtigal Noël M., editors; Ames WF, editor. Proceedings of the 14th IMACS World Congress on Computational and Applied Mathematics. IMACS; 1994. pp. 1253–1256. [Google Scholar]
  12. Golub Gene H, Van Loan Charles F. Matrix Computations. 3rd Ed. Baltimore, MD: Johns Hopkins University Press; 1996. [Google Scholar]
  13. Hansen Per Christian. Rank-Deficient and Discrete Ill-Posed Problems. SIAM, Philadelphia, PA: SIAM Monographs on Mathematical Modeling and Computation; 1998. [Google Scholar]
  14. Hestenes Magnus R, Stiefel Eduard. Methods of conjugate gradients for solving linear systems. J. Res. Nat. Bur. Standards. 1952;49:409–436. [Google Scholar]
  15. Lanczos Cornelius. An iteration method for the solution of the eigenvalue problem of linear differential and integral operators. J. Res. Nat. Bur. Standards. 1950;45:255–282. [Google Scholar]
  16. O’Boyle Noel M, Tenderholt Adam L, Langner Karol M. CCLIB: A library for package-independent computational chemistry algorithms. J. Comput. Chem. 2008;29(5):839–845. doi: 10.1002/jcc.20823. [DOI] [PubMed] [Google Scholar]
  17. Oliveira Suely, Stewart David. Writing Scientific Software: A Guide to Good Style. Cambridge, UK: Cambridge University Press; 2006. [Google Scholar]
  18. Paige Christopher C. Error analysis of the Lanczos algorithm for tridiagonalizing a symmetric matrix. J. Inst. Math. Appl. 1976;18(3):341–349. [Google Scholar]
  19. Paige Christopher C, Saunders Michael A. Solution of sparse indefinite systems of linear equations. SIAM J. Numer. Anal. 1975;12(4):617–629. [Google Scholar]
  20. Paige Christopher C, Saunders Michael A. LSQR: An algorithm for sparse linear equations and sparse least squares. ACM Trans. Math. Softw. 1982a;8(1):43–71. [Google Scholar]
  21. Paige Christopher C, Saunders Michael A. Algorithm 583; LSQR: Sparse linear equations and least-squares problems. ACM Trans. Math. Softw. 1982b;8(2):195–209. doi: 10.1145/2527267. [DOI] [PMC free article] [PubMed] [Google Scholar]
  22. Paige Christopher C, Strakoš Zdeněk. Residual and backward error bounds in minimum residual Krylov subspace methods. SIAM J. Sci. Comput. 2002;23(6):1899–1924. [Google Scholar]
  23. Saad Youcef, Schultz Martin H. GMRES: A generalized minimal residual algorithm for solving nonsymmetric linear systems. SIAM J. Sci. Statist. Comput. 1986;7(3):856–869. [Google Scholar]
  24. Simon Horst D. The Lanczos algorithm with partial reorthogonalization. Math. Comput. 1984;42(165):115–142. [Google Scholar]
  25. SOL. Systems Optimization Laboratory. Stanford University; www.stanford.edu/group/SOL. [Google Scholar]
  26. Stewart GW. The QLP approximation to the singular value decomposition. SIAM J. Sci. Comput. 1999;20(4):1336–1348. [Google Scholar]
  27. Trefethen Lloyd N, Bau David., III . Numerical Linear Algebra. Philadelphia, PA: SIAM; 1997. [Google Scholar]

RESOURCES