CHROMA
aniso_spectrum_gaugeact.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Anisotropic gaugeact useful for spectrum from hep-lat/9911003
4  *
5  * Tree-level LW with tapole improvement, missing 1x2 in time, also including
6  * 2-plaq term. Taken from Morningstar-Peardon, hep-lat/9911003
7  */
8 
9 #ifndef __aniso_spectrum_gaugeact_h__
10 #define __aniso_spectrum_gaugeact_h__
11 
12 #include "gaugeact.h"
13 #include "gaugebc.h"
14 // #include "actions/gauge/gaugeacts/plaq_gaugeact.h"
17 
18 
19 namespace Chroma
20 {
21 
22  /*! @ingroup gaugeacts */
23  namespace AnisoSpectrumGaugeActEnv
24  {
25  extern const std::string name;
26  bool registerAll();
27  }
28 
29  //! Parameter structure
30  /*! @ingroup gaugeacts */
32  {
33  // Base Constructor
35 
36  // Read params from some root path
37  AnisoSpectrumGaugeActParams(XMLReader& xml_in, const std::string& path);
38 
39  Real beta;
40  Real u_s;
41  Real u_t;
42  Real omega;
44  };
45 
46  /*! @ingroup gaugeacts */
47  void read(XMLReader& xml, const std::string& path, AnisoSpectrumGaugeActParams& param);
48 
49  /*! @ingroup gaugeacts */
50  void write(XMLWriter& xml, const std::string& path, const AnisoSpectrumGaugeActParams& param);
51 
52 
53  //! MP gauge action
54  /*! \ingroup gaugeacts
55  *
56  * Anisotropic gaugeact useful for spectrum from hep-lat/9911003
57  *
58  * Tree-level LW with tapole improvement, missing 1x2 in time, also including
59  * 2-plaq term. Taken from Morningstar-Peardon, hep-lat/9911003
60  */
61 
63  {
64  public:
65  // Typedefs to save typing
66  typedef multi1d<LatticeColorMatrix> P;
67  typedef multi1d<LatticeColorMatrix> Q;
68 
69  //! Read beta from a param struct
72  param(p) {init(cgs_);}
73 
74  //! Is anisotropy used?
75  bool anisoP() const {return param.aniso.anisoP; }
76 
77  //! Anisotropy factor
78  const Real anisoFactor() const {return param.aniso.xi_0;}
79 
80  //! Anisotropic direction
81  int tDir() const {return param.aniso.t_dir;}
82 
83  //! Return the set on which the gauge action is defined
84  /*! Defined on the even-off (red/black) set */
85  const Set& getSet() const {return rb;}
86 
87  //! Compute staple
88  /*! Default version. Derived class should override this if needed. */
89  void staple(LatticeColorMatrix& result,
90  const Handle< GaugeState<P,Q> >& state,
91  int mu, int cb) const
92  {
93  // plaq->staple(result,state,mu,cb);
94  plaq_plus_two_plaq->staple(result,state,mu,cb); // This will fail I think
95  LatticeColorMatrix tmp;
96  rect->staple(tmp,state,mu,cb); // This may fail I think in aniso mode
97  result += tmp;
98  }
99 
100  //! Compute dS/dU
101  void deriv(multi1d<LatticeColorMatrix>& result,
102  const Handle< GaugeState<P,Q> >& state) const
103  {
104  // plaq->deriv(result,state);
105  plaq_plus_two_plaq->deriv(result,state);
106 
107  multi1d<LatticeColorMatrix> tmp;
108  rect->deriv(tmp,state);
109  result += tmp;
110 
111 
112 
113  }
114 
115  //! Compute the actions
117  {
118  //return plaq->S(state) + rect->S(state) + two_plaq->S(state);
119  return plaq_plus_two_plaq->S(state) + rect->S(state);
120 
121  }
122 
123  //! Produce a gauge create state object
124  const CreateGaugeState<P,Q>& getCreateState() const {return plaq_plus_two_plaq->getCreateState();}
125 
126  //! Destructor is automatic
128 
129  // Accessors -- non mutable members.
130  const Real getBeta(void) const { return param.beta; }
131 
132  const Real getUS(void) const { return param.u_s; }
133 
134  const Real getUT(void) const { return param.u_t; }
135 
136  const Real getOmega(void) const { return param.omega; }
137 
138 
139  protected:
140  //! Private initializer
141  void init(Handle< CreateGaugeState<P,Q> > cgs);
142 
143  //! Hide assignment
145 
146  private:
147  AnisoSpectrumGaugeActParams param; /*!< The couplings and anisotropy*/
148  // Handle<PlaqGaugeAct> plaq; /*!< Hold a plaquette gaugeact */
149  Handle<RectGaugeAct> rect; /*!< Hold a rectangle gaugeact */
150  Handle<PlaqPlusSpatialTwoPlaqGaugeAct> plaq_plus_two_plaq; /*!< Hold spatial plaquettes separated in time type gaugeact */
151  };
152 
153 }
154 
155 
156 #endif
void staple(LatticeColorMatrix &result, const Handle< GaugeState< P, Q > > &state, int mu, int cb) const
Compute staple.
multi1d< LatticeColorMatrix > Q
void operator=(const AnisoSpectrumGaugeAct &a)
Hide assignment.
AnisoSpectrumGaugeAct(Handle< CreateGaugeState< P, Q > > cgs_, const AnisoSpectrumGaugeActParams &p)
Read beta from a param struct.
Handle< PlaqPlusSpatialTwoPlaqGaugeAct > plaq_plus_two_plaq
~AnisoSpectrumGaugeAct()
Destructor is automatic.
void init(Handle< CreateGaugeState< P, Q > > cgs)
Private initializer.
void deriv(multi1d< LatticeColorMatrix > &result, const Handle< GaugeState< P, Q > > &state) const
Compute dS/dU.
bool anisoP() const
Is anisotropy used?
multi1d< LatticeColorMatrix > P
AnisoSpectrumGaugeActParams param
const Real anisoFactor() const
Anisotropy factor.
const Set & getSet() const
Return the set on which the gauge action is defined.
int tDir() const
Anisotropic direction.
const CreateGaugeState< P, Q > & getCreateState() const
Produce a gauge create state object.
Double S(const Handle< GaugeState< P, Q > > &state) const
Compute the actions.
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.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams &param)
Read parameters.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
LatticeFermion tmp
Definition: mespbg5p_w.cc:36
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
Rectangle gauge action.
Parameters for anisotropy.
Definition: aniso_io.h:24