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