mirror of
https://github.com/paboyle/Grid.git
synced 2025-06-13 12:47:05 +01:00
Adding some wilson loop support
This commit is contained in:
20
lib/qcd/action/gauge/GaugeActionBase.h
Normal file
20
lib/qcd/action/gauge/GaugeActionBase.h
Normal file
@ -0,0 +1,20 @@
|
||||
#ifndef QCD_GAUGE_ACTION_BASE
|
||||
#define QCD_GAUGE_ACTION_BASE
|
||||
namespace Grid {
|
||||
namespace QCD{
|
||||
|
||||
template<class GaugeField>
|
||||
class GaugeActionBase { // derive this from TermInAction?
|
||||
|
||||
public:
|
||||
virtual RealD S(const GaugeField &U) = 0; // evaluate the action
|
||||
virtual void deriv(const GaugeField &U,GaugeField & dSdU ) = 0; // evaluate the action derivative
|
||||
virtual void staple(const GaugeField &U,GaugeField & dSdU ) = 0; // evaluate the action derivative
|
||||
virtual void refresh(const GaugeField & ) {};
|
||||
// Boundary conditions?
|
||||
// Heatbath?
|
||||
virtual ~GaugeActionBase() {};
|
||||
};
|
||||
|
||||
}}
|
||||
#endif
|
24
lib/qcd/action/gauge/WilsonGaugeAction.h
Normal file
24
lib/qcd/action/gauge/WilsonGaugeAction.h
Normal file
@ -0,0 +1,24 @@
|
||||
#ifndef QCD_WILSON_GAUGE_ACTION_H
|
||||
#define QCD_WILSON_GAUGE_ACTION_H
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Wilson Gauge Action .. should I template the Nc etc..
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
template<class GaugeField,class MatrixField>
|
||||
class WilsonGaugeAction : public GaugeActionBase<GaugeField> {
|
||||
public:
|
||||
virtual RealD S(const GaugeField &U) {
|
||||
return WilsonLoops<MatrixField,GaugeField>::sumPlaquette(U);
|
||||
};
|
||||
virtual RealD deriv(GaugeField &U,GaugeField & dSdU ) {
|
||||
WilsonLoops<MatrixField,GaugeField>::Staple(dSdU,U,mu);
|
||||
};
|
||||
virtual void staple(const MatrixField &stap,GaugeField & U,int mu ) {
|
||||
WilsonLoops<MatrixField,GaugeField>::Staple(stap,U,mu);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user