2015-06-05 10:02:36 +01:00
|
|
|
#ifndef QCD_WILSON_GAUGE_ACTION_H
|
|
|
|
#define QCD_WILSON_GAUGE_ACTION_H
|
|
|
|
|
2015-07-03 18:43:14 +01:00
|
|
|
namespace Grid{
|
|
|
|
namespace QCD{
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
// Wilson Gauge Action .. should I template the Nc etc..
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
2015-08-30 12:18:34 +01:00
|
|
|
template<class GaugeField>
|
|
|
|
class WilsonGaugeAction : public Action<GaugeField> {
|
|
|
|
public:
|
|
|
|
|
|
|
|
typedef LorentzScalar<GaugeField> GaugeLinkField;
|
|
|
|
|
2015-07-03 18:43:14 +01:00
|
|
|
private:
|
|
|
|
RealD beta;
|
|
|
|
public:
|
|
|
|
WilsonGaugeAction(RealD b):beta(b){};
|
|
|
|
|
2015-07-04 09:47:50 +01:00
|
|
|
virtual void init(const GaugeField &U, GridParallelRNG& pRNG) {};
|
2015-07-03 18:43:14 +01:00
|
|
|
|
|
|
|
virtual RealD S(const GaugeField &U) {
|
2015-08-30 12:18:34 +01:00
|
|
|
RealD plaq = WilsonLoops<GaugeField>::avgPlaquette(U);
|
2015-07-23 17:31:13 +01:00
|
|
|
std::cout<<GridLogMessage << "Plaq : "<<plaq << "\n";
|
2015-07-29 09:53:39 +01:00
|
|
|
RealD vol = U._grid->gSites();
|
|
|
|
RealD action=beta*(1.0 -plaq)*(Nd*(Nd-1.0))*vol*0.5;
|
|
|
|
std::cout << GridLogMessage << "WilsonGauge action "<<action<<std::endl;
|
|
|
|
return action;
|
2015-07-03 18:43:14 +01:00
|
|
|
};
|
2015-08-30 12:18:34 +01:00
|
|
|
|
2015-07-03 18:43:14 +01:00
|
|
|
virtual void deriv(const GaugeField &U,GaugeField & dSdU) {
|
2015-07-05 18:24:58 +01:00
|
|
|
//not optimal implementation FIXME
|
|
|
|
//extend Ta to include Lorentz indexes
|
|
|
|
RealD factor = 0.5*beta/RealD(Nc);
|
2015-08-30 12:18:34 +01:00
|
|
|
GaugeLinkField Umu(U._grid);
|
|
|
|
GaugeLinkField dSdU_mu(U._grid);
|
2015-07-05 18:24:58 +01:00
|
|
|
for (int mu=0; mu < Nd; mu++){
|
2015-08-30 12:18:34 +01:00
|
|
|
|
2015-07-05 18:24:58 +01:00
|
|
|
Umu = PeekIndex<LorentzIndex>(U,mu);
|
2015-08-30 12:18:34 +01:00
|
|
|
|
2015-07-05 18:24:58 +01:00
|
|
|
// Staple in direction mu
|
2015-08-30 12:18:34 +01:00
|
|
|
WilsonLoops<GaugeField>::Staple(dSdU_mu,U,mu);
|
2015-07-05 18:24:58 +01:00
|
|
|
dSdU_mu = Ta(Umu*adj(dSdU_mu))*factor;
|
|
|
|
pokeLorentz(dSdU, dSdU_mu, mu);
|
|
|
|
}
|
2015-07-03 18:43:14 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
2015-06-05 10:02:36 +01:00
|
|
|
|
|
|
|
#endif
|