CHROMA
rbc_gaugeact.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief RG style plaquette + rectangle gauge action following RBC conventions
4  */
5 
6 #ifndef __rbc_gaugeact_h__
7 #define __rbc_gaugeact_h__
8 
9 #include "gaugeact.h"
10 #include "gaugebc.h"
13 
14 namespace Chroma
15 {
16 
17  /*! @ingroup gaugeacts */
18  namespace RBCGaugeActEnv
19  {
20  extern const std::string name;
21  bool registerAll();
22  }
23 
24  //! Parameter structure
25  /*! @ingroup gaugeacts */
27  // Base Constructor
29 
30  // Read params from some root path
31  RBCGaugeActParams(XMLReader& xml_in, const std::string& path);
32 
33  Real beta;
34  Real c1;
35  };
36 
37  /*! @ingroup gaugeacts */
38  void read(XMLReader& xml, const std::string& path, RBCGaugeActParams& param);
39 
40 
41  //! RG gauge action
42  /*! \ingroup gaugeacts
43  *
44  * A RG (plaquette + rectangle) gauge action following RBC conventions
45  *
46  * S = -(beta/Nc)*[(1-8*c_1)*Plaq + c_1 * Rect]
47  */
48 
50  {
51  public:
52  //! General CreateGaugeState<P,Q>
54  const Real& beta_, const Real& c1_) :
55  beta(beta_), c1(c1_) {init(cgs_);}
56 
57  //! Read beta from a param struct
59  const RBCGaugeActParams& p) :
60  beta(p.beta), c1(p.c1) {init(cgs_);}
61 
62  //! Is anisotropy used?
63  bool anisoP() const {return false;}
64 
65  //! Anisotropy factor
66  const Real anisoFactor() const {return Real(1);}
67 
68  //! Anisotropic direction
69  int tDir() const {return Nd-1;}
70 
71  //! Return the set on which the gauge action is defined
72  /*! Defined on the even-off (red/black) set */
73  const Set& getSet() const {return rb;}
74 
75  //! Compute staple
76  /*! Default version. Derived class should override this if needed. */
77  void staple(LatticeColorMatrix& result,
78  const Handle< GaugeState<P,Q> >& state,
79  int mu, int cb) const
80  {
81  plaq->staple(result,state,mu,cb);
82 
83  LatticeColorMatrix tmp;
84  rect->staple(tmp,state,mu,cb);
85  result += tmp;
86  }
87 
88  //! Compute dS/dU
89  void deriv(multi1d<LatticeColorMatrix>& result,
90  const Handle< GaugeState<P,Q> >& state) const
91  {
92  plaq->deriv(result,state);
93 
94  multi1d<LatticeColorMatrix> tmp;
95  rect->deriv(tmp,state);
96  result += tmp;
97  }
98 
99  //! Compute the actions
101  {
102  return plaq->S(state) + rect->S(state);
103  }
104 
105  //! Produce a gauge create state object
106  const CreateGaugeState<P,Q>& getCreateState() const {return plaq->getCreateState();}
107 
108  //! Destructor is automatic
110 
111  // Accessors -- non mutable members.
112  const Real getBeta(void) const { return beta; }
113 
114  protected:
115  //! Private initializer
116  void init(Handle< CreateGaugeState<P,Q> > cgs);
117 
118  //! Partial constructor
120  //! Hide assignment
121  void operator=(const RBCGaugeAct& a) {}
122 
123  private:
124  Real beta; // The coupling Beta
125  Real c1; // The relative rectangle factor
126  Handle<PlaqGaugeAct> plaq; // Hold a plaquette gaugeact
127  Handle<RectGaugeAct> rect; // Hold a rectangle gaugeact
128 
129  };
130 
131 }
132 
133 
134 #endif
Create a gauge connection state.
Definition: create_state.h:47
Support class for fermion actions and linear operators.
Definition: state.h:74
Class for counted reference semantics.
Definition: handle.h:33
Base class for gauge actions with links appearing linearly in the action.
Definition: gaugeact.h:80
RG gauge action.
Definition: rbc_gaugeact.h:50
bool anisoP() const
Is anisotropy used?
Definition: rbc_gaugeact.h:63
const Set & getSet() const
Return the set on which the gauge action is defined.
Definition: rbc_gaugeact.h:73
RBCGaugeAct(Handle< CreateGaugeState< P, Q > > cgs_, const RBCGaugeActParams &p)
Read beta from a param struct.
Definition: rbc_gaugeact.h:58
void deriv(multi1d< LatticeColorMatrix > &result, const Handle< GaugeState< P, Q > > &state) const
Compute dS/dU.
Definition: rbc_gaugeact.h:89
Handle< RectGaugeAct > rect
Definition: rbc_gaugeact.h:127
const Real anisoFactor() const
Anisotropy factor.
Definition: rbc_gaugeact.h:66
RBCGaugeAct(Handle< CreateGaugeState< P, Q > > cgs_, const Real &beta_, const Real &c1_)
General CreateGaugeState<P,Q>
Definition: rbc_gaugeact.h:53
const CreateGaugeState< P, Q > & getCreateState() const
Produce a gauge create state object.
Definition: rbc_gaugeact.h:106
RBCGaugeAct()
Partial constructor.
Definition: rbc_gaugeact.h:119
void staple(LatticeColorMatrix &result, const Handle< GaugeState< P, Q > > &state, int mu, int cb) const
Compute staple.
Definition: rbc_gaugeact.h:77
Double S(const Handle< GaugeState< P, Q > > &state) const
Compute the actions.
Definition: rbc_gaugeact.h:100
int tDir() const
Anisotropic direction.
Definition: rbc_gaugeact.h:69
~RBCGaugeAct()
Destructor is automatic.
Definition: rbc_gaugeact.h:109
const Real getBeta(void) const
Definition: rbc_gaugeact.h:112
void init(Handle< CreateGaugeState< P, Q > > cgs)
Private initializer.
Definition: rbc_gaugeact.cc:62
Handle< PlaqGaugeAct > plaq
Definition: rbc_gaugeact.h:126
void operator=(const RBCGaugeAct &a)
Hide assignment.
Definition: rbc_gaugeact.h:121
int mu
Definition: cool.cc:24
Class structure for gauge actions.
Gauge boundary conditions.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams &param)
Read parameters.
Nd
Definition: meslate.cc:74
const std::string name
Definition: rbc_gaugeact.cc:22
bool registerAll()
Register all the factories.
Definition: rbc_gaugeact.cc:28
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
LatticeFermion tmp
Definition: mespbg5p_w.cc:36
Complex a
Definition: invbicg.cc:95
int cb
Definition: invbicg.cc:120
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
Definition: pbg5p_w.cc:28
FloatingPoint< double > Double
Definition: gtest.h:7351
::std::string string
Definition: gtest.h:1979
Plaquette gauge action.
Rectangle gauge action.
Parameter structure.
Definition: rbc_gaugeact.h:26