2015-07-03 18:43:14 +01:00
|
|
|
#ifndef QCD_ACTION_BASE
|
|
|
|
#define QCD_ACTION_BASE
|
2015-06-05 10:02:36 +01:00
|
|
|
namespace Grid {
|
|
|
|
namespace QCD{
|
|
|
|
|
|
|
|
template<class GaugeField>
|
2015-07-03 18:43:14 +01:00
|
|
|
class Action {
|
2015-06-05 10:02:36 +01:00
|
|
|
|
|
|
|
public:
|
2015-07-27 10:32:28 +01:00
|
|
|
virtual void init (const GaugeField &U, GridParallelRNG& pRNG) = 0; //
|
|
|
|
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 refresh(const GaugeField & ) {}; // Default to no-op for actions with no internal fields
|
2015-06-05 10:02:36 +01:00
|
|
|
// Boundary conditions?
|
|
|
|
// Heatbath?
|
2015-07-03 18:43:14 +01:00
|
|
|
virtual ~Action() {};
|
2015-06-05 10:02:36 +01:00
|
|
|
};
|
|
|
|
|
2015-07-27 10:32:28 +01:00
|
|
|
// Could derive PseudoFermion action with a PF field, FermionField, and a Grid; implement refresh
|
|
|
|
template<class GaugeField, class FermionField>
|
|
|
|
class PseudoFermionAction : public Action<GaugeField> {
|
|
|
|
public:
|
|
|
|
FermionField Phi;
|
|
|
|
GridParallelRNG &pRNG;
|
|
|
|
GridBase &Grid;
|
|
|
|
|
|
|
|
PseudoFermionAction(GridBase &_Grid,GridParallelRNG &_pRNG) : Grid(_Grid), Phi(&_Grid), pRNG(_pRNG) {
|
|
|
|
};
|
|
|
|
|
|
|
|
virtual void refresh(const GaugeField &gauge) {
|
|
|
|
gaussian(Phi,pRNG);
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
2015-06-05 10:02:36 +01:00
|
|
|
}}
|
|
|
|
#endif
|