CHROMA
rg_gaugeact.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Generic RG style plaquette + rectangle gauge action
4  */
5 
6 #ifndef __rg_gaugeact_h__
7 #define __rg_gaugeact_h__
8 
9 #include "gaugeact.h"
10 #include "gaugebc.h"
13 
14 namespace Chroma
15 {
16 
17  /*! @ingroup gaugeacts */
18  namespace RGGaugeActEnv
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  RGGaugeActParams(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, RGGaugeActParams& param);
39 
40 
41  //! RG gauge action
42  /*! \ingroup gaugeacts
43  *
44  * A RG (plaquette + rectangle) gauge action
45  */
46 
48  {
49  public:
50  //! General CreateGaugeState<P,Q>
52  const Real& beta_, const Real& c1_) :
53  beta(beta_), c1(c1_) {init(cgs_);}
54 
55  //! Read beta from a param struct
57  const RGGaugeActParams& p) :
58  beta(p.beta), c1(p.c1) {init(cgs_);}
59 
60  //! Is anisotropy used?
61  bool anisoP() const {return false;}
62 
63  //! Anisotropy factor
64  const Real anisoFactor() const {return Real(1);}
65 
66  //! Anisotropic direction
67  int tDir() const {return Nd-1;}
68 
69  //! Return the set on which the gauge action is defined
70  /*! Defined on the even-off (red/black) set */
71  const Set& getSet() const {return rb;}
72 
73  //! Compute staple
74  /*! Default version. Derived class should override this if needed. */
75  void staple(LatticeColorMatrix& result,
76  const Handle< GaugeState<P,Q> >& state,
77  int mu, int cb) const
78  {
79  plaq->staple(result,state,mu,cb);
80 
81  LatticeColorMatrix tmp;
82  rect->staple(tmp,state,mu,cb);
83  result += tmp;
84  }
85 
86  //! Compute dS/dU
87  void deriv(multi1d<LatticeColorMatrix>& result,
88  const Handle< GaugeState<P,Q> >& state) const
89  {
90  plaq->deriv(result,state);
91 
92  multi1d<LatticeColorMatrix> tmp;
93  rect->deriv(tmp,state);
94  result += tmp;
95  }
96 
97  //! Compute the actions
98  Double S(const Handle< GaugeState<P,Q> >& state) const
99  {
100  return plaq->S(state) + rect->S(state);
101  }
102 
103  //! Produce a gauge create state object
104  const CreateGaugeState<P,Q>& getCreateState() const {return plaq->getCreateState();}
105 
106  //! Destructor is automatic
108 
109  // Accessors -- non mutable members.
110  const Real getBeta(void) const { return beta; }
111 
112  protected:
113  //! Private initializer
114  void init(Handle< CreateGaugeState<P,Q> > cgs);
115 
116  //! Partial constructor
118  //! Hide assignment
119  void operator=(const RGGaugeAct& a) {}
120 
121  private:
122  Real beta; // The coupling Beta
123  Real c1; // The relative rectangle factor
124  Handle<PlaqGaugeAct> plaq; // Hold a plaquette gaugeact
125  Handle<RectGaugeAct> rect; // Hold a rectangle gaugeact
126 
127  };
128 
129 }
130 
131 
132 #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: rg_gaugeact.h:48
RGGaugeAct()
Partial constructor.
Definition: rg_gaugeact.h:117
RGGaugeAct(Handle< CreateGaugeState< P, Q > > cgs_, const Real &beta_, const Real &c1_)
General CreateGaugeState<P,Q>
Definition: rg_gaugeact.h:51
Handle< PlaqGaugeAct > plaq
Definition: rg_gaugeact.h:124
const Real getBeta(void) const
Definition: rg_gaugeact.h:110
void init(Handle< CreateGaugeState< P, Q > > cgs)
Private initializer.
Definition: rg_gaugeact.cc:66
const Set & getSet() const
Return the set on which the gauge action is defined.
Definition: rg_gaugeact.h:71
Handle< RectGaugeAct > rect
Definition: rg_gaugeact.h:125
void operator=(const RGGaugeAct &a)
Hide assignment.
Definition: rg_gaugeact.h:119
~RGGaugeAct()
Destructor is automatic.
Definition: rg_gaugeact.h:107
RGGaugeAct(Handle< CreateGaugeState< P, Q > > cgs_, const RGGaugeActParams &p)
Read beta from a param struct.
Definition: rg_gaugeact.h:56
const CreateGaugeState< P, Q > & getCreateState() const
Produce a gauge create state object.
Definition: rg_gaugeact.h:104
const Real anisoFactor() const
Anisotropy factor.
Definition: rg_gaugeact.h:64
int tDir() const
Anisotropic direction.
Definition: rg_gaugeact.h:67
Double S(const Handle< GaugeState< P, Q > > &state) const
Compute the actions.
Definition: rg_gaugeact.h:98
bool anisoP() const
Is anisotropy used?
Definition: rg_gaugeact.h:61
void staple(LatticeColorMatrix &result, const Handle< GaugeState< P, Q > > &state, int mu, int cb) const
Compute staple.
Definition: rg_gaugeact.h:75
void deriv(multi1d< LatticeColorMatrix > &result, const Handle< GaugeState< P, Q > > &state) const
Compute dS/dU.
Definition: rg_gaugeact.h:87
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
bool registerAll()
Register all the factories.
Definition: rg_gaugeact.cc:32
const std::string name
Definition: rg_gaugeact.cc:29
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: rg_gaugeact.h:26