mirror of
https://github.com/paboyle/Grid.git
synced 2026-03-23 12:36:09 +00:00
bug in wilson eigenvectors: ritz estimates not equalling deviation from being an evec
This commit is contained in:
@@ -105,8 +105,9 @@ void writeEigensystem(KrylovSchur<Field> KS, std::string outDir) {
|
||||
fEval.close();
|
||||
|
||||
// Write evecs
|
||||
int Nevecs = Nk; // don't write all of them
|
||||
std::vector<Field> evecs = KS.getEvecs();
|
||||
for (int i = 0; i < Nk; i++) {
|
||||
for (int i = 0; i < Nevecs; i++) {
|
||||
std::string fName = outDir + "/evec" + std::to_string(i);
|
||||
writeFile(evecs[i], fName); // using method from Grid/HMC/ComputeWilsonFlow.cc
|
||||
}
|
||||
@@ -269,13 +270,16 @@ int main (int argc, char ** argv)
|
||||
std::string file = argv[5];
|
||||
std::string outDir = argv[6];
|
||||
|
||||
RitzFilter RF;
|
||||
if (argc == 8) {
|
||||
std::string rf = argv[7];
|
||||
RF = selectRitzFilter(rf);
|
||||
} else {
|
||||
RF = EvalReSmall;
|
||||
}
|
||||
// RitzFilter RF;
|
||||
// if (argc == 8) {
|
||||
// std::string rf = argv[7];
|
||||
// RF = selectRitzFilter(rf);
|
||||
// } else {
|
||||
// RF = EvalReSmall;
|
||||
// }
|
||||
// RitzFilter RF;
|
||||
std::string rf = argv[7];
|
||||
RitzFilter RF = selectRitzFilter(rf);
|
||||
std::cout << "Sorting eigenvalues using " << rfToString(RF) << std::endl;
|
||||
|
||||
const int Ls=16;
|
||||
@@ -288,8 +292,10 @@ int main (int argc, char ** argv)
|
||||
GridDefaultSimd(Nd,vComplex::Nsimd()),
|
||||
GridDefaultMpi());
|
||||
GridRedBlackCartesian * UrbGrid = SpaceTimeGrid::makeFourDimRedBlackGrid(UGrid);
|
||||
GridCartesian * FGrid = SpaceTimeGrid::makeFiveDimGrid(Ls,UGrid);
|
||||
GridRedBlackCartesian * FrbGrid = SpaceTimeGrid::makeFiveDimRedBlackGrid(Ls,UGrid);
|
||||
// GridCartesian * FGrid = SpaceTimeGrid::makeFiveDimGrid(Ls,UGrid);
|
||||
// GridRedBlackCartesian * FrbGrid = SpaceTimeGrid::makeFiveDimRedBlackGrid(Ls,UGrid);
|
||||
GridCartesian * FGrid = UGrid;
|
||||
GridRedBlackCartesian * FrbGrid = UrbGrid;
|
||||
|
||||
std::vector<int> seeds4({1,2,3,4});
|
||||
GridParallelRNG RNG4(UGrid);
|
||||
@@ -303,21 +309,30 @@ int main (int argc, char ** argv)
|
||||
|
||||
std::cout << GridLogMessage << "Loaded configuration" << std::endl;
|
||||
|
||||
RealD mass = 0.01;
|
||||
// RealD mass = 0.01;
|
||||
RealD M5 = 1.8;
|
||||
|
||||
// Wilson mass
|
||||
RealD mass = -1.6;
|
||||
|
||||
std::cout << GridLogMessage << "masses specified" << std::endl;
|
||||
|
||||
// Define domain wall D. This is giving a floating point exception?
|
||||
DomainWallFermionD Ddwf(Umu, *FGrid, *FrbGrid, *UGrid, *UrbGrid, mass, M5);
|
||||
NonHermitianLinearOperator<DomainWallFermionD, LatticeFermionD> DLinOp (Ddwf);
|
||||
std::vector<Complex> boundary = {1,1,1,-1};
|
||||
WilsonFermionD::ImplParams Params(boundary);
|
||||
|
||||
std::cout << GridLogMessage << "DWF operator defined" << std::endl;
|
||||
// DomainWallFermionD Ddwf(Umu, *FGrid, *FrbGrid, *UGrid, *UrbGrid, mass, M5);
|
||||
// NonHermitianLinearOperator<DomainWallFermionD, LatticeFermionD> DLinOp (Ddwf);
|
||||
|
||||
// WilsonFermionD Dwilson(Umu, *FGrid, *FrbGrid, mass);
|
||||
WilsonFermionD Dwilson(Umu, *UGrid, *UrbGrid, mass, Params);
|
||||
NonHermitianLinearOperator<WilsonFermionD, LatticeFermionD> DLinOp (Dwilson);
|
||||
|
||||
std::cout << GridLogMessage << "Dirac operator defined" << std::endl;
|
||||
|
||||
// Define PV^dag D (if we want)
|
||||
DomainWallFermionD Dpv(Umu, *FGrid, *FrbGrid, *UGrid, *UrbGrid, 1.0, M5);
|
||||
typedef PVdagMLinearOperator<DomainWallFermionD,LatticeFermionD> PVdagM_t;
|
||||
PVdagM_t PVdagM(Ddwf, Dpv);
|
||||
// DomainWallFermionD Dpv(Umu, *FGrid, *FrbGrid, *UGrid, *UrbGrid, 1.0, M5);
|
||||
// typedef PVdagMLinearOperator<DomainWallFermionD,LatticeFermionD> PVdagM_t;
|
||||
// PVdagM_t PVdagM(Ddwf, Dpv);
|
||||
|
||||
std::cout<<GridLogMessage<<std::endl;
|
||||
std::cout<<GridLogMessage<<"*******************************************"<<std::endl;
|
||||
@@ -338,6 +353,9 @@ int main (int argc, char ** argv)
|
||||
KrylovSchur KrySchur (DLinOp, FGrid, 1e-8, RF); // use Ddwf
|
||||
KrySchur(src, maxIter, Nm, Nk, Nstop);
|
||||
|
||||
std::cout << GridLogMessage << "Checking eigensystem." << std::endl;
|
||||
KrySchur.checkRitzEstimate();
|
||||
|
||||
std::cout<<GridLogMessage << "*******************************************" << std::endl;
|
||||
std::cout<<GridLogMessage << "***************** RESULTS *****************" << std::endl;
|
||||
std::cout<<GridLogMessage << "*******************************************" << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user