CHROMA
wilson_gaugeact.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Wilson gauge action
4  */
5 
6 #ifndef __wilson_gaugeact_h__
7 #define __wilson_gaugeact_h__
8 
9 #include "gaugeact.h"
10 #include "gaugebc.h"
13 
14 namespace Chroma
15 {
16 
17  /*! @ingroup gaugeacts */
18  namespace WilsonGaugeActEnv
19  {
20  extern const std::string name;
21  bool registerAll();
22  }
23 
24  //! Wilson gauge action
25  /*! \ingroup gaugeacts
26  *
27  * The standard Wilson gauge action
28  */
29 
31  {
32  public:
33  //! General CreateGaugeState<P,Q>
35  const Real& beta)
36  {param.beta = beta; init(cgs_);}
37 
38  //! General CreateGaugeState<P,Q>
40  const Real& beta,
41  const AnisoParam_t& aniso)
42  {param.beta = beta; param.aniso = aniso; init(cgs_);}
43 
44  //! Read beta from a param struct
46  const WilsonGaugeActParams& p) :
47  param(p) {init(cgs_);}
48 
49  //! Is anisotropy used?
50  bool anisoP() const {return param.aniso.anisoP;}
51 
52  //! Anisotropy factor
53  const Real anisoFactor() const {return param.aniso.xi_0;}
54 
55  //! Anisotropic direction
56  int tDir() const {return param.aniso.t_dir;}
57 
58  //! Return the set on which the gauge action is defined
59  /*! Defined on the even-off (red/black) set */
60  const Set& getSet() const {return rb;}
61 
62  //! Compute staple
63  /*! Default version. Derived class should override this if needed. */
64  void staple(LatticeColorMatrix& result,
65  const Handle< GaugeState<P,Q> >& state,
66  int mu, int cb) const
67  {
68  plaq->staple(result,state,mu,cb);
69  }
70 
71  //! Compute dS/dU
72  void deriv(multi1d<LatticeColorMatrix>& result,
73  const Handle< GaugeState<P,Q> >& state) const
74  {
75  plaq->deriv(result,state);
76  }
77 
78  //! Compute the actions
79  Double S(const Handle< GaugeState<P,Q> >& state) const
80  {
81  return plaq->S(state);
82  }
83 
84  //! Destructor is automatic
86 
87  // Accessors -- non mutable members.
88  const Real getBeta(void) const {return param.beta;}
89 
90  //! Produce a gauge create state object
91  const CreateGaugeState<P,Q>& getCreateState() const {return plaq->getCreateState();}
92 
93  protected:
94  //! Private initializer
95  void init(Handle< CreateGaugeState<P,Q> > cgs);
96 
97  //! Partial constructor
99  //! Hide assignment
100  void operator=(const WilsonGaugeAct& a) {}
101 
102  private:
103  Handle<PlaqGaugeAct> plaq; // Hold a plaquette gaugeact
105  };
106 
107 } // end namespace Chroma
108 
109 
110 #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
Wilson gauge action.
WilsonGaugeAct()
Partial constructor.
void init(Handle< CreateGaugeState< P, Q > > cgs)
Private initializer.
const Set & getSet() const
Return the set on which the gauge action is defined.
WilsonGaugeAct(Handle< CreateGaugeState< P, Q > > cgs_, const Real &beta)
General CreateGaugeState<P,Q>
~WilsonGaugeAct()
Destructor is automatic.
WilsonGaugeAct(Handle< CreateGaugeState< P, Q > > cgs_, const Real &beta, const AnisoParam_t &aniso)
General CreateGaugeState<P,Q>
const Real getBeta(void) const
Handle< PlaqGaugeAct > plaq
Double S(const Handle< GaugeState< P, Q > > &state) const
Compute the actions.
WilsonGaugeAct(Handle< CreateGaugeState< P, Q > > cgs_, const WilsonGaugeActParams &p)
Read beta from a param struct.
const Real anisoFactor() const
Anisotropy factor.
int tDir() const
Anisotropic direction.
void deriv(multi1d< LatticeColorMatrix > &result, const Handle< GaugeState< P, Q > > &state) const
Compute dS/dU.
void staple(LatticeColorMatrix &result, const Handle< GaugeState< P, Q > > &state, int mu, int cb) const
Compute staple.
const CreateGaugeState< P, Q > & getCreateState() const
Produce a gauge create state object.
WilsonGaugeActParams param
bool anisoP() const
Is anisotropy used?
void operator=(const WilsonGaugeAct &a)
Hide assignment.
int mu
Definition: cool.cc:24
Class structure for gauge actions.
Gauge boundary conditions.
static const LatticeInteger & beta(const int dim)
Definition: stag_phases_s.h:47
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
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.
Parameters for anisotropy.
Definition: aniso_io.h:24
Params for Wilson gauge action.