Skip to content
QFT.org

Search QFT.org

Enter a word or phrase.

    You can also browse the main navigation and chapter contents.

    Dirac Solvers and Preconditioning

    A quark propagator is a solution of a linear system on each gauge field. A pseudofermion force requires another such solution, often many times during one trajectory. The residual printed by a solver is therefore only an intermediate result: the useful question is how accurately it determines a correlator, a force, or an acceptance probability.

    This article solves the Wilson operator on the previous chapter's smooth two-dimensional flux field. Direct factorization supplies a reference for ordinary GMRES, conjugate gradients on the normal equations, even-odd reduction and a small exact-mode deflation experiment. The examples use dense matrices only to establish references; a production Dirac application uses the local stencil without storing a dense inverse.

    The matrix and the right-hand side

    Set a=r=1a=r=1, use a 16×1616\times16 periodic lattice, and take γx=σ1\gamma_x=\sigma_1, γt=σ2\gamma_t=\sigma_2. There are 512512 complex spinor components, ordered by site (t,x)(t,x) and then spin. The Wilson matrix has a diagonal (m+2)1(m+2)1 and nearest-neighbor hopping terms. A forward link Vμ(x)V_\mu(x) transports from xx to x+μ^x+\hat\mu; hence the row at xx multiplies the forward neighbor by Vμ(x)†V_\mu(x)^\dagger. This is the same convention and implementation used in the fermion chapter.

    The free control has all links equal to one. The nontrivial field has

    Vx(t,x)=e−ibt,b=2π162,V_x(t,x)=e^{-ibt},\qquad b=\frac{2\pi}{16^2},

    with Vt=1V_t=1 except on the temporal seam, where Vt(15,x)=eib16xV_t(15,x)=e^{ib16x}. Every positively oriented plaquette is eibe^{ib} and the principal plaquette-angle sum divided by 2π2\pi is one. The program checks those statements using the actual links. This is a fixed background, not a sampled gauge ensemble.

    For a source spin s=1,2s=1,2, solve

    Dxs=bs,bs(t,x,α)=δt0δx0δαs.D x_s=b_s,\qquad b_s(t,x,\alpha)=\delta_{t0}\delta_{x0}\delta_{\alpha s}.

    The two columns form XX. The positive connected contraction

    C(t)=∑x,α,s∣X(t,x,α;s)∣2C(t)=\sum_{x,\alpha,s}|X(t,x,\alpha;s)|^2

    is the nonsinglet pseudoscalar contraction obtained using Γ\Gamma-Hermiticity, where Γ=σ3\Gamma=\sigma_3. The operators are iuˉΓdi\bar u\Gamma d and idˉΓui\bar d\Gamma u for degenerate valence flavors: their two factors of ii cancel the closed-fermion minus sign, as in quark contractions. No disconnected term or ensemble average is included here. We examine C(4)C(4) so that an error at a separated time slice, rather than just at the source, is tested.

    Choose a solver for the operator it actually sees

    The Wilson matrix obeys D†=ΓDΓD^\dagger=\Gamma D\Gamma but is generally not Hermitian positive definite. Ordinary conjugate gradients should not be applied directly to DD. Multiplication by Γ\Gamma makes it Hermitian, but not necessarily positive; that still does not justify ordinary CG.

    GMRES searches a Krylov space generated by r0,Dr0,D2r0,…r_0,Dr_0,D^2r_0,\ldots and chooses the iterate with smallest residual norm in that space. Arnoldi orthogonalization stores the basis. Our GMRES(40) restarts after at most forty basis vectors, bounding storage but discarding information that could help later convergence. Restarting may cause stagnation for other matrices.

    Normal-equation CG instead solves

    Qx=D†b,Q=D†D.Qx=D^\dagger b,\qquad Q=D^\dagger D.

    For invertible DD, QQ is Hermitian positive definite. With r0=D†b−Qx0r_0=D^\dagger b-Qx_0 and p0=r0p_0=r_0, its elementary iteration is

    αk=rk†rkpk†Qpk,xk+1=xk+αkpk,rk+1=rk−αkQpk,βk=rk+1†rk+1rk†rk,pk+1=rk+1+βkpk.\begin{aligned} \alpha_k&=\frac{r_k^\dagger r_k}{p_k^\dagger Qp_k},& x_{k+1}&=x_k+\alpha_k p_k,\\ r_{k+1}&=r_k-\alpha_kQp_k,& \beta_k&=\frac{r_{k+1}^\dagger r_{k+1}}{r_k^\dagger r_k},\\ p_{k+1}&=r_{k+1}+\beta_kp_k. \end{aligned}

    Apply QvQv as D†(Dv)D^\dagger(Dv). Forming QQ explicitly would enlarge the stencil and can hide its cost. In the two-norm,

    κ2(Q)=κ2(D)2.\kappa_2(Q)=\kappa_2(D)^2.

    The worst-case CG energy-norm bound is

    ∥ek∥Q≤2(κ2(Q)−1κ2(Q)+1)k∥e0∥Q.\|e_k\|_Q\le 2\left(\frac{\sqrt{\kappa_2(Q)}-1}{\sqrt{\kappa_2(Q)}+1}\right)^k \|e_0\|_Q.

    It explains a possible difficulty from small singular values, not a prediction of each iteration count. Spectral clustering and the source's projection onto modes also matter. The relevant algorithms and qualifications are in Barrett et al., Templates, §§2.3.1, 2.3.3–2.3.4, printed pp.12–18.

    For example, in the free periodic control, the zero-momentum mode has singular value mm and the corner of the Brillouin zone has m+4m+4. Reducing mm from 0.30.3 to 0.030.03 changes κ2(D)\kappa_2(D) from 14.3314.33 to 134.33134.33. On the unit-flux background the measured values are 13.7513.75 and 95.2795.27. These are finite-cutoff matrices at positive bare mass, not a tuning of the interacting theory to its critical mass.

    Even-odd reduction removes half the unknowns

    Nearest-neighbor hopping on an even periodic lattice changes the parity of t+xt+x. Reorder sites into even and odd sets. For this unimproved Wilson action,

    D=(c01BCc01),c0=m+2.D=\begin{pmatrix}c_0 1&B\\C&c_0 1\end{pmatrix}, \qquad c_0=m+2.

    The second block equation gives xo=(bo−Cxe)/c0x_o=(b_o-Cx_e)/c_0. Substitute it into the first:

    Sexe=be−Bboc0,Se=c01−BCc0.S_e x_e=b_e-\frac{B b_o}{c_0}, \qquad S_e=c_0 1-\frac{BC}{c_0}.

    One application of SeS_e uses two hopping operations on half-sized vectors. After solving the reduced system, reconstruct xox_o and check the residual of the full equation. We use GMRES on SeS_e, since this Schur complement is not generally Hermitian positive definite either. The determinant identity

    det⁡D=c0nodet⁡Se\det D=c_0^{n_o}\det S_e

    provides an independent finite-matrix check, where non_o counts odd-site spin components. The retained logarithmic determinant discrepancies are below 6.0×10−136.0\times10^{-13}.

    The scalar diagonal is a property of this action. Clover improvement replaces it by local spin-color blocks, which must be inverted locally in the Schur complement. An odd periodic extent has a wraparound bond connecting equal parities; the displayed two-block hopping decomposition then fails. A change of boundary conditions is not a harmless solver optimization.

    Deflate the modes that are difficult to invert

    Suppose Qvi=λiviQv_i=\lambda_i v_i with orthonormal eigenvectors and positive eigenvalues. For a right-hand side g=D†bg=D^\dagger b,

    Q−1g=∑i=1kvivi†gλi+Q−1(1−Pk)g,Pk=∑i=1kvivi†.Q^{-1}g =\sum_{i=1}^{k}v_i\frac{v_i^\dagger g}{\lambda_i} +Q^{-1}(1-P_k)g, \qquad P_k=\sum_{i=1}^{k}v_iv_i^\dagger.

    Treating the first term exactly removes the selected small eigenvalues from the remaining problem. In the example we compute sixteen exact low modes using dense diagonalization, use their contribution as the initial iterate, and run CG on the remaining residual. In exact arithmetic the complement is invariant. We still check the full residual, since roundoff need not respect that separation perfectly.

    For the unit-flux field at m=0.03m=0.03, the full QQ condition number is about 9.08×1039.08\times10^3; after removing sixteen modes, the remaining spectral ratio is 38.6038.60. This demonstrates the mechanism. Computing a complete dense eigensystem would overwhelm any benefit in a large calculation, so its setup cost cannot be omitted from a speed claim.

    Practical deflation need not know exact eigenvectors. To see the algebra, take a full-rank trial basis ZZ and an invertible coarse matrix Ac=Z†DZA_c=Z^\dagger DZ. Define

    PL=1−DZAc−1Z†,PR=1−ZAc−1Z†D.P_L=1-DZA_c^{-1}Z^\dagger, \qquad P_R=1-ZA_c^{-1}Z^\dagger D.

    They satisfy PLD=DPRP_LD=DP_R. Solve PLDχ=PLbP_LD\chi=P_Lb, project χ\chi with PRP_R, and add ZAc−1Z†bZA_c^{-1}Z^\dagger b. The result solves the original equation. The coarse solve and the remaining iteration must both be accurate enough; merely subtracting approximate low modes is not the same construction.

    Local low-mode coherence makes block-supported trial spaces useful and connects deflation with multigrid: relax error components poorly represented on a coarse space, then correct the components it represents. Its effectiveness and setup cost are measured properties of a chosen action and ensemble. Lüscher, PDF §3, pp.5–7 gives the projector construction, while §§4–6 develop block subspaces and a QCD solver. Our exact-mode toy does not reproduce that large-volume performance result.

    Translate a true residual into an observable error

    Let x~\widetilde x be an approximate solution, recompute r=b−Dx~r=b-D\widetilde x, and define e=x−x~e=x-\widetilde x. Then

    e=D−1r,∥e∥2≤∥r∥2σmin⁡(D),∥e∥2∥x∥2≤κ2(D)∥r∥2∥b∥2.e=D^{-1}r,\qquad \|e\|_2\le\frac{\|r\|_2}{\sigma_{\min}(D)}, \qquad \frac{\|e\|_2}{\|x\|_2} \le\kappa_2(D)\frac{\|r\|_2}{\|b\|_2}.

    A recursively updated residual can drift from b−Dx~b-D\widetilde x in finite precision. A preconditioned residual can also use a different norm. Neither should silently replace this final check. In particular, the normal-equation residual D†b−Qx~=D†rD^\dagger b-Q\widetilde x=D^\dagger r can suppress a component associated with a small singular value. Templates, §4.2, printed pp.51–56 treats residual stopping criteria and finite-precision qualifications.

    For the two-source matrix, use the Frobenius norm and let E=X−X~E=X-\widetilde X. If R=Bsrc−DX~R=B_{\rm src}-D\widetilde X, then ∥E∥F≤∥R∥F/σmin⁡(D)≡δ\|E\|_F\le\|R\|_F/\sigma_{\min}(D)\equiv\delta. Restricting to time slice tt cannot increase this norm. Expanding the squared contraction gives the useful absolute bound

    ∣C(t)−C~(t)∣≤2C~(t) δ+δ2.|C(t)-\widetilde C(t)| \le2\sqrt{\widetilde C(t)}\,\delta+\delta^2.

    Relative errors can be much larger when the desired correlator is small. This is why the stopping tolerance should be tightened until changes in the measured observable are negligible compared with its intended statistical error, not chosen solely from a familiar number of decimal places.

    Direct and iterative results on the same field

    dirac_solvers.py requests ∥bs−Dx~s∥2≤10−9\|b_s-D\widetilde x_s\|_2\le10^{-9} for each unit source. Normal CG explicitly tests this original-system condition at every iteration, rather than equating its recursive normal residual with it. All methods then recompute the final residual. For unit flux and m=0.03m=0.03, direct factorization gives C(4)=0.237030490572C(4)=0.237030490572:

    MethodIterations for source spins 1, 2Largest true Dirac residualRelative error in C(4)C(4)
    GMRES(40)168, 1569.93×10−109.93\times10^{-10}1.16×10−81.16\times10^{-8}
    Normal CG80, 799.08×10−109.08\times10^{-10}4.56×10−134.56\times10^{-13}
    Even-odd GMRES(40)39, 397.80×10−107.80\times10^{-10}4.96×10−114.96\times10^{-11}
    Sixteen-mode normal CG52, 547.56×10−107.56\times10^{-10}4.19×10−114.19\times10^{-11}

    All measured correlator errors satisfy the bound above. A CG iteration contains both DD and D†D^\dagger; a Schur iteration contains two half-volume hopping operations. GMRES also pays for orthogonalization and restarts, and deflation pays for its basis. Thus these iteration counts do not rank wall-clock costs. The selected output separates CG iteration products from its in-solver diagnostic products; that diagnostic counter excludes the later common per-source and combined final residual checks. It includes all four combinations of free/unit-flux fields and m=0.3,0.03m=0.3,0.03.

    On the same low-mass flux field, loosening the GMRES stopping threshold to 10−310^{-3} gives a 1.20%1.20\% error in C(4)C(4). Thresholds 10−610^{-6} and 10−910^{-9} reduce that error to 3.94×10−63.94\times10^{-6} and 1.16×10−81.16\times10^{-8}. The residual-to-correlator relationship is measured here, not assumed to be equality. These are deterministic solver errors; they do not shrink by averaging more gauge configurations.

    Force accuracy and reversibility test different things

    For the pseudofermion action, solve QX=ϕQX=\phi and form F=X†Q′XF=X^\dagger Q'X. For an approximation X~\widetilde X, recompute rQ=ϕ−QX~r_Q=\phi-Q\widetilde X. If λmin⁡(Q)>0\lambda_{\min}(Q)>0, then

    ∥X−X~∥2≤∥rQ∥2λmin⁡(Q)≡δX,\|X-\widetilde X\|_2\le \frac{\|r_Q\|_2}{\lambda_{\min}(Q)}\equiv\delta_X,

    and expanding the quadratic force gives

    ∣F−F~∣≤∥Q′∥2(2∥X~∥2δX+δX2).|F-\widetilde F| \le\|Q'\|_2\bigl(2\|\widetilde X\|_2\delta_X+\delta_X^2\bigr).

    This controls the force in a particular gauge direction. A many-link trajectory requires the corresponding collection of derivatives and a check of accumulated integration error.

    The retained test returns to the open one-plaquette model, at θ=0.73\theta=0.73, with a fixed seeded pseudofermion, initial momentum 0.410.41, and ten steps of size 0.10.1. Every force solve starts from zero; the target action used for comparison is solved directly.

    Relative QQ stopping thresholdCG iterations at the test pointAbsolute force errorTrajectory endpoint error against direct solves
    10−110^{-1}39.57×10−39.57\times10^{-3}9.12×10−39.12\times10^{-3}
    10−210^{-2}51.23×10−31.23\times10^{-3}1.43×10−31.43\times10^{-3}
    10−310^{-3}71.63×10−51.63\times10^{-5}3.30×10−53.30\times10^{-5}
    10−610^{-6}88.33×10−178.33\times10^{-17}6.94×10−186.94\times10^{-18}

    The force bounds hold in every row. Nevertheless, every momentum-flipped trajectory returns on a second application within 1.2×10−161.2\times10^{-16}. This is not a contradiction: a kick using any deterministic function of the current position is invertible by the opposite kick and preserves volume. A symmetric composition remains reversible even if that function is an inaccurate force. A successful reversal test alone therefore cannot certify force accuracy.

    In larger systems, finite-precision amplification and solver history can spoil reversibility. A chronological initial guess can depend on data that are not retraced by the reversed trajectory; variable iteration counts near a threshold can amplify roundoff differences. Kennedy, PDF §2.16, pp.21–22 discusses those issues. Test returned gauge fields, momenta and target energy, as well as true residuals and force derivatives. Tightening only the molecular-dynamics solver cannot correct an inaccurately evaluated acceptance action, and high acceptance alone does not validate a propagator measurement.

    Summary

    Choose the Krylov method for the actual matrix: DD is generally non-Hermitian, D†DD^\dagger D is positive when DD is invertible, and a Wilson Schur complement need not be positive. Even-odd reduction and deflation reorganize the solve. Recomputed residuals, observable error bounds and tolerance refinement establish what the resulting propagator or force means; reversibility is an additional test with a different purpose.

    Exercises

    A small residual can hide the important component

    Take D=diag⁡(ϵ,1)D=\operatorname{diag}(\epsilon,1), b=(ϵ,1)Tb=(\epsilon,1)^T, with 0<ϵ≪10<\epsilon\ll1, and approximate the solution by x~=(0,1)T\widetilde x=(0,1)^T. Compute the relative original and normal residuals, the relative solution error, and the error in the observable ∣x1∣2|x_1|^2.

    Solution

    The exact solution is x=(1,1)Tx=(1,1)^T. The original residual is (ϵ,0)T(\epsilon,0)^T, so its relative norm is ϵ/1+ϵ2\epsilon/\sqrt{1+\epsilon^2}. The normal right-hand side is D†b=(ϵ2,1)TD^\dagger b=(\epsilon^2,1)^T, and its residual is (ϵ2,0)T(\epsilon^2,0)^T, with relative norm ϵ2/1+ϵ4\epsilon^2/\sqrt{1+\epsilon^4}. Both can look small, especially the second.

    Yet ∥x−x~∥/∥x∥=1/2\|x-\widetilde x\|/\|x\|=1/\sqrt2, and the observable is predicted as zero instead of one. The absolute residual bound is saturated: ∥r∥/σmin⁡(D)=ϵ/ϵ=1\|r\|/\sigma_{\min}(D)=\epsilon/\epsilon=1. Small residuals certify small solution errors only when the inverse operator is also controlled.

    Verify an approximate coarse space without eigenvectors

    Let Ac=Z†DZA_c=Z^\dagger DZ be invertible and use the projectors defined above. Show that PL2=PLP_L^2=P_L, PR2=PRP_R^2=P_R, and PLD=DPRP_LD=DP_R. If PLDχ=PLbP_LD\chi=P_Lb, verify that x=PRχ+ZAc−1Z†bx=P_R\chi+ZA_c^{-1}Z^\dagger b solves Dx=bDx=b.

    Solution

    Put K=ZAc−1Z†K=ZA_c^{-1}Z^\dagger. Then KDK=KKDK=K follows from Z†DZ=AcZ^\dagger DZ=A_c. Therefore (1−DK)2=1−DK(1-DK)^2=1-DK and (1−KD)2=1−KD(1-KD)^2=1-KD, proving the two projector identities. Direct multiplication gives PLD=D−DKD=DPRP_LD=D-DKD=DP_R.

    For the reconstructed solution,

    Dx=DPRχ+DKb=PLDχ+(1−PL)b=b.Dx=DP_R\chi+DKb =P_LD\chi+(1-P_L)b =b.

    No eigenvector assumption appeared. An inaccurate coarse solve or an insufficiently converged projected system leaves a residual, which must be checked in the full equation. The algebra establishes equivalence, not that an arbitrary trial space accelerates convergence.

    References

    • R. Barrett et al., Templates for the Solution of Linear Systems: Building Blocks for Iterative Methods, second edition, Netlib electronic text, §§2.3.1, 2.3.3–2.3.4 and 4.2 for CG, normal equations, GMRES and stopping criteria.
    • M. Lüscher, “Local coherence and deflation of the low quark modes in lattice QCD,” Journal of High Energy Physics 07 (2007) 081, arXiv:0706.2298, §3 for inexact deflation and §§4–6 for local subspaces and their application.
    • A. D. Kennedy, “Algorithms for Dynamical Fermions,” arXiv:hep-lat/0607038, §§2.15–2.16 for pseudofermion solves, force evaluation and reversibility.

    Reproducible calculation: examples/lattice-hamiltonian/lattice-monte-carlo/dirac_solvers.py and solver-results.json. The program imports the unchanged shared Wilson kernel and the companion pseudofermion force functions. It retains source-by-source residuals, direct-reference errors, correlator bounds, Schur determinant checks, fixed seeds and numerical-library versions.

    Scrollable formula. Use Left and Right arrow keys to reveal hidden content.

    Scrollable table. Use Left and Right arrow keys to reveal hidden columns.

    Scrollable figure. Use Left and Right arrow keys to reveal hidden content.