CHROMA
constrained_plaq_gaugeact.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Constrained plaquette gauge action
4  *
5  * Implements:
6  * w = Re(1 - (1/Nc)*Tr(U_p))
7  *
8  * S = beta*w + gamma*w^q
9  */
10 
11 #ifndef __constrained_plaq_gaugeact_h__
12 #define __constrained_plaq_gaugeact_h__
13 
14 #include "gaugeact.h"
15 #include "gaugebc.h"
16 
17 namespace Chroma
18 {
19 
20  /*! @ingroup gaugeacts */
21  namespace ConstrainedPlaqGaugeActEnv
22  {
23  bool registerAll();
24 
25  //! Parameter structure
26  /*! @ingroup gaugeacts */
27  struct Params
28  {
29  //! Base Constructor
30  Params() {}
31 
32  //! Read params from some root path
33  Params(XMLReader& xml_in, const std::string& path);
34 
35  Real beta; // Coupling for fundamental plaquette
36  Real gamma; // Coupling for plaquette power
37  Real q; // The power
38  };
39 
40 
41  //! Constrained laquette gauge action
42  /*! \ingroup gaugeacts
43  *
44  * The standard Constrained gauge action
45  */
46  class GaugeAct : public LinearGaugeAction
47  {
48  public:
49  // Typedefs to save typing
50  typedef multi1d<LatticeColorMatrix> P;
51  typedef multi1d<LatticeColorMatrix> Q;
52 
53  //! General CreateGaugeState<P,Q>
54  //! Read coeff from a param struct
56  cgs(cgs_), param(p) {}
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  //! Compute dS/dU
69  void deriv(multi1d<LatticeColorMatrix>& result,
70  const Handle< GaugeState<P,Q> >& state) const;
71 
72  //! Compute the actions
73  Double S(const Handle< GaugeState<P,Q> >& state) const;
74 
75  //! Produce a gauge create state object
76  const CreateGaugeState<P,Q>& getCreateState() const {return *cgs;}
77 
78  //! Destructor is automatic
79  ~GaugeAct() {}
80 
81  protected:
82  //! Hide assignment
83  void operator=(const GaugeAct& a) {}
84 
85  //! Compute the site-level action
86  void siteAction(multi2d<LatticeReal>& site_act, const Handle< GaugeState<P,Q> >& state) const;
87 
88  //! Compute dS/dU
89  void derivPlaqFun(multi1d<LatticeColorMatrix>& ds_u,
90  const Handle< GaugeState<P,Q> >& state) const;
91 
92  //! Compute dS/dU
93  void derivPlaqTwo(multi1d<LatticeColorMatrix>& ds_u,
94  const Handle< GaugeState<P,Q> >& state) const;
95 
96  private:
97  Handle< CreateGaugeState<P,Q> > cgs; /*!< Create Gauge State */
98  Params param; /*!< The parameters */
99  };
100 
101  }
102 
103 }
104 
105 
106 #endif
void derivPlaqTwo(multi1d< LatticeColorMatrix > &ds_u, 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.
void derivPlaqFun(multi1d< LatticeColorMatrix > &ds_u, const Handle< GaugeState< P, Q > > &state) const
Compute dS/dU.
const CreateGaugeState< P, Q > & getCreateState() const
Produce a gauge create state object.
void siteAction(multi2d< LatticeReal > &site_act, const Handle< GaugeState< P, Q > > &state) const
Compute the site-level action.
void deriv(multi1d< LatticeColorMatrix > &result, const Handle< GaugeState< P, Q > > &state) const
Compute dS/dU.
GaugeAct(Handle< CreateGaugeState< P, Q > > cgs_, const Params &p)
Double S(const Handle< GaugeState< P, Q > > &state) const
Compute the actions.
const Set & getSet() const
Return the set on which the gauge action is defined.
void operator=(const GaugeAct &a)
Hide assignment.
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
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