CHROMA
lw_1loop_gaugeact.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief 1-loop tadpole-improved Luscher-Weisz gauge action
4  */
5 
6 #ifndef __lw_1loop_gaugeact_h__
7 #define __lw_1loop_gaugeact_h__
8 
9 #include "gaugeact.h"
10 #include "gaugebc.h"
14 
15 namespace Chroma
16 {
17 
18  /*! @ingroup gaugeacts */
19  namespace LW1LoopGaugeActEnv
20  {
21  extern const std::string name;
22  bool registerAll();
23  }
24 
25  //! Parameter structure
26  /*! @ingroup gaugeacts */
28  // Base Constructor
30 
31  // Read params from some root path
32  LW1LoopGaugeActParams(XMLReader& xml_in, const std::string& path);
33 
34  Real beta;
35  Real u0;
36  };
37 
38  /*! @ingroup gaugeacts */
39  void read(XMLReader& xml, const std::string& path, LW1LoopGaugeActParams& param);
40 
41 
42  //! LW1Loop gauge action
43  /*! \ingroup gaugeacts
44  *
45  * The standard LW1Loop gauge action
46  */
47 
49  {
50  public:
51  // Typedefs to save typing
52  typedef multi1d<LatticeColorMatrix> P;
53  typedef multi1d<LatticeColorMatrix> Q;
54 
55  //! General GaugeState
57  const Real& beta_, const Real& u0_) :
58  beta(beta_), u0(u0_) {init(cgs_);}
59 
60  //! Read beta from a param struct
62  const LW1LoopGaugeActParams& p) :
63  beta(p.beta), u0(p.u0) {init(cgs_);}
64 
65  //! Is anisotropy used?
66  bool anisoP() const {return false;}
67 
68  //! Anisotropy factor
69  const Real anisoFactor() const {return Real(1);}
70 
71  //! Anisotropic direction
72  int tDir() const {return Nd-1;}
73 
74  //! Return the set on which the gauge action is defined
75  /*! Defined on the even-off (red/black) set */
76  const Set& getSet() const {return rb;}
77 
78  //! Compute staple
79  /*! Default version. Derived class should override this if needed. */
80  void staple(LatticeColorMatrix& result,
81  const Handle< GaugeState<P,Q> >& state,
82  int mu, int cb) const
83  {
84  plaq->staple(result,state,mu,cb);
85 
86  LatticeColorMatrix tmp;
87  rect->staple(tmp,state,mu,cb);
88  result += tmp;
89 
90  pg->staple(tmp,state,mu,cb);
91  result += tmp;
92  }
93 
94  //! Compute dS/dU
95  void deriv(P& result,
96  const Handle< GaugeState<P,Q> >& state) const
97  {
98  plaq->deriv(result,state);
99 
100  multi1d<LatticeColorMatrix> tmp;
101  rect->deriv(tmp,state);
102  result += tmp;
103 
104  pg->deriv(tmp,state);
105  result += tmp;
106  }
107 
108  //! Compute the actions
110  {
111  return plaq->S(state) + rect->S(state) + pg->S(state);
112  }
113 
114  //! Produce a gauge boundary condition object
115  const CreateGaugeState<P,Q>& getCreateState() const {return plaq->getCreateState();}
116 
117  //! Destructor is automatic
119 
120  // Accessors -- non mutable members.
121  const Real getBeta(void) const { return beta; }
122 
123  protected:
124  //! Private initializer
125  void init(Handle< CreateGaugeState<P,Q> > cgs);
126 
127  //! General GaugeState
129  //! Hide assignment
130  void operator=(const LW1LoopGaugeAct& a) {}
131 
132  private:
133  Real beta; // The coupling Beta
134  Real u0; // Tadpole factor
135  Handle<PlaqGaugeAct> plaq; // Hold a plaquette gaugeact
136  Handle<RectGaugeAct> rect; // Hold a rectangle gaugeact
137  Handle<PgGaugeAct> pg; // Hold a parallelogram gaugeact
138 
139  };
140 
141 }
142 
143 
144 #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
LW1Loop gauge action.
const Real anisoFactor() const
Anisotropy factor.
LW1LoopGaugeAct(Handle< CreateGaugeState< P, Q > > cgs_, const LW1LoopGaugeActParams &p)
Read beta from a param struct.
int tDir() const
Anisotropic direction.
void deriv(P &result, const Handle< GaugeState< P, Q > > &state) const
Compute dS/dU.
multi1d< LatticeColorMatrix > Q
LW1LoopGaugeAct()
General GaugeState.
const CreateGaugeState< P, Q > & getCreateState() const
Produce a gauge boundary condition object.
Handle< RectGaugeAct > rect
void init(Handle< CreateGaugeState< P, Q > > cgs)
Private initializer.
Handle< PlaqGaugeAct > plaq
Double S(const Handle< GaugeState< P, Q > > &state) const
Compute the actions.
LW1LoopGaugeAct(Handle< CreateGaugeState< P, Q > > cgs_, const Real &beta_, const Real &u0_)
General GaugeState.
const Real getBeta(void) const
const Set & getSet() const
Return the set on which the gauge action is defined.
multi1d< LatticeColorMatrix > P
bool anisoP() const
Is anisotropy used?
Handle< PgGaugeAct > pg
void staple(LatticeColorMatrix &result, const Handle< GaugeState< P, Q > > &state, int mu, int cb) const
Compute staple.
~LW1LoopGaugeAct()
Destructor is automatic.
void operator=(const LW1LoopGaugeAct &a)
Hide assignment.
Base class for gauge actions with links appearing linearly in the action.
Definition: gaugeact.h:80
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.
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
Parallelgram gauge action.
Plaquette gauge action.
Rectangle gauge action.