diff --git a/Grid/algorithms/iterative/KrylovSchur.h b/Grid/algorithms/iterative/KrylovSchur.h index 410c0930..5f8d0f4c 100644 --- a/Grid/algorithms/iterative/KrylovSchur.h +++ b/Grid/algorithms/iterative/KrylovSchur.h @@ -290,10 +290,11 @@ class KrylovSchur { RitzFilter ritzFilter; // how to sort evals public: + RealD *shift; // for Harmonic (shift and invert) KrylovSchur(LinearOperatorBase &_Linop, GridBase *_Grid, RealD _Tolerance, RitzFilter filter = EvalReSmall) : Linop(_Linop), Grid(_Grid), Tolerance(_Tolerance), ritzFilter(filter), u(_Grid), MaxIter(-1), Nm(-1), Nk(-1), Nstop (-1), - evals (0), ritzEstimates (), evecs (), ssq (0.0), rtol (0.0), beta_k (0.0), approxLambdaMax (0.0) + evals (0), ritzEstimates (), evecs (), ssq (0.0), rtol (0.0), beta_k (0.0), approxLambdaMax (0.0),shift(NULL) { u = Zero(); }; @@ -316,6 +317,10 @@ class KrylovSchur { * - Truncate the Krylov-Schur expansion. */ void operator()(const Field& v0, int _maxIter, int _Nm, int _Nk, int _Nstop, bool doubleOrthog = true) { + RealD shift_=1.; + shift = &shift_; + if (shift) + std::cout << GridLogMessage << "Shift " << approxLambdaMax << std::endl; MaxIter = _maxIter; Nm = _Nm; Nk = _Nk; Nstop = _Nstop; @@ -347,7 +352,16 @@ class KrylovSchur { // Perform a Schur decomposition on Rayleigh // ComplexSchurDecomposition schur (Rayleigh, false); + + Eigen::MatrixXcd temp = Rayleigh; + for (int m=0;m