CHROMA
plaq_gaugeact.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Plaquette gauge action
4  */
5 
6 #ifndef __plaq_gaugeact_h__
7 #define __plaq_gaugeact_h__
8 
9 #include "gaugeact.h"
10 #include "gaugebc.h"
11 #include "io/aniso_io.h"
12 
13 namespace Chroma
14 {
15 
16  /*! @ingroup gaugeacts */
17  namespace PlaqGaugeActEnv
18  {
19  extern const std::string name;
20  bool registerAll();
21  }
22 
23  //! Parameter structure
24  /*! @ingroup gaugeacts */
26  {
27  //! Base Constructor
29 
30  //! Read params from some root path
31  PlaqGaugeActParams(XMLReader& xml_in, const std::string& path);
32 
33  multi2d<Real> coeffs; /*!< Array of coefficients for aniso */
34  };
35 
36  /*! @ingroup gaugeacts */
37  void read(XMLReader& xml, const std::string& path, PlaqGaugeActParams& param);
38 
39 // /*! @ingroup gaugeacts */
40 // void write(XMLWriter& xml, const std::string& path, const PlaqGaugeActParams& param);
41 
42 
43  //! Plaquette gauge action
44  /*! \ingroup gaugeacts
45  *
46  * The standard Plaquette gauge action
47  */
48 
50  {
51  public:
52  //! General CreateGaugeState<P,Q>
53  /*!< Supplied for callers with simple params */
55  const Real& coeff,
56  const AnisoParam_t& aniso) : cgs(cgs_)
57  {init(coeff,aniso);}
58 
59  //! General CreateGaugeState<P,Q>
60  /*!< Supplied for callers with simple params */
62  const Real& coeff_s,
63  const Real& coeff_t,
64  const AnisoParam_t& aniso) : cgs(cgs_)
65  {init(coeff_s,coeff_t,aniso);}
66 
67  //! Read coeff from a param struct
69  const PlaqGaugeActParams& p) :
70  cgs(cgs_), param(p) {}
71 
72  //! Return the set on which the gauge action is defined
73  /*! Defined on the even-off (red/black) set */
74  const Set& getSet() const {return rb;}
75 
76  //! Compute staple
77  void staple(LatticeColorMatrix& result,
78  const Handle< GaugeState<P,Q> >& state,
79  int mu, int cb) const;
80 
81  //! Compute staple
82  void stapleSpatial(LatticeColorMatrix& result,
83  const Handle< GaugeState<P,Q> >& state,
84  int mu, int cb, int t_dir) const;
85 
86  //! Compute staple
87  void stapleTemporal(LatticeColorMatrix& result,
88  const Handle< GaugeState<P,Q> >& state,
89  int mu, int cb, int t_dir) const;
90 
91  //! Compute dS/dU
92  void deriv(multi1d<LatticeColorMatrix>& result,
93  const Handle< GaugeState<P,Q> >& state) const;
94 
95  //! compute spatial dS/dU given a time direction
96  void derivSpatial(multi1d<LatticeColorMatrix>& result,
97  const Handle< GaugeState<P,Q> >& state,
98  int t_dir) const;
99 
100  //! compute spatial dS/dU given a time direction
101  void derivTemporal(multi1d<LatticeColorMatrix>& result,
102  const Handle< GaugeState<P,Q> >& state,
103  int t_dir) const;
104 
105  //! Produce a gauge create state object
106  const CreateGaugeState<P,Q>& getCreateState() const {return *cgs;}
107 
108  //! Compute the actions
109  Double S(const Handle< GaugeState<P,Q> >& state) const;
110 
111  //! Compute the spatial part of the action given a time direction
112  Double spatialS(const Handle< GaugeState<P,Q> >& state, int t_dir) const;
113 
114  //! Compute the temporal part of the action given a time direction
115  Double temporalS(const Handle< GaugeState<P,Q> >& state, int t_dir) const;
116 
117  //! Destructor is automatic
119 
120  protected:
122  void operator=(const PlaqGaugeAct& a) {} //! Hide assignment
123 
124  //! Internal initializer for non-general input
125  void init(const Real& coeff,
126  const AnisoParam_t& aniso);
127 
128  //! Internal initializer for non-general input
129  void init(const Real& coeff_s,
130  const Real& coeff_t,
131  const AnisoParam_t& aniso);
132 
133  private:
134  Handle< CreateGaugeState<P,Q> > cgs; /*!< Create Gauge State */
135  PlaqGaugeActParams param; /*!< The parameters */
136  };
137 
138 }
139 
140 
141 #endif
Anisotropy parameters.
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
void init(const Real &coeff, const AnisoParam_t &aniso)
Hide assignment.
~PlaqGaugeAct()
Destructor is automatic.
PlaqGaugeAct(Handle< CreateGaugeState< P, Q > > cgs_, const Real &coeff, const AnisoParam_t &aniso)
General CreateGaugeState<P,Q>
Definition: plaq_gaugeact.h:54
void derivSpatial(multi1d< LatticeColorMatrix > &result, const Handle< GaugeState< P, Q > > &state, int t_dir) const
compute spatial dS/dU given a time direction
const Set & getSet() const
Return the set on which the gauge action is defined.
Definition: plaq_gaugeact.h:74
Handle< CreateGaugeState< P, Q > > cgs
void derivTemporal(multi1d< LatticeColorMatrix > &result, const Handle< GaugeState< P, Q > > &state, int t_dir) const
compute spatial dS/dU given a time direction
void staple(LatticeColorMatrix &result, const Handle< GaugeState< P, Q > > &state, int mu, int cb) const
Compute staple.
Double S(const Handle< GaugeState< P, Q > > &state) const
Compute the actions.
const CreateGaugeState< P, Q > & getCreateState() const
Produce a gauge create state object.
PlaqGaugeAct(Handle< CreateGaugeState< P, Q > > cgs_, const PlaqGaugeActParams &p)
Read coeff from a param struct.
Definition: plaq_gaugeact.h:68
Double spatialS(const Handle< GaugeState< P, Q > > &state, int t_dir) const
Compute the spatial part of the action given a time direction.
void deriv(multi1d< LatticeColorMatrix > &result, const Handle< GaugeState< P, Q > > &state) const
Compute dS/dU.
void stapleTemporal(LatticeColorMatrix &result, const Handle< GaugeState< P, Q > > &state, int mu, int cb, int t_dir) const
Compute staple.
PlaqGaugeAct(Handle< CreateGaugeState< P, Q > > cgs_, const Real &coeff_s, const Real &coeff_t, const AnisoParam_t &aniso)
General CreateGaugeState<P,Q>
Definition: plaq_gaugeact.h:61
void operator=(const PlaqGaugeAct &a)
PlaqGaugeActParams param
Double temporalS(const Handle< GaugeState< P, Q > > &state, int t_dir) const
Compute the temporal part of the action given a time direction.
void stapleSpatial(LatticeColorMatrix &result, const Handle< GaugeState< P, Q > > &state, int mu, int cb, int t_dir) const
Compute staple.
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.
const std::string name
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
Parameters for anisotropy.
Definition: aniso_io.h:24
Parameter structure.
Definition: plaq_gaugeact.h:26
PlaqGaugeActParams()
Base Constructor.
Definition: plaq_gaugeact.h:28