CHROMA
plaq_plus_adj_power_gaugeact.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Plaquette plus a power of an adjoint gauge action
4  *
5  * Implements:
6  * S = beta*Re(1 - (1/Nc)*Tr(U_p)) + gamma*Re((1 - (1/Nc^2)*Tr(U_p^dag)*Tr(U_p))^(q/2))
7  */
8 
9 #ifndef __plaq_plus_adj_power_gaugeact_h__
10 #define __plaq_plus_adj_power_gaugeact_h__
11 
12 #include "gaugeact.h"
13 #include "gaugebc.h"
14 
15 namespace Chroma
16 {
17 
18  /*! @ingroup gaugeacts */
19  namespace PlaqPlusAdjPowerGaugeActEnv
20  {
21  bool registerAll();
22 
23  //! Parameter structure
24  /*! @ingroup gaugeacts */
25  struct Params
26  {
27  //! Base Constructor
28  Params() {}
29 
30  //! Read params from some root path
31  Params(XMLReader& xml_in, const std::string& path);
32 
33  Real beta; // Coupling for fundamental plaquette
34  Real gamma; // Coupling for adjoint power
35  int q; // Power of plaquette
36  };
37 
38 
39  //! PlaqPlusAdjPower gauge action
40  /*! \ingroup gaugeacts
41  *
42  * The standard gauge action as sum of PlaqPlusAdjPowers
43  */
44  class GaugeAct : public LinearGaugeAction
45  {
46  public:
47  // Typedefs to save typing
48  typedef multi1d<LatticeColorMatrix> P;
49  typedef multi1d<LatticeColorMatrix> Q;
50 
51  //! General CreateGaugeState<P,Q>
52  //! Read coeff from a param struct
54  cgs(cgs_), param(p) {}
55 
56  //! Return the set on which the gauge action is defined
57  /*! Defined on the even-off (red/black) set */
58  const Set& getSet() const {return rb;}
59 
60  //! Compute staple
61  /*! Default version. Derived class should override this if needed. */
62  void staple(LatticeColorMatrix& result,
63  const Handle< GaugeState<P,Q> >& state,
64  int mu, int cb) const;
65 
66  //! Compute dS/dU
67  void deriv(multi1d<LatticeColorMatrix>& result,
68  const Handle< GaugeState<P,Q> >& state) const;
69 
70  //! Compute the actions
71  Double S(const Handle< GaugeState<P,Q> >& state) const;
72 
73  //! Produce a gauge create state object
74  const CreateGaugeState<P,Q>& getCreateState() const {return *cgs;}
75 
76  //! Destructor is automatic
77  ~GaugeAct() {}
78 
79  protected:
80  //! Hide assignment
81  void operator=(const GaugeAct& a) {}
82 
83  //! Compute the site-level action
84  void siteAction(multi2d<LatticeComplex>& site_act,
85  const Handle< GaugeState<P,Q> >& state) const;
86 
87  private:
88  Handle< CreateGaugeState<P,Q> > cgs; /*!< Create Gauge State */
89  Params param; /*!< The parameters */
90  };
91 
92  }
93 
94 }
95 
96 
97 #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.
void siteAction(multi2d< LatticeComplex > &site_act, const Handle< GaugeState< P, Q > > &state) const
Compute the site-level action.
const CreateGaugeState< P, Q > & getCreateState() const
Produce a gauge create state object.
GaugeAct(Handle< CreateGaugeState< P, Q > > cgs_, const Params &p)
void staple(LatticeColorMatrix &result, const Handle< GaugeState< P, Q > > &state, int mu, int cb) const
Compute staple.
void operator=(const GaugeAct &a)
Hide assignment.
void deriv(multi1d< LatticeColorMatrix > &result, const Handle< GaugeState< P, Q > > &state) const
Compute dS/dU.
Double S(const Handle< GaugeState< P, Q > > &state) const
Compute the actions.
int mu
Definition: cool.cc:24
Class structure for gauge actions.
Gauge boundary conditions.
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