From 43ea83e5e13cef00ba5a452ca247fbc96aa52085 Mon Sep 17 00:00:00 2001 From: Chulwoo Jung Date: Fri, 5 Dec 2025 23:56:40 +0000 Subject: [PATCH] Checking in to move back to genoa --- Grid/algorithms/iterative/KrylovSchur.h | 47 +++++++++++++++++++------ 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/Grid/algorithms/iterative/KrylovSchur.h b/Grid/algorithms/iterative/KrylovSchur.h index d99d96f4..61492174 100644 --- a/Grid/algorithms/iterative/KrylovSchur.h +++ b/Grid/algorithms/iterative/KrylovSchur.h @@ -361,17 +361,39 @@ class KrylovSchur { temp2=RayleighS.adjoint(); //(B-tI)^-1* Eigen::VectorXcd g = temp2*b; //g = (B-tI)^-1* * b + std::cout << GridLogMessage << " b "<< b < b = Q*b + + Eigen::MatrixXcd Q_s = schurS.getMatrixQ(); + Eigen::MatrixXcd Qt_s = Q_s.adjoint(); // TODO should Q be real? + Eigen::MatrixXcd S_s = schurS.getMatrixS(); + std::cout << GridLogMessage << " Q_s*Qt_s= " << Q_s*Qt_s < b = Q*b @@ -427,18 +450,19 @@ if(1){ // for (int i = start; i < Nm; i++) { // basis2.emplace_back(Grid); // } - constructUR(basis2, basis, Qt, Nm); - basis = basis2; +// constructUR(basis2, basis, Qt, Nm); std::vector basis_s; constructUR(basis_s, basis, Qt_s, Nm); // basis = basis2_s; +// basis = basis2; + if(1){ Field w(Grid); ComplexD coeff; - for (int j = 0; j < Nk; j++) { + for (int j = 0; j < Nm; j++) { Linop.Op(basis[j], w); for (int k = 0; k < Nm; k++) { coeff = innerProduct(basis[k], w); // coeff = h_{ij}. Note that since {vi} is ONB it's OK to subtract it off after. @@ -454,12 +478,13 @@ if(1){ if(shift){ Field w(Grid); - ComplexD coeff; - for (int j = 0; j < Nk; j++) { + ComplexD coeff,coeff2; + for (int j = 0; j < Nm; j++) { Linop.Op(basis_s[j], w); for (int k = 0; k < Nm; k++) { + coeff2 = innerProduct(basis_s[k], basis_s[j]); coeff = innerProduct(basis_s[k], w); // coeff = h_{ij}. Note that since {vi} is ONB it's OK to subtract it off after. - std::cout << GridLogMessage << " Btilde(Shat) "< = " << coeff2 << std::endl; } coeff = innerProduct(basis_s[j], utilde); // coeff = h_{ij}. Note that since {vi} is ONB it's OK to subtract it off after. std::cout << GridLogMessage << " utilde "<