CHROMA
rect_gaugeact.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Rectangle gauge action
4  */
5 
6 #ifndef __rect_gaugeact_h__
7 #define __rect_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 RectGaugeActEnv
18  {
19  extern const std::string name;
20  bool registerAll();
21 
22  extern double getTime();
23  }
24 
25  //! Parameter structure
26  /*! @ingroup gaugeacts */
28  // Base Constructor
30  no_temporal_2link=false;
31  }
32 
33  // Read params from some root path
34  RectGaugeActParams(XMLReader& xml_in, const std::string& path);
35 
36  Real coeff_s;
37  Real coeff_t1;
38  Real coeff_t2;
41  };
42 
43  /*! @ingroup gaugeacts */
44  void read(XMLReader& xml, const std::string& path, RectGaugeActParams& param);
45 
46 
47  //! Rect gauge action
48  /*! \ingroup gaugeacts
49  *
50  * The standard Rect gauge action
51  */
52 
54  {
55  public:
56  //! Backward compatibility:
58  const Real& coeff_);
59 
60 
61  //! General CreateGaugeState<P,Q>
63  const Real& coeff_s_,
64  const Real& coeff_t1_,
65  const Real& coeff_t2_,
66  const bool no_temporal_2link_,
67  const AnisoParam_t& aniso_);
68 
69  //! Read rectangle coefficient from a param struct
71  const RectGaugeActParams& p);
72 
73  //! Return the set on which the gauge action is defined
74  /*! Defined on the even-off (red/black) set */
75  const Set& getSet() const {return rb;}
76 
77  //! Compute staple
78  /*! Default version. Derived class should override this if needed. */
79  void staple(LatticeColorMatrix& result,
80  const Handle< GaugeState<P,Q> >& state,
81  int mu, int cb) const;
82 
83  //! Compute dS/dU
84  void deriv(multi1d<LatticeColorMatrix>& result,
85  const Handle< GaugeState<P,Q> >& state) const;
86 
87  //! compute spatial dS/dU given a time direction
88  void derivSpatial(multi1d<LatticeColorMatrix>& result,
89  const Handle< GaugeState<P,Q> >& state) const;
90 
91 
92 
93 
94  //! compute spatial dS/dU given a time direction
95  // No t_dir param is needed as it is hidden in the params
96  void derivTemporal(multi1d<LatticeColorMatrix>& result,
97  const Handle< GaugeState<P,Q> >& state) const;
98 
99 
100 
101 
102  //! Compute the actions
103  Double S(const Handle< GaugeState<P,Q> >& state) const;
104 
105  //! Compute the spatial part of the action given a time direction
106  Double spatialS(const Handle< GaugeState<P,Q> >& state) const;
107 
108  //! Compute the temporal part of the action given a time direction
109  Double temporalS(const Handle< GaugeState<P,Q> >& state) const;
110 
111  //! Produce a gauge create state object
112  const CreateGaugeState<P,Q>& getCreateState() const {return *cgs;}
113 
114  //! Destructor is automatic
116 
117  // Accessors -- non mutable members.
118  const Real getCoeffS(void) const { return params.coeff_s; }
119  const Real getCoeffT1(void) const { return params.coeff_t1; }
120  const Real getCoeffT2(void) const { return params.coeff_t2; }
121 
122  //! Is anisotropy used?
123  bool anisoP() const {return params.aniso.anisoP ;}
124 
125  //! Anisotropy factor
126  const Real anisoFactor() const { return params.aniso.xi_0; }
127 
128  //! Anisotropic direction
129  int tDir() const {return params.aniso.t_dir;}
130  bool noTemporal21LoopsP(void) const {return params.no_temporal_2link;}
131 
132  protected:
133  //! Partial construcor
135  //! Hide assignment
136  void operator=(const RectGaugeAct& a) {}
137 
138  private:
139  Handle< CreateGaugeState<P,Q> > cgs; // Create gauge state
140  RectGaugeActParams params; // THe parameter struct
141 
142  // A function for computing the contribution from one rectangle
143  // in the mu/nu plane specified.
144  void deriv_part(int mu, int nu, Real c_munu,
145  multi1d<LatticeColorMatrix>& ds_u,
146  const multi1d<LatticeColorMatrix>& u) const;
147 
148  // A function for computing the contribution to the action from
149  // one rectangle int he mu,nu plane specified
150  void S_part(int mu, int nu, Real c, LatticeReal& lgimp,
151  const multi1d<LatticeColorMatrix>& u) const;
152 
153  };
154 
155 }
156 
157 
158 #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
Rect gauge action.
Definition: rect_gaugeact.h:54
bool anisoP() const
Is anisotropy used?
void derivSpatial(multi1d< LatticeColorMatrix > &result, const Handle< GaugeState< P, Q > > &state) const
compute spatial dS/dU given a time direction
RectGaugeAct()
Partial construcor.
Double temporalS(const Handle< GaugeState< P, Q > > &state) const
Compute the temporal part of the action given a time direction.
void deriv_part(int mu, int nu, Real c_munu, multi1d< LatticeColorMatrix > &ds_u, const multi1d< LatticeColorMatrix > &u) const
const CreateGaugeState< P, Q > & getCreateState() const
Produce a gauge create state object.
void operator=(const RectGaugeAct &a)
Hide assignment.
RectGaugeActParams params
bool noTemporal21LoopsP(void) const
~RectGaugeAct()
Destructor is automatic.
void derivTemporal(multi1d< LatticeColorMatrix > &result, const Handle< GaugeState< P, Q > > &state) const
compute spatial dS/dU given a time direction
const Real getCoeffT1(void) const
Double spatialS(const Handle< GaugeState< P, Q > > &state) 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.
const Real getCoeffT2(void) const
int tDir() const
Anisotropic direction.
Double S(const Handle< GaugeState< P, Q > > &state) const
Compute the actions.
const Real anisoFactor() const
Anisotropy factor.
void S_part(int mu, int nu, Real c, LatticeReal &lgimp, const multi1d< LatticeColorMatrix > &u) const
const Real getCoeffS(void) const
const Set & getSet() const
Return the set on which the gauge action is defined.
Definition: rect_gaugeact.h:75
Handle< CreateGaugeState< P, Q > > cgs
void staple(LatticeColorMatrix &result, const Handle< GaugeState< P, Q > > &state, int mu, int cb) const
Compute staple.
int mu
Definition: cool.cc:24
int nu
Definition: cool.cc:25
Class structure for gauge actions.
Gauge boundary conditions.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams &param)
Read parameters.
bool registerAll()
Register all the factories.
const std::string name
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
static multi1d< LatticeColorMatrix > u
Double c
Definition: invbicg.cc:108
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: rect_gaugeact.h:27