/************************************************************************************* Grid physics library, www.github.com/paboyle/Grid Source file: ./tests/Test_ddhmc_boundary.cc Copyright (C) 2021 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 using namespace std; using namespace Grid; template void ForceTest(Action &action,LatticeGaugeField & U,MomentumFilterBase &Filter) { GridBase *UGrid = U.Grid(); std::vector seeds({1,2,3,5}); GridSerialRNG sRNG; sRNG.SeedFixedIntegers(seeds); GridParallelRNG RNG4(UGrid); RNG4.SeedFixedIntegers(seeds); LatticeColourMatrix Pmu(UGrid); LatticeGaugeField P(UGrid); LatticeGaugeField UdSdU(UGrid); std::cout << GridLogMessage << "*********************************************************"<::HotConfiguration(RNG4,U); action.refresh(U,sRNG,RNG4); std::cout << GridLogMessage << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<(UdSdU,mu); Pmu= PeekIndex(P,mu); dS = dS - trace(Pmu*UdSdUmu)*eps*2.0*2.0; } ComplexD dSpred = sum(dS); RealD diff = S2-S1-dSpred.real(); std::cout<< GridLogMessage << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++"< FilterNone; ForceTest(PlaqAction,U,FilterNone); ForceTest(RectAction,U,FilterNone); //////////////////////////////////// // Unmodified matrix element //////////////////////////////////// RealD mass=0.01; RealD M5=1.8; Coordinate Block({0,0,0,Nt/2}); // Double versions typedef WilsonImplD FimplD; typedef DirichletFermionOperator DirichletFermion; DomainWallFermionR DdwfPeriodic(U,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5); DomainWallFermionR Ddwf(U,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5); DirichletFermion DdwfDirichlet(Ddwf,Block); DomainWallFermionR PVPeriodic(U,*FGrid,*FrbGrid,*UGrid,*UrbGrid,1.0,M5); DomainWallFermionR PV(U,*FGrid,*FrbGrid,*UGrid,*UrbGrid,1.0,M5); DirichletFermion PVDirichlet(PV,Block); // Single versions typedef WilsonImplF FimplF; typedef DirichletFermionOperator DirichletFermionF; DomainWallFermionF DdwfPeriodicF(UF,*FGridF,*FrbGridF,*UGridF,*UrbGridF,mass,M5); DomainWallFermionF DdwfF(UF,*FGridF,*FrbGridF,*UGridF,*UrbGridF,mass,M5); DirichletFermionF DdwfDirichletF(DdwfF,Block); DomainWallFermionF PVPeriodicF(UF,*FGridF,*FrbGridF,*UGridF,*UrbGridF,1.0,M5); DomainWallFermionF PVF(UF,*FGridF,*FrbGridF,*UGridF,*UrbGridF,1.0,M5); DirichletFermionF PVDirichletF(PVF,Block); double StoppingCondition = 1.0e-12; double MaxCGIterations = 10000; ConjugateGradient CG(StoppingCondition,MaxCGIterations); DirichletFilter FilterDDHMC(Block); //////////////////// Two Flavour Determinant Ratio /////////////////////////////// TwoFlavourRatioPseudoFermionAction Nf2(PVPeriodic, DdwfPeriodic,CG,CG); ForceTest(Nf2,U,FilterNone); //////////////////// Two Flavour Determinant Ratio /////////////////////////////// TwoFlavourRatioPseudoFermionAction Nf2deg(DdwfPeriodic, DdwfPeriodic,CG,CG); std::cout << "*** DEGENERATE ***\n"; ForceTest(Nf2deg,U,FilterNone); //////////////////// Two Flavour Determinant force test Even Odd /////////////////////////////// TwoFlavourEvenOddRatioPseudoFermionAction Nf2eo(PVPeriodic, DdwfPeriodic,CG,CG); ForceTest(Nf2eo,U,FilterNone); //////////////////// DDHMC Boundary force /////////////////////////////// SchurFactoredFermionOperator SchurDwf(DdwfPeriodic,DdwfPeriodicF, DdwfDirichlet,DdwfDirichletF, Block); SchurFactoredFermionOperator SchurPV(PVPeriodic,PVPeriodicF, PVDirichlet,PVDirichletF, Block); std::cout << "*** NUMERATOR ***\n"; DomainDecomposedBoundaryTwoFlavourPseudoFermion DBPFA(SchurDwf,1.0e-8,1.0e-8); ForceTest(DBPFA,U,FilterDDHMC); std::cout << "*** RATIO ***\n"; DomainDecomposedBoundaryTwoFlavourRatioPseudoFermion DBPFRA(SchurPV,SchurDwf,1.0e-8,1.0e-8); ForceTest(DBPFRA,U,FilterDDHMC); std::cout << "*** DEGENERATE ***\n"; DomainDecomposedBoundaryTwoFlavourRatioPseudoFermion DBPFRAdeg(SchurDwf,SchurDwf,1.0e-8,1.0e-8); ForceTest(DBPFRAdeg,U,FilterDDHMC); DomainDecomposedBoundaryTwoFlavourBosonPseudoFermion DBPFBA(SchurPV,1.0e-8,1.0e-8); ForceTest(DBPFBA,U,FilterDDHMC); Grid_finalize(); }