2016-01-02 14:51:32 +00:00
|
|
|
/*************************************************************************************
|
|
|
|
|
|
|
|
Grid physics library, www.github.com/paboyle/Grid
|
|
|
|
|
|
|
|
Source file: ./lib/qcd/action/gauge/PlaqPlusRectangleAction.h
|
|
|
|
|
|
|
|
Copyright (C) 2015
|
|
|
|
|
|
|
|
Author: Azusa Yamaguchi <ayamaguc@staffmail.ed.ac.uk>
|
|
|
|
Author: paboyle <paboyle@ph.ed.ac.uk>
|
|
|
|
|
|
|
|
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 */
|
2015-12-28 16:39:26 +00:00
|
|
|
#ifndef QCD_PLAQ_PLUS_RECTANGLE_ACTION_H
|
|
|
|
#define QCD_PLAQ_PLUS_RECTANGLE_ACTION_H
|
|
|
|
|
|
|
|
namespace Grid{
|
|
|
|
namespace QCD{
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
// PlaqPlusRectangleActoin
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
2016-01-02 13:37:25 +00:00
|
|
|
template<class Gimpl>
|
|
|
|
class PlaqPlusRectangleAction : public Action<typename Gimpl::GaugeField> {
|
2015-12-28 16:39:26 +00:00
|
|
|
public:
|
|
|
|
|
2016-01-02 13:37:25 +00:00
|
|
|
INHERIT_GIMPL_TYPES(Gimpl);
|
2015-12-28 16:39:26 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
RealD c_plaq;
|
|
|
|
RealD c_rect;
|
|
|
|
|
|
|
|
public:
|
|
|
|
PlaqPlusRectangleAction(RealD b,RealD c): c_plaq(b),c_rect(c){};
|
2016-11-16 16:46:49 +00:00
|
|
|
|
|
|
|
virtual std::string action_name(){return "PlaqPlusRectangleAction";}
|
2015-12-28 16:39:26 +00:00
|
|
|
|
|
|
|
virtual void refresh(const GaugeField &U, GridParallelRNG& pRNG) {}; // noop as no pseudoferms
|
|
|
|
|
2017-01-19 10:00:02 +00:00
|
|
|
virtual std::string LogParameters(){
|
|
|
|
std::stringstream sstream;
|
|
|
|
sstream << GridLogMessage << "["<<action_name() <<"] c_plaq: " << c_plaq << std::endl;
|
|
|
|
sstream << GridLogMessage << "["<<action_name() <<"] c_rect: " << c_rect << std::endl;
|
|
|
|
return sstream.str();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-12-28 16:39:26 +00:00
|
|
|
virtual RealD S(const GaugeField &U) {
|
|
|
|
RealD vol = U._grid->gSites();
|
|
|
|
|
2016-01-02 13:37:25 +00:00
|
|
|
RealD plaq = WilsonLoops<Gimpl>::avgPlaquette(U);
|
|
|
|
RealD rect = WilsonLoops<Gimpl>::avgRectangle(U);
|
2015-12-28 16:39:26 +00:00
|
|
|
|
|
|
|
RealD action=c_plaq*(1.0 -plaq)*(Nd*(Nd-1.0))*vol*0.5
|
|
|
|
+c_rect*(1.0 -rect)*(Nd*(Nd-1.0))*vol;
|
|
|
|
|
|
|
|
return action;
|
|
|
|
};
|
|
|
|
|
2015-12-29 19:22:59 +00:00
|
|
|
virtual void deriv(const GaugeField &Umu,GaugeField & dSdU) {
|
2015-12-28 16:39:26 +00:00
|
|
|
//extend Ta to include Lorentz indexes
|
|
|
|
RealD factor_p = c_plaq/RealD(Nc)*0.5;
|
|
|
|
RealD factor_r = c_rect/RealD(Nc)*0.5;
|
|
|
|
|
2015-12-29 19:22:59 +00:00
|
|
|
GridBase *grid = Umu._grid;
|
|
|
|
|
|
|
|
std::vector<GaugeLinkField> U (Nd,grid);
|
|
|
|
std::vector<GaugeLinkField> U2(Nd,grid);
|
|
|
|
|
|
|
|
for(int mu=0;mu<Nd;mu++){
|
|
|
|
U[mu] = PeekIndex<LorentzIndex>(Umu,mu);
|
2016-01-02 13:37:25 +00:00
|
|
|
WilsonLoops<Gimpl>::RectStapleDouble(U2[mu],U[mu],mu);
|
2015-12-29 19:22:59 +00:00
|
|
|
}
|
2015-12-28 16:39:26 +00:00
|
|
|
|
2015-12-29 19:22:59 +00:00
|
|
|
GaugeLinkField dSdU_mu(grid);
|
|
|
|
GaugeLinkField staple(grid);
|
|
|
|
|
|
|
|
for (int mu=0; mu < Nd; mu++){
|
2015-12-28 16:39:26 +00:00
|
|
|
|
|
|
|
// Staple in direction mu
|
2015-12-29 19:22:59 +00:00
|
|
|
|
2016-01-02 13:37:25 +00:00
|
|
|
WilsonLoops<Gimpl>::Staple(staple,Umu,mu);
|
2015-12-29 19:22:59 +00:00
|
|
|
|
|
|
|
dSdU_mu = Ta(U[mu]*staple)*factor_p;
|
|
|
|
|
2016-01-02 13:37:25 +00:00
|
|
|
WilsonLoops<Gimpl>::RectStaple(Umu,staple,U2,U,mu);
|
2015-12-29 19:22:59 +00:00
|
|
|
|
|
|
|
dSdU_mu = dSdU_mu + Ta(U[mu]*staple)*factor_r;
|
2015-12-28 16:39:26 +00:00
|
|
|
|
|
|
|
PokeIndex<LorentzIndex>(dSdU, dSdU_mu, mu);
|
|
|
|
}
|
2015-12-29 19:22:59 +00:00
|
|
|
|
2015-12-28 16:39:26 +00:00
|
|
|
};
|
2015-12-29 19:22:59 +00:00
|
|
|
|
2015-12-28 16:39:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Convenience for common physically defined cases.
|
|
|
|
//
|
|
|
|
// RBC c1 parameterisation is not really RBC but don't have good
|
|
|
|
// reference and we are happy to change name if prior use of this plaq coeff
|
|
|
|
// parameterisation is made known to us.
|
2016-01-02 13:37:25 +00:00
|
|
|
template<class Gimpl>
|
|
|
|
class RBCGaugeAction : public PlaqPlusRectangleAction<Gimpl> {
|
2015-12-28 16:39:26 +00:00
|
|
|
public:
|
2016-01-02 13:37:25 +00:00
|
|
|
INHERIT_GIMPL_TYPES(Gimpl);
|
2016-11-16 16:46:49 +00:00
|
|
|
RBCGaugeAction(RealD beta,RealD c1) : PlaqPlusRectangleAction<Gimpl>(beta*(1.0-8.0*c1), beta*c1) {};
|
|
|
|
virtual std::string action_name(){return "RBCGaugeAction";}
|
2015-12-28 16:39:26 +00:00
|
|
|
};
|
|
|
|
|
2016-01-02 13:37:25 +00:00
|
|
|
template<class Gimpl>
|
|
|
|
class IwasakiGaugeAction : public RBCGaugeAction<Gimpl> {
|
2015-12-28 16:39:26 +00:00
|
|
|
public:
|
2016-01-02 13:37:25 +00:00
|
|
|
INHERIT_GIMPL_TYPES(Gimpl);
|
2016-11-16 16:46:49 +00:00
|
|
|
IwasakiGaugeAction(RealD beta) : RBCGaugeAction<Gimpl>(beta,-0.331) {};
|
|
|
|
virtual std::string action_name(){return "IwasakiGaugeAction";}
|
2015-12-28 16:39:26 +00:00
|
|
|
};
|
|
|
|
|
2016-01-02 13:37:25 +00:00
|
|
|
template<class Gimpl>
|
|
|
|
class SymanzikGaugeAction : public RBCGaugeAction<Gimpl> {
|
2015-12-28 16:39:26 +00:00
|
|
|
public:
|
2016-01-02 13:37:25 +00:00
|
|
|
INHERIT_GIMPL_TYPES(Gimpl);
|
2016-11-16 16:46:49 +00:00
|
|
|
SymanzikGaugeAction(RealD beta) : RBCGaugeAction<Gimpl>(beta,-1.0/12.0) {};
|
|
|
|
virtual std::string action_name(){return "SymanzikGaugeAction";}
|
2015-12-28 16:39:26 +00:00
|
|
|
};
|
|
|
|
|
2016-01-02 13:37:25 +00:00
|
|
|
template<class Gimpl>
|
|
|
|
class DBW2GaugeAction : public RBCGaugeAction<Gimpl> {
|
2015-12-28 16:39:26 +00:00
|
|
|
public:
|
2016-01-02 13:37:25 +00:00
|
|
|
INHERIT_GIMPL_TYPES(Gimpl);
|
2016-11-16 16:46:49 +00:00
|
|
|
DBW2GaugeAction(RealD beta) : RBCGaugeAction<Gimpl>(beta,-1.4067) {};
|
|
|
|
virtual std::string action_name(){return "DBW2GaugeAction";}
|
2015-12-28 16:39:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|