White box / Algorithms and implementation / Matrix and spectral solvers

CG and MINRES

Algorithm / execution · assumptions, essential equations, full derivation, algorithm, code and verification references.

Browse another sheet Algorithms and implementation / Matrix and spectral solvers
Algorithms and implementationMatrix and spectral solversSheet 2 / 3
Algorithm / executionPROPERTY-GATED ITERATIVE ROUTES

Conjugate gradients require a real symmetric positive-definite operator; MINRES requires a real symmetric system.

01 Model and scope

Conjugate gradients exploit a symmetric positive-definite operator; MINRES handles real symmetric indefinite systems. The matrix and preconditioner properties are preconditions for these algorithms, not details that can be inferred from convergence alone.

Route assumptions and calculation checks

  1. The policy assesses matrix symmetry, diagonal, and execution settings before solve.
  2. There is no hidden automatic fallback to a direct solve after iterative failure.
  3. Iteration count, stopping reason, and final residual belong with the result.

02 Essential equations and symbols

CG:  A=ATandxTAx>0forx≠0\text{CG:}\; A=A^T and x^TAx>0 for x\ne{}0MINRES:  A=AT;compatiblepreconditionersareexplicitlyrestricted\text{MINRES:}\; A=A^T; compatible preconditioners are explicitly restrictedstoponlyaftertherequestedresidualcriterionismetstop only after the requested residual criterion is met

Definitions and conventions

A=ATA = A^T
Real symmetry requirement.
xTAx>0x^TAx > 0
Positive-definiteness required by CG.
rr
Iterative residual.
stop criterion
Requested residual tolerance and termination reason.
CG and MINRES · method mapEligibility is determined by matrix symmetry and definiteness before iterations begin; termination is judged by the requested residual.
4 detailed steps

03 Step by step derivation

Follow the assumptions, equations and discrete operations in order. The full explanation stays visible.

1 · Classify the operator before selecting Krylov

Conjugate gradients rely on a real symmetric positive-definite operator. MINRES applies to real symmetric systems that may be indefinite, provided its preconditioner meets the implementation's compatibility restrictions. These are mathematical preconditions, not solver preferences.

A=AT,xTAx>0  ∀x≠0for CG\mathbf A=\mathbf A^T,\qquad \mathbf x^T\mathbf A\mathbf x>0\;\forall\mathbf x\ne\mathbf0\quad\text{for CG}A=ATfor MINRES\mathbf A=\mathbf A^T\quad\text{for MINRES}

2 · Build a Krylov approximation

Each iteration expands a subspace using the current residual and matrix action. CG minimizes the energy error for the SPD case; MINRES minimizes a residual norm over a symmetric Krylov space. Preconditioning changes conditioning and must preserve the required symmetry/definiteness contract.

Kk(A,r0)=span⁡{r0,Ar0,…,Ak−1r0}\mathcal K_k(\mathbf A,\mathbf r_0)=\operatorname{span}\{\mathbf r_0,\mathbf A\mathbf r_0,\ldots,\mathbf A^{k-1}\mathbf r_0\}

3 · Stop only on the requested criterion

Track the residual, iteration count, termination reason, and preconditioner. Reaching a maximum iteration count or detecting breakdown is not convergence. The policy does not hide an automatic direct-solver fallback after iterative failure.

∥b−Axk∥2max⁡(∥b∥2,s0)≤τrequested\frac{\|\mathbf b-\mathbf A\mathbf x_k\|_2}{\max(\|\mathbf b\|_2,s_0)}\le\tau_{requested}

4 · Preserve matrix-class evidence

Check symmetry and the diagonal/preconditioner assumptions on the assembled operator used by the solve. If a nonlinear tangent, contact block, or complex harmonic operator changes the matrix class, the original CG/MINRES eligibility argument no longer transfers.

04 Algorithm and implementation

Read the linked versioned source for the actual assembly and solver behavior. The derivation above explains the mathematics and is not a verbatim source excerpt.

05 Verification and limitations

PROPERTY-GATED ITERATIVE ROUTES

The formulation and its explanatory checks do not by themselves establish a qualified application domain. Consult the capability matrix and the applicable recorded case.

06 Sources and related sheets

Continue the reasoning

Back to sheet contents ↑