diff --git a/lib/qcd/action/ActionBase.h b/lib/qcd/action/ActionBase.h index 7911462e..371ccd24 100644 --- a/lib/qcd/action/ActionBase.h +++ b/lib/qcd/action/ActionBase.h @@ -42,6 +42,7 @@ class Action { virtual RealD S(const GaugeField& U) = 0; // evaluate the action virtual void deriv(const GaugeField& U, GaugeField& dSdU) = 0; // evaluate the action derivative + virtual std::string action_name() = 0; // return the action name virtual ~Action(){}; }; diff --git a/lib/qcd/action/gauge/PlaqPlusRectangleAction.h b/lib/qcd/action/gauge/PlaqPlusRectangleAction.h index 6193bedb..b78ed939 100644 --- a/lib/qcd/action/gauge/PlaqPlusRectangleAction.h +++ b/lib/qcd/action/gauge/PlaqPlusRectangleAction.h @@ -47,6 +47,8 @@ namespace Grid{ public: PlaqPlusRectangleAction(RealD b,RealD c): c_plaq(b),c_rect(c){}; + + virtual std::string action_name(){return "PlaqPlusRectangleAction";} virtual void refresh(const GaugeField &U, GridParallelRNG& pRNG) {}; // noop as no pseudoferms @@ -108,32 +110,32 @@ namespace Grid{ class RBCGaugeAction : public PlaqPlusRectangleAction { public: INHERIT_GIMPL_TYPES(Gimpl); - RBCGaugeAction(RealD beta,RealD c1) : PlaqPlusRectangleAction(beta*(1.0-8.0*c1), beta*c1) { - }; + RBCGaugeAction(RealD beta,RealD c1) : PlaqPlusRectangleAction(beta*(1.0-8.0*c1), beta*c1) {}; + virtual std::string action_name(){return "RBCGaugeAction";} }; template class IwasakiGaugeAction : public RBCGaugeAction { public: INHERIT_GIMPL_TYPES(Gimpl); - IwasakiGaugeAction(RealD beta) : RBCGaugeAction(beta,-0.331) { - }; + IwasakiGaugeAction(RealD beta) : RBCGaugeAction(beta,-0.331) {}; + virtual std::string action_name(){return "IwasakiGaugeAction";} }; template class SymanzikGaugeAction : public RBCGaugeAction { public: INHERIT_GIMPL_TYPES(Gimpl); - SymanzikGaugeAction(RealD beta) : RBCGaugeAction(beta,-1.0/12.0) { - }; + SymanzikGaugeAction(RealD beta) : RBCGaugeAction(beta,-1.0/12.0) {}; + virtual std::string action_name(){return "SymanzikGaugeAction";} }; template class DBW2GaugeAction : public RBCGaugeAction { public: INHERIT_GIMPL_TYPES(Gimpl); - DBW2GaugeAction(RealD beta) : RBCGaugeAction(beta,-1.4067) { - }; + DBW2GaugeAction(RealD beta) : RBCGaugeAction(beta,-1.4067) {}; + virtual std::string action_name(){return "DBW2GaugeAction";} }; } diff --git a/lib/qcd/action/gauge/WilsonGaugeAction.h b/lib/qcd/action/gauge/WilsonGaugeAction.h index b9216d78..aa61abf2 100644 --- a/lib/qcd/action/gauge/WilsonGaugeAction.h +++ b/lib/qcd/action/gauge/WilsonGaugeAction.h @@ -51,6 +51,8 @@ class WilsonGaugeAction : public Action { public: WilsonGaugeAction(RealD b) : beta(b){}; + virtual std::string action_name(){return "WilsonGaugeAction";} + virtual void refresh(const GaugeField &U, GridParallelRNG &pRNG){}; // noop as no pseudoferms @@ -65,7 +67,6 @@ class WilsonGaugeAction : public Action { // not optimal implementation FIXME // extend Ta to include Lorentz indexes - // RealD factor = 0.5*beta/RealD(Nc); RealD factor = 0.5 * beta / RealD(Nc); GaugeLinkField Umu(U._grid); @@ -79,6 +80,7 @@ class WilsonGaugeAction : public Action { PokeIndex(dSdU, dSdU_mu, mu); } + }; }; diff --git a/lib/qcd/action/pseudofermion/OneFlavourEvenOddRational.h b/lib/qcd/action/pseudofermion/OneFlavourEvenOddRational.h index 080b1be2..ec3fa9e2 100644 --- a/lib/qcd/action/pseudofermion/OneFlavourEvenOddRational.h +++ b/lib/qcd/action/pseudofermion/OneFlavourEvenOddRational.h @@ -90,6 +90,8 @@ class OneFlavourEvenOddRationalPseudoFermionAction PowerNegQuarter.Init(remez, param.tolerance, true); }; + virtual std::string action_name(){return "OneFlavourEvenOddRationalPseudoFermionAction";} + virtual void refresh(const GaugeField &U, GridParallelRNG &pRNG) { // P(phi) = e^{- phi^dag (MpcdagMpc)^-1/2 phi} // = e^{- phi^dag (MpcdagMpc)^-1/4 (MpcdagMpc)^-1/4 phi} diff --git a/lib/qcd/action/pseudofermion/OneFlavourEvenOddRationalRatio.h b/lib/qcd/action/pseudofermion/OneFlavourEvenOddRationalRatio.h index 735cb284..65eaabae 100644 --- a/lib/qcd/action/pseudofermion/OneFlavourEvenOddRationalRatio.h +++ b/lib/qcd/action/pseudofermion/OneFlavourEvenOddRationalRatio.h @@ -87,6 +87,8 @@ namespace Grid{ PowerQuarter.Init(remez,param.tolerance,false); PowerNegQuarter.Init(remez,param.tolerance,true); }; + + virtual std::string action_name(){return "OneFlavourEvenOddRatioRationalPseudoFermionAction";} virtual void refresh(const GaugeField &U, GridParallelRNG& pRNG) { diff --git a/lib/qcd/action/pseudofermion/OneFlavourRational.h b/lib/qcd/action/pseudofermion/OneFlavourRational.h index 65a99afa..aebcea3d 100644 --- a/lib/qcd/action/pseudofermion/OneFlavourRational.h +++ b/lib/qcd/action/pseudofermion/OneFlavourRational.h @@ -83,6 +83,8 @@ namespace Grid{ PowerQuarter.Init(remez,param.tolerance,false); PowerNegQuarter.Init(remez,param.tolerance,true); }; + + virtual std::string action_name(){return "OneFlavourRationalPseudoFermionAction";} virtual void refresh(const GaugeField &U, GridParallelRNG& pRNG) { diff --git a/lib/qcd/action/pseudofermion/OneFlavourRationalRatio.h b/lib/qcd/action/pseudofermion/OneFlavourRationalRatio.h index 2207e119..244eba7a 100644 --- a/lib/qcd/action/pseudofermion/OneFlavourRationalRatio.h +++ b/lib/qcd/action/pseudofermion/OneFlavourRationalRatio.h @@ -81,6 +81,8 @@ namespace Grid{ PowerQuarter.Init(remez,param.tolerance,false); PowerNegQuarter.Init(remez,param.tolerance,true); }; + + virtual std::string action_name(){return "OneFlavourRatioRationalPseudoFermionAction";} virtual void refresh(const GaugeField &U, GridParallelRNG& pRNG) { diff --git a/lib/qcd/action/pseudofermion/TwoFlavour.h b/lib/qcd/action/pseudofermion/TwoFlavour.h index 6b65a95d..79fad380 100644 --- a/lib/qcd/action/pseudofermion/TwoFlavour.h +++ b/lib/qcd/action/pseudofermion/TwoFlavour.h @@ -62,6 +62,9 @@ class TwoFlavourPseudoFermionAction : public Action { ActionSolver(AS), Phi(Op.FermionGrid()){}; + + virtual std::string action_name(){return "TwoFlavourPseudoFermionAction";} + ////////////////////////////////////////////////////////////////////////////////////// // Push the gauge field in to the dops. Assume any BC's and smearing already // applied @@ -81,7 +84,9 @@ class TwoFlavourPseudoFermionAction : public Action { // in the Phi integral, and thus is only an irrelevant prefactor for // the partition function. // - RealD scale = std::sqrt(0.5); + + RealD scale = std::sqrt(0.5); + FermionField eta(FermOp.FermionGrid()); gaussian(pRNG, eta); diff --git a/lib/qcd/action/pseudofermion/TwoFlavourEvenOdd.h b/lib/qcd/action/pseudofermion/TwoFlavourEvenOdd.h index 5af1761e..009899ea 100644 --- a/lib/qcd/action/pseudofermion/TwoFlavourEvenOdd.h +++ b/lib/qcd/action/pseudofermion/TwoFlavourEvenOdd.h @@ -64,6 +64,8 @@ class TwoFlavourEvenOddPseudoFermionAction PhiEven(Op.FermionRedBlackGrid()), PhiOdd(Op.FermionRedBlackGrid()) {}; + + virtual std::string action_name(){return "TwoFlavourEvenOddPseudoFermionAction";} ////////////////////////////////////////////////////////////////////////////////////// // Push the gauge field in to the dops. Assume any BC's and smearing already applied diff --git a/lib/qcd/action/pseudofermion/TwoFlavourEvenOddRatio.h b/lib/qcd/action/pseudofermion/TwoFlavourEvenOddRatio.h index 5e3b80d9..a8bd9fe7 100644 --- a/lib/qcd/action/pseudofermion/TwoFlavourEvenOddRatio.h +++ b/lib/qcd/action/pseudofermion/TwoFlavourEvenOddRatio.h @@ -67,6 +67,8 @@ namespace Grid{ conformable(_NumOp.GaugeGrid(), _DenOp.GaugeGrid()); conformable(_NumOp.GaugeRedBlackGrid(), _DenOp.GaugeRedBlackGrid()); }; + + virtual std::string action_name(){return "TwoFlavourEvenOddRatioPseudoFermionAction";} virtual void refresh(const GaugeField &U, GridParallelRNG& pRNG) { diff --git a/lib/qcd/action/pseudofermion/TwoFlavourRatio.h b/lib/qcd/action/pseudofermion/TwoFlavourRatio.h index 26d21094..03d5fe07 100644 --- a/lib/qcd/action/pseudofermion/TwoFlavourRatio.h +++ b/lib/qcd/action/pseudofermion/TwoFlavourRatio.h @@ -57,6 +57,8 @@ namespace Grid{ OperatorFunction & AS ) : NumOp(_NumOp), DenOp(_DenOp), DerivativeSolver(DS), ActionSolver(AS), Phi(_NumOp.FermionGrid()) {}; + virtual std::string action_name(){return "TwoFlavourRatioPseudoFermionAction";} + virtual void refresh(const GaugeField &U, GridParallelRNG& pRNG) { // P(phi) = e^{- phi^dag V (MdagM)^-1 Vdag phi} diff --git a/lib/qcd/hmc/integrators/Integrator.h b/lib/qcd/hmc/integrators/Integrator.h index ec3d31fe..6f1e5c45 100644 --- a/lib/qcd/hmc/integrators/Integrator.h +++ b/lib/qcd/hmc/integrators/Integrator.h @@ -57,7 +57,7 @@ struct IntegratorParameters { void print_parameters() { - std::cout << GridLogMessage << "[Integrator] Trajectory length : " << trajL << std::endl; + std::cout << GridLogMessage << "[Integrator] Trajectory length : " << trajL << std::endl; std::cout << GridLogMessage << "[Integrator] Number of MD steps : " << MDsteps << std::endl; std::cout << GridLogMessage << "[Integrator] Step size : " << stepsize << std::endl; } @@ -101,8 +101,9 @@ class Integrator { repr_set.at(a)->deriv(Rep.U, forceR); GF force = Rep.RtoFundamentalProject(forceR); // Ta for the fundamental rep + Real force_abs = std::sqrt(norm2(force)); std::cout << GridLogIntegrator << "Hirep Force average: " - << norm2(force) / (U._grid->gSites()) << std::endl; + << force_abs / (U._grid->gSites()) << std::endl; Mom -= force * ep ; } } @@ -121,8 +122,9 @@ class Integrator { << std::endl; if (as[level].actions.at(a)->is_smeared) Smearer.smeared_force(force); force = FieldImplementation::projectForce(force); // Ta for gauge fields + Real force_abs = std::sqrt(norm2(force)); std::cout << GridLogIntegrator - << "Force average: " << norm2(force) / (U._grid->gSites()) + << "Force average: " << force_abs / (U._grid->gSites()) << std::endl; Mom -= force * ep; } diff --git a/tests/hmc/Test_hmc_WilsonFermionGauge_Binary.cc b/tests/hmc/Test_hmc_WilsonFermionGauge_Binary.cc index 65007673..42a903d6 100644 --- a/tests/hmc/Test_hmc_WilsonFermionGauge_Binary.cc +++ b/tests/hmc/Test_hmc_WilsonFermionGauge_Binary.cc @@ -123,11 +123,13 @@ class HmcRunner : public BinaryHmcRunner { ObservablesList.push_back(&Checkpoint); // Smearing section, omit if not needed + /* double rho = 0.1; // smearing parameter int Nsmear = 2; // number of smearing levels Smear_Stout Stout(rho); SmearedConfiguration SmearingPolicy( UGrid, Nsmear, Stout); + */ /////////////////// // Run(argc, argv, Checkpoint, SmearingPolicy); @@ -151,7 +153,7 @@ int main(int argc, char **argv) { std::vector ParSeed({6, 7, 8, 9, 10}); TheHMC.RNGSeeds(SerSeed, ParSeed); - TheHMC.MDparameters.set(5, 1.0);// MDsteps, traj length + TheHMC.MDparameters.set(10, 1.0);// MDsteps, traj length TheHMC.BuildTheAction(argc, argv); } diff --git a/tests/hmc/Test_hmc_WilsonGauge_Binary.cc b/tests/hmc/Test_hmc_WilsonGauge_Binary.cc index 2becb37c..4c650357 100644 --- a/tests/hmc/Test_hmc_WilsonGauge_Binary.cc +++ b/tests/hmc/Test_hmc_WilsonGauge_Binary.cc @@ -80,6 +80,7 @@ class HmcRunner : public BinaryHmcRunner { // Gauge action + std::cout << GridLogMessage << "Beta: " << HMCPar.beta << std::endl; GaugeAction Waction(HMCPar.beta); // Collect actions