mirror of
				https://github.com/paboyle/Grid.git
				synced 2025-11-03 21:44:33 +00:00 
			
		
		
		
	Adding action names
This commit is contained in:
		@@ -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(){};
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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<Gimpl> {
 | 
			
		||||
    public:
 | 
			
		||||
      INHERIT_GIMPL_TYPES(Gimpl);
 | 
			
		||||
      RBCGaugeAction(RealD beta,RealD c1) : PlaqPlusRectangleAction<Gimpl>(beta*(1.0-8.0*c1), beta*c1) {
 | 
			
		||||
      };
 | 
			
		||||
      RBCGaugeAction(RealD beta,RealD c1) : PlaqPlusRectangleAction<Gimpl>(beta*(1.0-8.0*c1), beta*c1) {};
 | 
			
		||||
      virtual std::string action_name(){return "RBCGaugeAction";}
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    template<class Gimpl>
 | 
			
		||||
    class IwasakiGaugeAction : public RBCGaugeAction<Gimpl> {
 | 
			
		||||
    public:
 | 
			
		||||
      INHERIT_GIMPL_TYPES(Gimpl);
 | 
			
		||||
      IwasakiGaugeAction(RealD beta) : RBCGaugeAction<Gimpl>(beta,-0.331) {
 | 
			
		||||
      };
 | 
			
		||||
      IwasakiGaugeAction(RealD beta) : RBCGaugeAction<Gimpl>(beta,-0.331) {};
 | 
			
		||||
      virtual std::string action_name(){return "IwasakiGaugeAction";}
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    template<class Gimpl>
 | 
			
		||||
    class SymanzikGaugeAction : public RBCGaugeAction<Gimpl> {
 | 
			
		||||
    public:
 | 
			
		||||
      INHERIT_GIMPL_TYPES(Gimpl);
 | 
			
		||||
      SymanzikGaugeAction(RealD beta) : RBCGaugeAction<Gimpl>(beta,-1.0/12.0) {
 | 
			
		||||
      };
 | 
			
		||||
      SymanzikGaugeAction(RealD beta) : RBCGaugeAction<Gimpl>(beta,-1.0/12.0) {};
 | 
			
		||||
      virtual std::string action_name(){return "SymanzikGaugeAction";}
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    template<class Gimpl>
 | 
			
		||||
    class DBW2GaugeAction : public RBCGaugeAction<Gimpl> {
 | 
			
		||||
    public:
 | 
			
		||||
      INHERIT_GIMPL_TYPES(Gimpl);
 | 
			
		||||
      DBW2GaugeAction(RealD beta) : RBCGaugeAction<Gimpl>(beta,-1.4067) {
 | 
			
		||||
      };
 | 
			
		||||
      DBW2GaugeAction(RealD beta) : RBCGaugeAction<Gimpl>(beta,-1.4067) {};
 | 
			
		||||
      virtual std::string action_name(){return "DBW2GaugeAction";}
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
@@ -51,6 +51,8 @@ class WilsonGaugeAction : public Action<typename Gimpl::GaugeField> {
 | 
			
		||||
 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<typename Gimpl::GaugeField> {
 | 
			
		||||
    // 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<typename Gimpl::GaugeField> {
 | 
			
		||||
 | 
			
		||||
      PokeIndex<LorentzIndex>(dSdU, dSdU_mu, mu);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  };
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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}
 | 
			
		||||
 
 | 
			
		||||
@@ -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) {
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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) {
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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) {
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -62,6 +62,9 @@ class TwoFlavourPseudoFermionAction : public Action<typename Impl::GaugeField> {
 | 
			
		||||
        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<typename Impl::GaugeField> {
 | 
			
		||||
    //         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);
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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) {
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -57,6 +57,8 @@ namespace Grid{
 | 
			
		||||
					 OperatorFunction<FermionField> & 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}
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user