diff --git a/tests/Test_cayley_coarsen_support.cc b/tests/Test_cayley_coarsen_support.cc index 064f5f13..b68a5cc3 100644 --- a/tests/Test_cayley_coarsen_support.cc +++ b/tests/Test_cayley_coarsen_support.cc @@ -21,9 +21,7 @@ int main (int argc, char ** argv) { Grid_init(&argc,&argv); - - - const int Ls=4; + const int Ls=8; GridCartesian * UGrid = SpaceTimeGrid::makeFourDimGrid(GridDefaultLatt(), GridDefaultSimd(Nd,vComplexF::Nsimd()),GridDefaultMpi()); GridRedBlackCartesian * UrbGrid = SpaceTimeGrid::makeFourDimRedBlackGrid(UGrid); @@ -41,8 +39,10 @@ int main (int argc, char ** argv) std::vector seeds4({1,2,3,4}); std::vector seeds5({5,6,7,8}); - GridParallelRNG RNG5(FGrid); RNG5.SeedFixedIntegers(seeds5); - GridParallelRNG RNG4(UGrid); RNG4.SeedFixedIntegers(seeds4); + std::vector cseeds({5,6,7,8}); + GridParallelRNG RNG5(FGrid); RNG5.SeedFixedIntegers(seeds5); + GridParallelRNG RNG4(UGrid); RNG4.SeedFixedIntegers(seeds4); + GridParallelRNG CRNG(Coarse5d);CRNG.SeedFixedIntegers(cseeds); LatticeFermion src(FGrid); random(RNG5,src); LatticeFermion result(FGrid); result=zero; @@ -50,31 +50,33 @@ int main (int argc, char ** argv) LatticeFermion tmp(FGrid); LatticeFermion err(FGrid); LatticeGaugeField Umu(UGrid); random(RNG4,Umu); + #if 0 std::vector U(4,UGrid); Umu=zero; Complex cone(1.0,0.0); for(int nn=0;nn2) { U[nn]=zero; std::cout << "zeroing gauge field in dir "<(Umu,U[nn],nn); } #endif + RealD mass=0.5; RealD M5=1.8; DomainWallFermion Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5); - Gamma5HermitianLinearOperator HermIndefOp(Ddwf); + Gamma5R5HermitianLinearOperator HermIndefOp(Ddwf); HermIndefOp.Op(src,ref); HermIndefOp.OpDiag(src,result); for(int d=0;d<4;d++){ - HermIndefOp.OpDir(src,tmp,d,+1); result=result+tmp; + HermIndefOp.OpDir(src,tmp,d+1,+1); result=result+tmp; std::cout<<"dir "< subspace(nbasis,FGrid); - + LatticeFermion prom(FGrid); + for(int b=0;b LittleDiracOp(*Coarse5d); + typedef CoarsenedMatrix LittleDiracOperator; + typedef LittleDiracOperator::CoarseVector CoarseVector; + + LittleDiracOperator LittleDiracOp(*Coarse5d); LittleDiracOp.CoarsenOperator(FGrid,HermIndefOp,subspace); - - typedef Lattice > coarse_vec; - coarse_vec c_src (Coarse5d); c_src= zero; - coarse_vec c_res (Coarse5d); + CoarseVector c_src (Coarse5d); + CoarseVector c_res (Coarse5d); + CoarseVector c_proj(Coarse5d); - Complex one(1.0); - c_src = one; // 1 in every element for vector 1. - // TODO // -- promote from subspace, check we get the vector we wanted // -- apply ldop; check we get the same as inner product of M times big vec // -- pick blocks one by one. Evaluate matrix elements. + Complex one(1.0); + c_src = one; // 1 in every element for vector 1. + + blockPromote(c_src,err,subspace); + + + prom=zero; + for(int b=0;b