/************************************************************************************* grid` physics library, www.github.com/paboyle/Grid Source file: ./tests/Test_cshift.cc Copyright (C) 2015 Author: Azusa Yamaguchi Author: Peter Boyle This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ #include #include using namespace Grid; using namespace Grid::QCD; int main (int argc, char ** argv) { Grid_init(&argc,&argv); int threads = GridThread::GetThreads(); std::cout< latt_size = GridDefaultLatt(); std::vector simd_layout( { vComplexD::Nsimd(),1,1,1}); std::vector mpi_layout = GridDefaultMpi(); int vol = 1; for(int d=0;d p({1,3,2,3}); one = ComplexD(1.0,0.0); zz = ComplexD(0.0,0.0); ComplexD ci(0.0,1.0); std::cout<<"*************************************************"< seeds({1,2,3,4}); GridSerialRNG sRNG; sRNG.SeedFixedIntegers(seeds); // naughty seeding GridParallelRNG pRNG(&GRID); pRNG.SeedFixedIntegers(seeds); LatticeGaugeFieldD Umu(&GRID); SU3::ColdConfiguration(pRNG,Umu); // Unit gauge // Umu=zero; //////////////////////////////////////////////////// // Wilson test //////////////////////////////////////////////////// { LatticeFermionD src(&GRID); gaussian(pRNG,src); LatticeFermionD tmp(&GRID); LatticeFermionD ref(&GRID); RealD mass=0.01; WilsonFermionD Dw(Umu,GRID,RBGRID,mass); Dw.M(src,tmp); std::cout << "Dw src = " < 1/2 gmu (eip - emip) = i sinp gmu Kinetic = Kinetic + sin(kmu)*ci*(Gamma(Gmu[mu])*src5_p); } // NB implicit sum over mu // // 1-1/2 Dw = 1 - 1/2 ( eip+emip) // = - 1/2 (ei - 2 + emi) // = - 1/4 2 (eih - eimh)(eih - eimh) // = 2 sink/2 ink/2 = sk2 W = one - M5 + sk2; Kinetic = Kinetic + W * src5_p; LatticeCoordinate(scoor,sdir); tmp5 = Cshift(src5_p,sdir,+1); tmp5 = (tmp5 - G5*tmp5)*0.5; tmp5 = where(scoor==Integer(Ls-1),mass*tmp5,-tmp5); Kinetic = Kinetic + tmp5; tmp5 = Cshift(src5_p,sdir,-1); tmp5 = (tmp5 + G5*tmp5)*0.5; tmp5 = where(scoor==Integer(0),mass*tmp5,-tmp5); Kinetic = Kinetic + tmp5; std::cout<<"Momentum space Ddwf "<< norm2(Kinetic)< point(4,0); src=zero; SpinColourVectorD ferm; gaussian(sRNG,ferm); pokeSite(ferm,src,point); const int Ls=32; GridCartesian * FGrid = SpaceTimeGrid::makeFiveDimGrid(Ls,&GRID); GridRedBlackCartesian * FrbGrid = SpaceTimeGrid::makeFiveDimRedBlackGrid(Ls,&GRID); RealD mass=0.01; RealD M5 =0.8; DomainWallFermionD Ddwf(Umu,*FGrid,*FrbGrid,GRID,RBGRID,mass,M5); // Momentum space prop std::cout << " Solving by FFT and Feynman rules" < HermOp(Ddwf); ConjugateGradient CG(1.0e-16,10000); CG(HermOp,src5,result5); //////////////////////////////////////////////////////////////////////// // Domain wall physical field propagator //////////////////////////////////////////////////////////////////////// /* psi = chiralProjectMinus(psi_5[0]); psi += chiralProjectPlus(psi_5[Ls-1]); */ ExtractSlice(tmp,result5,0 ,sdir); result4 = (tmp-G5*tmp)*0.5; ExtractSlice(tmp,result5,Ls-1,sdir); result4 = result4+(tmp+G5*tmp)*0.5; std::cout << " Taking difference" < point(4,0); src=zero; SpinColourVectorD ferm; gaussian(sRNG,ferm); pokeSite(ferm,src,point); const int Ls=48; GridCartesian * FGrid = SpaceTimeGrid::makeFiveDimGrid(Ls,&GRID); GridRedBlackCartesian * FrbGrid = SpaceTimeGrid::makeFiveDimRedBlackGrid(Ls,&GRID); RealD mass=0.01; RealD M5 =0.8; OverlapWilsonCayleyTanhFermionD Dov(Umu,*FGrid,*FrbGrid,GRID,RBGRID,mass,M5,1.0); // Momentum space prop std::cout << " Solving by FFT and Feynman rules" < HermOp(Dov); ConjugateGradient CG(1.0e-16,10000); CG(HermOp,src5,result5); //////////////////////////////////////////////////////////////////////// // Domain wall physical field propagator //////////////////////////////////////////////////////////////////////// /* psi = chiralProjectMinus(psi_5[0]); psi += chiralProjectPlus(psi_5[Ls-1]); */ ExtractSlice(tmp,result5,0 ,sdir); result4 = (tmp-G5*tmp)*0.5; ExtractSlice(tmp,result5,Ls-1,sdir); result4 = result4+(tmp+G5*tmp)*0.5; std::cout << " Taking difference" < QEDGimplTypesD; typedef Photon QEDGaction; QEDGaction Maxwell(QEDGaction::FEYNMAN_L); QEDGaction::GaugeField Prop(&GRID);Prop=zero; QEDGaction::GaugeField Source(&GRID);Source=zero; Maxwell.FreePropagator (Source,Prop); std::cout << " MaxwellFree propagator\n"; */ } Grid_finalize(); }