Grid 0.7.0
PlaqPlusRectangleAction.h
Go to the documentation of this file.
1/*************************************************************************************
2
3 Grid physics library, www.github.com/paboyle/Grid
4
5 Source file: ./lib/qcd/action/gauge/PlaqPlusRectangleAction.h
6
7 Copyright (C) 2015
8
9Author: Azusa Yamaguchi <ayamaguc@staffmail.ed.ac.uk>
10Author: paboyle <paboyle@ph.ed.ac.uk>
11
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
16
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
21
22 You should have received a copy of the GNU General Public License along
23 with this program; if not, write to the Free Software Foundation, Inc.,
24 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25
26 See the full license in the file "LICENSE" in the top level distribution directory
27*************************************************************************************/
28/* END LEGAL */
29#ifndef QCD_PLAQ_PLUS_RECTANGLE_ACTION_H
30#define QCD_PLAQ_PLUS_RECTANGLE_ACTION_H
31
35
40
41template<class Gimpl>
42class PlaqPlusRectangleAction : public Action<typename Gimpl::GaugeField>
61{
62public:
67
68 using Action<GaugeField>::S;
69 using Action<GaugeField>::Sinitial;
70 using Action<GaugeField>::deriv;
71 using Action<GaugeField>::refresh;
72
73private:
77public:
84
85 virtual std::string action_name(){return "PlaqPlusRectangleAction";}
86
88 virtual void refresh(const GaugeField &U, GridSerialRNG &sRNG, GridParallelRNG& pRNG) {};
89
90 virtual std::string LogParameters(){
91 std::stringstream sstream;
92 sstream << GridLogMessage << "["<<action_name() <<"] c_plaq: " << c_plaq << std::endl;
93 sstream << GridLogMessage << "["<<action_name() <<"] c_rect: " << c_rect << std::endl;
94 return sstream.str();
95 }
96
107 virtual RealD S(const GaugeField &U) {
108 RealD vol = U.Grid()->gSites();
109
112
113 RealD action=c_plaq*(1.0 -plaq)*(Nd*(Nd-1.0))*vol*0.5
114 +c_rect*(1.0 -rect)*(Nd*(Nd-1.0))*vol;
115
116 return action;
117 };
118
124 virtual void deriv(const GaugeField &U, GaugeField &dSdU) {
125 //extend Ta to include Lorentz indexes
126 RealD factor_p = c_plaq/RealD(Nc)*0.5;
127 RealD factor_r = c_rect/RealD(Nc)*0.5;
128
129 GridBase *grid = U.Grid();
130
131 std::vector<GaugeLinkField> Umu (Nd,grid);
132 for(int mu=0;mu<Nd;mu++){
133 Umu[mu] = PeekIndex<LorentzIndex>(U,mu);
134 }
135 std::vector<GaugeLinkField> RectStaple(Nd,grid), Staple(Nd,grid);
137
138 GaugeLinkField dSdU_mu(grid);
139 GaugeLinkField staple(grid);
140
141 for (int mu=0; mu < Nd; mu++){
142 dSdU_mu = Ta(Umu[mu]*Staple[mu])*factor_p;
143 dSdU_mu = dSdU_mu + Ta(Umu[mu]*RectStaple[mu])*factor_r;
144
145 PokeIndex<LorentzIndex>(dSdU, dSdU_mu, mu);
146 }
147
148 };
149
150};
151
152template<class Gimpl>
166{
167public:
169 RBCGaugeAction(RealD beta,RealD c1) : PlaqPlusRectangleAction<Gimpl>(beta*(1.0-8.0*c1), beta*c1) {};
170 virtual std::string action_name(){return "RBCGaugeAction";}
171};
172
173template<class Gimpl>
181{
182public:
184 IwasakiGaugeAction(RealD beta) : RBCGaugeAction<Gimpl>(beta,-0.331) {};
185 virtual std::string action_name(){return "IwasakiGaugeAction";}
186};
187
188template<class Gimpl>
195{
196public:
198 SymanzikGaugeAction(RealD beta) : RBCGaugeAction<Gimpl>(beta,-1.0/12.0) {};
199 virtual std::string action_name(){return "SymanzikGaugeAction";}
200};
201
202template<class Gimpl>
203class DBW2GaugeAction : public RBCGaugeAction<Gimpl>
216{
217public:
219 DBW2GaugeAction(RealD beta) : RBCGaugeAction<Gimpl>(beta,-1.4067) {};
220 virtual std::string action_name(){return "DBW2GaugeAction";}
221};
222
226
227#endif
void PokeIndex(Lattice< vobj > &lhs, const Lattice< decltype(peekIndex< Index >(vobj(), 0))> &rhs, int i)
auto PeekIndex(const Lattice< vobj > &lhs, int i) -> Lattice< decltype(peekIndex< Index >(vobj(), i))>
GridLogger GridLogMessage(1, "Message", GridLogColours, "NORMAL")
#define NAMESPACE_BEGIN(A)
Definition Namespace.h:35
#define NAMESPACE_END(A)
Definition Namespace.h:36
static constexpr int Nd
Definition QCD.h:52
static constexpr int Nc
Definition QCD.h:50
double RealD
Definition Simd.h:61
accelerator_inline iScalar< vtype > Ta(const iScalar< vtype > &r)
Definition Tensor_Ta.h:45
static INTERNAL_PRECISION U
Definition Zolotarev.cc:230
Base class for all actions.
Definition ActionBase.h:64
virtual RealD Sinitial(const GaugeField &U)
Definition ActionBase.h:157
INHERIT_GIMPL_TYPES(Gimpl)
virtual std::string action_name()
Report the name of the action.
virtual std::string action_name()
Report the name of the action.
INHERIT_GIMPL_TYPES(Gimpl)
virtual std::string LogParameters()
Print the parameters of the action.
virtual void deriv(const GaugeField &U, GaugeField &dSdU)
virtual std::string action_name()
Report the name of the action.
PlaqPlusRectangleAction(RealD b, RealD c)
Initialise the action with the relevant coefficients.
WilsonLoops< PeriodicGimplR >::StapleAndRectStapleAllWorkspace workspace
virtual void refresh(const GaugeField &U, GridSerialRNG &sRNG, GridParallelRNG &pRNG)
INHERIT_GIMPL_TYPES(Gimpl)
All attributes of the gauge implementation are available from the action. See GaugeImplTypes....
INHERIT_GIMPL_TYPES(Gimpl)
RBCGaugeAction(RealD beta, RealD c1)
virtual std::string action_name()
Report the name of the action.
virtual std::string action_name()
Report the name of the action.
static RealD avgRectangle(const GaugeLorentz &Umu)
static RealD avgPlaquette(const GaugeLorentz &Umu)
static void StapleAndRectStapleAll(std::vector< GaugeMat > &Stap, std::vector< GaugeMat > &RectStap, const std::vector< GaugeMat > &U)