CHROMA
lw_tree_gaugeact.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Tree-level tadpole-improved Luscher-Weisz gauge action
4  */
5 
6 #ifndef __lw_tree_gaugeact_h__
7 #define __lw_tree_gaugeact_h__
8 
9 #include "gaugeact.h"
10 #include "gaugebc.h"
13 
14 namespace Chroma
15 {
16 
17  /*! @ingroup gaugeacts */
18  namespace LWTreeGaugeActEnv
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  LWTreeGaugeActParams(XMLReader& xml_in, const std::string& path);
32 
33  Real beta;
34  Real u0;
36  };
37 
38  /*! @ingroup gaugeacts */
39  void read(XMLReader& xml, const std::string& path, LWTreeGaugeActParams& param);
40 
41 
42  //! LWTree gauge action
43  /*! \ingroup gaugeacts
44  *
45  * The standard LWTree gauge action
46  */
47 
49  {
50  public:
51  // Typedefs to save typing
52  typedef multi1d<LatticeColorMatrix> P;
53  typedef multi1d<LatticeColorMatrix> Q;
54 
55  //! Read beta from a param struct
57  const LWTreeGaugeActParams& p) :
58  param(p) {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 param.aniso.t_dir;}
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 param.beta; }
111 
112  protected:
113  //! Private initializer
114  void init(Handle< CreateGaugeState<P,Q> > cgs);
115 
116  //! Hide assignment
117  void operator=(const LWTreeGaugeAct& a) {}
118 
119  private:
120  Handle<PlaqGaugeAct> plaq; /*!< Hold a plaquette gaugeact */
121  Handle<RectGaugeAct> rect; /*!< Hold a rectangle gaugeact */
122  LWTreeGaugeActParams param; /*!< The coupling Beta */
123  };
124 
125 }
126 
127 
128 #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
LWTree gauge action.
LWTreeGaugeActParams param
void deriv(multi1d< LatticeColorMatrix > &result, const Handle< GaugeState< P, Q > > &state) const
Compute dS/dU.
bool anisoP() const
Is anisotropy used?
multi1d< LatticeColorMatrix > P
Handle< RectGaugeAct > rect
int tDir() const
Anisotropic direction.
void staple(LatticeColorMatrix &result, const Handle< GaugeState< P, Q > > &state, int mu, int cb) const
Compute staple.
multi1d< LatticeColorMatrix > Q
Handle< PlaqGaugeAct > plaq
const Set & getSet() const
Return the set on which the gauge action is defined.
const Real getBeta(void) const
void init(Handle< CreateGaugeState< P, Q > > cgs)
Private initializer.
void operator=(const LWTreeGaugeAct &a)
Hide assignment.
~LWTreeGaugeAct()
Destructor is automatic.
Double S(const Handle< GaugeState< P, Q > > &state) const
Compute the actions.
const CreateGaugeState< P, Q > & getCreateState() const
Produce a gauge create state object.
const Real anisoFactor() const
Anisotropy factor.
LWTreeGaugeAct(Handle< CreateGaugeState< P, Q > > cgs_, const LWTreeGaugeActParams &p)
Read beta from a param struct.
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.
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
Plaquette gauge action.
Rectangle gauge action.
Parameters for anisotropy.
Definition: aniso_io.h:24