From 5754c965d52e9cce6fc78638ebd40ce1a7af482d Mon Sep 17 00:00:00 2001 From: Chulwoo Jung Date: Fri, 1 May 2026 11:35:45 -0400 Subject: [PATCH] More debugging outputs --- .../algorithms/iterative/Gamma5BlockLanczos.h | 44 ++++++++++++++++++- examples/LanParams.xml | 8 ++-- 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/Grid/algorithms/iterative/Gamma5BlockLanczos.h b/Grid/algorithms/iterative/Gamma5BlockLanczos.h index 501f7df7f..7a0eb60e0 100644 --- a/Grid/algorithms/iterative/Gamma5BlockLanczos.h +++ b/Grid/algorithms/iterative/Gamma5BlockLanczos.h @@ -112,6 +112,9 @@ public: assert(nrm > 1e-14); v *= (1.0 / nrm); applyGamma5(v, g5v); +// nrm = std::sqrt(norm2(g5v)); +// assert(nrm > 1e-14); +// g5v *= (1.0 / nrm); CMat2 G1 = gramMatrix(v, g5v); ComplexD detG1 = G1(0,0)*G1(1,1) - G1(0,1)*G1(1,0); @@ -400,7 +403,9 @@ public: H_hess.block(0, 0, Nk, Nk) = H_L2; // Trim basis to Nk (Q_{m+1} replaced by F_vec below) - basis.resize(Nk); + // Use erase instead of resize: resize instantiates _M_default_append + // which requires Lattice's default ctor (nonexistent). + basis.erase(basis.begin() + Nk, basis.end()); first_iter = false; } else { @@ -439,7 +444,7 @@ public: H_hess.block(0, 0, Nk, Nk) = schur.getMatrixS().block(0, 0, Nk, Nk); // Trim basis back to Nk (extension will re-grow it) - basis.resize(Nk); + basis.erase(basis.begin() + Nk, basis.end()); } // ── L2-Arnoldi extension: add Np = Nmax-Nk vectors from F_vec ──────── @@ -1164,6 +1169,11 @@ private: CMat2 Bk = B_blocks[step - 1]; Ck = invert2x2(Gkm1) * Bk.adjoint() * Gk; } + + ComplexD detG1 = Ck(0,0)*Ck(1,1) - Ck(0,1)*Ck(1,0); + std::cout << GridLogMessage + << "Gamma5BlockLanczos: C "<