mirror of
https://github.com/paboyle/Grid.git
synced 2024-11-10 07:55:35 +00:00
Adding action names
This commit is contained in:
parent
454302414d
commit
3834feb4b7
@ -42,6 +42,7 @@ class Action {
|
|||||||
virtual RealD S(const GaugeField& U) = 0; // evaluate the action
|
virtual RealD S(const GaugeField& U) = 0; // evaluate the action
|
||||||
virtual void deriv(const GaugeField& U,
|
virtual void deriv(const GaugeField& U,
|
||||||
GaugeField& dSdU) = 0; // evaluate the action derivative
|
GaugeField& dSdU) = 0; // evaluate the action derivative
|
||||||
|
virtual std::string action_name() = 0; // return the action name
|
||||||
virtual ~Action(){};
|
virtual ~Action(){};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -47,6 +47,8 @@ namespace Grid{
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
PlaqPlusRectangleAction(RealD b,RealD c): c_plaq(b),c_rect(c){};
|
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
|
virtual void refresh(const GaugeField &U, GridParallelRNG& pRNG) {}; // noop as no pseudoferms
|
||||||
|
|
||||||
@ -108,32 +110,32 @@ namespace Grid{
|
|||||||
class RBCGaugeAction : public PlaqPlusRectangleAction<Gimpl> {
|
class RBCGaugeAction : public PlaqPlusRectangleAction<Gimpl> {
|
||||||
public:
|
public:
|
||||||
INHERIT_GIMPL_TYPES(Gimpl);
|
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>
|
template<class Gimpl>
|
||||||
class IwasakiGaugeAction : public RBCGaugeAction<Gimpl> {
|
class IwasakiGaugeAction : public RBCGaugeAction<Gimpl> {
|
||||||
public:
|
public:
|
||||||
INHERIT_GIMPL_TYPES(Gimpl);
|
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>
|
template<class Gimpl>
|
||||||
class SymanzikGaugeAction : public RBCGaugeAction<Gimpl> {
|
class SymanzikGaugeAction : public RBCGaugeAction<Gimpl> {
|
||||||
public:
|
public:
|
||||||
INHERIT_GIMPL_TYPES(Gimpl);
|
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>
|
template<class Gimpl>
|
||||||
class DBW2GaugeAction : public RBCGaugeAction<Gimpl> {
|
class DBW2GaugeAction : public RBCGaugeAction<Gimpl> {
|
||||||
public:
|
public:
|
||||||
INHERIT_GIMPL_TYPES(Gimpl);
|
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:
|
public:
|
||||||
WilsonGaugeAction(RealD b) : beta(b){};
|
WilsonGaugeAction(RealD b) : beta(b){};
|
||||||
|
|
||||||
|
virtual std::string action_name(){return "WilsonGaugeAction";}
|
||||||
|
|
||||||
virtual void refresh(const GaugeField &U,
|
virtual void refresh(const GaugeField &U,
|
||||||
GridParallelRNG &pRNG){}; // noop as no pseudoferms
|
GridParallelRNG &pRNG){}; // noop as no pseudoferms
|
||||||
|
|
||||||
@ -65,7 +67,6 @@ class WilsonGaugeAction : public Action<typename Gimpl::GaugeField> {
|
|||||||
// not optimal implementation FIXME
|
// not optimal implementation FIXME
|
||||||
// extend Ta to include Lorentz indexes
|
// extend Ta to include Lorentz indexes
|
||||||
|
|
||||||
// RealD factor = 0.5*beta/RealD(Nc);
|
|
||||||
RealD factor = 0.5 * beta / RealD(Nc);
|
RealD factor = 0.5 * beta / RealD(Nc);
|
||||||
|
|
||||||
GaugeLinkField Umu(U._grid);
|
GaugeLinkField Umu(U._grid);
|
||||||
@ -79,6 +80,7 @@ class WilsonGaugeAction : public Action<typename Gimpl::GaugeField> {
|
|||||||
|
|
||||||
PokeIndex<LorentzIndex>(dSdU, dSdU_mu, mu);
|
PokeIndex<LorentzIndex>(dSdU, dSdU_mu, mu);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -90,6 +90,8 @@ class OneFlavourEvenOddRationalPseudoFermionAction
|
|||||||
PowerNegQuarter.Init(remez, param.tolerance, true);
|
PowerNegQuarter.Init(remez, param.tolerance, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
virtual std::string action_name(){return "OneFlavourEvenOddRationalPseudoFermionAction";}
|
||||||
|
|
||||||
virtual void refresh(const GaugeField &U, GridParallelRNG &pRNG) {
|
virtual void refresh(const GaugeField &U, GridParallelRNG &pRNG) {
|
||||||
// P(phi) = e^{- phi^dag (MpcdagMpc)^-1/2 phi}
|
// P(phi) = e^{- phi^dag (MpcdagMpc)^-1/2 phi}
|
||||||
// = e^{- phi^dag (MpcdagMpc)^-1/4 (MpcdagMpc)^-1/4 phi}
|
// = e^{- phi^dag (MpcdagMpc)^-1/4 (MpcdagMpc)^-1/4 phi}
|
||||||
|
@ -87,6 +87,8 @@ namespace Grid{
|
|||||||
PowerQuarter.Init(remez,param.tolerance,false);
|
PowerQuarter.Init(remez,param.tolerance,false);
|
||||||
PowerNegQuarter.Init(remez,param.tolerance,true);
|
PowerNegQuarter.Init(remez,param.tolerance,true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
virtual std::string action_name(){return "OneFlavourEvenOddRatioRationalPseudoFermionAction";}
|
||||||
|
|
||||||
virtual void refresh(const GaugeField &U, GridParallelRNG& pRNG) {
|
virtual void refresh(const GaugeField &U, GridParallelRNG& pRNG) {
|
||||||
|
|
||||||
|
@ -83,6 +83,8 @@ namespace Grid{
|
|||||||
PowerQuarter.Init(remez,param.tolerance,false);
|
PowerQuarter.Init(remez,param.tolerance,false);
|
||||||
PowerNegQuarter.Init(remez,param.tolerance,true);
|
PowerNegQuarter.Init(remez,param.tolerance,true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
virtual std::string action_name(){return "OneFlavourRationalPseudoFermionAction";}
|
||||||
|
|
||||||
virtual void refresh(const GaugeField &U, GridParallelRNG& pRNG) {
|
virtual void refresh(const GaugeField &U, GridParallelRNG& pRNG) {
|
||||||
|
|
||||||
|
@ -81,6 +81,8 @@ namespace Grid{
|
|||||||
PowerQuarter.Init(remez,param.tolerance,false);
|
PowerQuarter.Init(remez,param.tolerance,false);
|
||||||
PowerNegQuarter.Init(remez,param.tolerance,true);
|
PowerNegQuarter.Init(remez,param.tolerance,true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
virtual std::string action_name(){return "OneFlavourRatioRationalPseudoFermionAction";}
|
||||||
|
|
||||||
virtual void refresh(const GaugeField &U, GridParallelRNG& pRNG) {
|
virtual void refresh(const GaugeField &U, GridParallelRNG& pRNG) {
|
||||||
|
|
||||||
|
@ -62,6 +62,9 @@ class TwoFlavourPseudoFermionAction : public Action<typename Impl::GaugeField> {
|
|||||||
ActionSolver(AS),
|
ActionSolver(AS),
|
||||||
Phi(Op.FermionGrid()){};
|
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
|
// Push the gauge field in to the dops. Assume any BC's and smearing already
|
||||||
// applied
|
// applied
|
||||||
@ -81,7 +84,9 @@ class TwoFlavourPseudoFermionAction : public Action<typename Impl::GaugeField> {
|
|||||||
// in the Phi integral, and thus is only an irrelevant prefactor for
|
// in the Phi integral, and thus is only an irrelevant prefactor for
|
||||||
// the partition function.
|
// the partition function.
|
||||||
//
|
//
|
||||||
RealD scale = std::sqrt(0.5);
|
|
||||||
|
RealD scale = std::sqrt(0.5);
|
||||||
|
|
||||||
FermionField eta(FermOp.FermionGrid());
|
FermionField eta(FermOp.FermionGrid());
|
||||||
|
|
||||||
gaussian(pRNG, eta);
|
gaussian(pRNG, eta);
|
||||||
|
@ -64,6 +64,8 @@ class TwoFlavourEvenOddPseudoFermionAction
|
|||||||
PhiEven(Op.FermionRedBlackGrid()),
|
PhiEven(Op.FermionRedBlackGrid()),
|
||||||
PhiOdd(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
|
// 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.GaugeGrid(), _DenOp.GaugeGrid());
|
||||||
conformable(_NumOp.GaugeRedBlackGrid(), _DenOp.GaugeRedBlackGrid());
|
conformable(_NumOp.GaugeRedBlackGrid(), _DenOp.GaugeRedBlackGrid());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
virtual std::string action_name(){return "TwoFlavourEvenOddRatioPseudoFermionAction";}
|
||||||
|
|
||||||
virtual void refresh(const GaugeField &U, GridParallelRNG& pRNG) {
|
virtual void refresh(const GaugeField &U, GridParallelRNG& pRNG) {
|
||||||
|
|
||||||
|
@ -57,6 +57,8 @@ namespace Grid{
|
|||||||
OperatorFunction<FermionField> & AS
|
OperatorFunction<FermionField> & AS
|
||||||
) : NumOp(_NumOp), DenOp(_DenOp), DerivativeSolver(DS), ActionSolver(AS), Phi(_NumOp.FermionGrid()) {};
|
) : 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) {
|
virtual void refresh(const GaugeField &U, GridParallelRNG& pRNG) {
|
||||||
|
|
||||||
// P(phi) = e^{- phi^dag V (MdagM)^-1 Vdag phi}
|
// P(phi) = e^{- phi^dag V (MdagM)^-1 Vdag phi}
|
||||||
|
@ -57,7 +57,7 @@ struct IntegratorParameters {
|
|||||||
|
|
||||||
|
|
||||||
void print_parameters() {
|
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] Number of MD steps : " << MDsteps << std::endl;
|
||||||
std::cout << GridLogMessage << "[Integrator] Step size : " << stepsize << 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);
|
repr_set.at(a)->deriv(Rep.U, forceR);
|
||||||
GF force =
|
GF force =
|
||||||
Rep.RtoFundamentalProject(forceR); // Ta for the fundamental rep
|
Rep.RtoFundamentalProject(forceR); // Ta for the fundamental rep
|
||||||
|
Real force_abs = std::sqrt(norm2(force));
|
||||||
std::cout << GridLogIntegrator << "Hirep Force average: "
|
std::cout << GridLogIntegrator << "Hirep Force average: "
|
||||||
<< norm2(force) / (U._grid->gSites()) << std::endl;
|
<< force_abs / (U._grid->gSites()) << std::endl;
|
||||||
Mom -= force * ep ;
|
Mom -= force * ep ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -121,8 +122,9 @@ class Integrator {
|
|||||||
<< std::endl;
|
<< std::endl;
|
||||||
if (as[level].actions.at(a)->is_smeared) Smearer.smeared_force(force);
|
if (as[level].actions.at(a)->is_smeared) Smearer.smeared_force(force);
|
||||||
force = FieldImplementation::projectForce(force); // Ta for gauge fields
|
force = FieldImplementation::projectForce(force); // Ta for gauge fields
|
||||||
|
Real force_abs = std::sqrt(norm2(force));
|
||||||
std::cout << GridLogIntegrator
|
std::cout << GridLogIntegrator
|
||||||
<< "Force average: " << norm2(force) / (U._grid->gSites())
|
<< "Force average: " << force_abs / (U._grid->gSites())
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
Mom -= force * ep;
|
Mom -= force * ep;
|
||||||
}
|
}
|
||||||
|
@ -123,11 +123,13 @@ class HmcRunner : public BinaryHmcRunner {
|
|||||||
ObservablesList.push_back(&Checkpoint);
|
ObservablesList.push_back(&Checkpoint);
|
||||||
|
|
||||||
// Smearing section, omit if not needed
|
// Smearing section, omit if not needed
|
||||||
|
/*
|
||||||
double rho = 0.1; // smearing parameter
|
double rho = 0.1; // smearing parameter
|
||||||
int Nsmear = 2; // number of smearing levels
|
int Nsmear = 2; // number of smearing levels
|
||||||
Smear_Stout<BinaryHmcRunner::ImplPolicy> Stout(rho);
|
Smear_Stout<BinaryHmcRunner::ImplPolicy> Stout(rho);
|
||||||
SmearedConfiguration<BinaryHmcRunner::ImplPolicy> SmearingPolicy(
|
SmearedConfiguration<BinaryHmcRunner::ImplPolicy> SmearingPolicy(
|
||||||
UGrid, Nsmear, Stout);
|
UGrid, Nsmear, Stout);
|
||||||
|
*/
|
||||||
///////////////////
|
///////////////////
|
||||||
|
|
||||||
// Run(argc, argv, Checkpoint, SmearingPolicy);
|
// Run(argc, argv, Checkpoint, SmearingPolicy);
|
||||||
@ -151,7 +153,7 @@ int main(int argc, char **argv) {
|
|||||||
std::vector<int> ParSeed({6, 7, 8, 9, 10});
|
std::vector<int> ParSeed({6, 7, 8, 9, 10});
|
||||||
TheHMC.RNGSeeds(SerSeed, ParSeed);
|
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);
|
TheHMC.BuildTheAction(argc, argv);
|
||||||
}
|
}
|
||||||
|
@ -80,6 +80,7 @@ class HmcRunner : public BinaryHmcRunner {
|
|||||||
|
|
||||||
|
|
||||||
// Gauge action
|
// Gauge action
|
||||||
|
std::cout << GridLogMessage << "Beta: " << HMCPar.beta << std::endl;
|
||||||
GaugeAction Waction(HMCPar.beta);
|
GaugeAction Waction(HMCPar.beta);
|
||||||
|
|
||||||
// Collect actions
|
// Collect actions
|
||||||
|
Loading…
Reference in New Issue
Block a user