CHROMA
pg_gaugeact.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Parallelgram gauge action
4  */
5 
6 #ifndef __pg_gaugeact_h__
7 #define __pg_gaugeact_h__
8 
9 #include "gaugeact.h"
10 #include "gaugebc.h"
11 
12 namespace Chroma
13 {
14 
15  /*! @ingroup gaugeacts */
16  namespace PgGaugeActEnv
17  {
18  extern const std::string name;
19  bool registerAll();
20  }
21 
22  // Parameter structure
23  /*! @ingroup gaugeacts */
25  // Base Constructor
27 
28  // Read params from some root path
29  PgGaugeActParams(XMLReader& xml_in, const std::string& path);
30 
31  Real coeff;
32  };
33 
34  /*! @ingroup gaugeacts */
35  void read(XMLReader& xml, const std::string& path, PgGaugeActParams& param);
36 
37 
38  //! Parallelogram gauge action
39  /*! \ingroup gaugeacts
40  *
41  * The standard parallelogram gauge action
42  */
43 
45  {
46  public:
47  //! General CreateGaugeState
49  const Real& coeff_) :
50  cgs(cgs_), coeff(coeff_) {}
51 
52  //! Read coeff from a param struct
54  const PgGaugeActParams& p) :
55  cgs(cgs_), coeff(p.coeff) {}
56 
57  //! Is anisotropy used?
58  bool anisoP() const {return false;}
59 
60  //! Anisotropy factor
61  const Real anisoFactor() const {return Real(1);}
62 
63  //! Anisotropic direction
64  int tDir() const {return Nd-1;}
65 
66  //! Return the set on which the gauge action is defined
67  /*! Defined on the even-off (red/black) set */
68  const Set& getSet() const {return rb;}
69 
70  //! Compute staple
71  /*! Default version. Derived class should override this if needed. */
72  void staple(LatticeColorMatrix& result,
73  const Handle< GaugeState<P,Q> >& state,
74  int mu, int cb) const;
75 
76  //! Compute dS/dU
77  void deriv(multi1d<LatticeColorMatrix>& result,
78  const Handle< GaugeState<P,Q> >& state) const;
79 
80  //! Compute the actions
81  Double S(const Handle< GaugeState<P,Q> >& state) const;
82 
83  //! Produce a gauge create state object
84  const CreateGaugeState<P,Q>& getCreateState() const {return *cgs;}
85 
86  //! Destructor is automatic
88 
89  // Accessors -- non mutable members.
90  const Real getCoeff(void) const { return coeff; }
91 
92  protected:
93  //! Partial constructor
95  //! Hide assignment
96  void operator=(const PgGaugeAct& a) {}
97 
98  private:
99  Handle< CreateGaugeState<P,Q> > cgs; // create gauge state
100  Real coeff; // The coupling coefficient
101 
102  };
103 
104 }
105 
106 
107 #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
Parallelogram gauge action.
Definition: pg_gaugeact.h:45
PgGaugeAct()
Partial constructor.
Definition: pg_gaugeact.h:94
~PgGaugeAct()
Destructor is automatic.
Definition: pg_gaugeact.h:87
int tDir() const
Anisotropic direction.
Definition: pg_gaugeact.h:64
PgGaugeAct(Handle< CreateGaugeState< P, Q > > cgs_, const PgGaugeActParams &p)
Read coeff from a param struct.
Definition: pg_gaugeact.h:53
void staple(LatticeColorMatrix &result, const Handle< GaugeState< P, Q > > &state, int mu, int cb) const
Compute staple.
Definition: pg_gaugeact.cc:72
const Real getCoeff(void) const
Definition: pg_gaugeact.h:90
bool anisoP() const
Is anisotropy used?
Definition: pg_gaugeact.h:58
const Set & getSet() const
Return the set on which the gauge action is defined.
Definition: pg_gaugeact.h:68
void operator=(const PgGaugeAct &a)
Hide assignment.
Definition: pg_gaugeact.h:96
Handle< CreateGaugeState< P, Q > > cgs
Definition: pg_gaugeact.h:99
Double S(const Handle< GaugeState< P, Q > > &state) const
Compute the actions.
Definition: pg_gaugeact.cc:240
void deriv(multi1d< LatticeColorMatrix > &result, const Handle< GaugeState< P, Q > > &state) const
Compute dS/dU.
Definition: pg_gaugeact.cc:92
const Real anisoFactor() const
Anisotropy factor.
Definition: pg_gaugeact.h:61
const CreateGaugeState< P, Q > & getCreateState() const
Produce a gauge create state object.
Definition: pg_gaugeact.h:84
PgGaugeAct(Handle< CreateGaugeState< P, Q > > cgs_, const Real &coeff_)
General CreateGaugeState.
Definition: pg_gaugeact.h:48
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.
Nd
Definition: meslate.cc:74
bool registerAll()
Register all the factories.
Definition: pg_gaugeact.cc:29
const std::string name
Definition: pg_gaugeact.cc:23
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