CHROMA
aniso_sym_spatial_gaugeact.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Anisotropic gaugeact useful for spectrum from hep-lat/9911003
3  *
4  * Tree-level LW with tapole improvement, missing 1x2 in time, also including
5  * 2-plaq term. Taken from Morningstar-Peardon, hep-lat/9911003
6  */
7 
8 #include "chromabase.h"
13 
14 #include <cstdio>
15 
16 namespace Chroma
17 {
18 
19  namespace AnisoSymSpatialGaugeActEnv
20  {
22  multi1d<LatticeColorMatrix> >* createGaugeAct(XMLReader& xml,
23  const std::string& path)
24  {
27  }
28 
29  const std::string name = "ANISO_SYM_SPATIAL_GAUGEACT";
30 
31  //! Local registration flag
32  static bool registered = false;
33 
34  //! Register all the factories
35  bool registerAll()
36  {
37  bool success = true;
38  if (! registered)
39  {
40  success &= TheGaugeActFactory::Instance().registerObject(name, createGaugeAct);
41  registered = true;
42  }
43  return success;
44  }
45 
46  }
47 
49  {
50  START_CODE();
51 
52  LatticeReal lgimp=zero;
53  const multi1d<LatticeColorMatrix>& u_bc = state->getLinks();
54 
55 
56  for(int mu = 0; mu < Nd; mu++) {
57  for(int nu = 0 ; nu < Nd; nu++) {
58  if ( ( mu != nu ) && (mu != param.aniso.t_dir)
59  && ( nu != param.aniso.t_dir ) ) {
60 
62  nu,
64  plaq_c_s,
65  rect_c_s,
66  true,
67  lgimp,
68  u_bc);
69 
70  }
71  }
72  }
73 
74  // If user gave a zero point energy, subtract it off
75  if( param.use_subtraction ) {
76  LatticeReal ff;
77  ff = param.sub_zero;
78  lgimp -= ff;
79  }
80 
81  // Sum action and normalize out.
82  Double ret_val = sum(lgimp);
83  ret_val *= -Double(1)/Double(Nc);
84 
85  END_CODE();
86 
87  return ret_val;
88  }
89 
90 
91  //! Compute dS/dU
92  void AnisoSymSpatialGaugeAct::deriv(multi1d<LatticeColorMatrix>& result,
93  const Handle< GaugeState<P,Q> >& state) const
94  {
95  START_CODE();
96 
97  const multi1d<LatticeColorMatrix>& u_bc = state->getLinks();
98  multi1d<LatticeColorMatrix> ds_tmp(Nd);
99  result.resize(Nd);
100  for(int mu =0; mu < Nd; mu++) {
101  result[mu] = zero;
102  ds_tmp[mu] = zero;
103  }
104 
105 
106 
107 
108  for(int mu = 0; mu < Nd; mu++) {
109  for(int nu = 0 ; nu < Nd; nu++) {
110 
111  // mu and nu both have to be spatial and not equal to each other
112  // It is OK to accumulate into ds_tmp
113  if( ( mu != nu ) && (mu != param.aniso.t_dir)
114  && (nu != param.aniso.t_dir ) ) {
115 
116 
118  nu,
119  param.aniso.t_dir,
120  plaq_c_s,
121  rect_c_s,
122  true,
123  ds_tmp,
124  u_bc);
125 
126 
127 
128  }
129  }
130  }
131 
132  // Close loops
133  for(int mu=0 ; mu < Nd; mu++) {
134  result[mu] = u_bc[mu]*ds_tmp[mu];
135  }
136 
137  // Apply boundaries
138  getGaugeBC().zero(result);
139  END_CODE();
140 
141  }
142 
143  // Private initializer
144  void
146  {
147  START_CODE();
148 
149  // Do the plaquette first. Spatial and temporal coeffs
150  // anisotropy multiplied in in the terms constructor
151 
152  // Various tadpole things
153  // spatial powers
154  Real u_s_2 = param.u_s * param.u_s;
155  Real u_s_4 = u_s_2 * u_s_2;
156  Real u_s_6 = u_s_4 * u_s_2;
157 
158  // Compute coefficient of spatial plaquettes and rectangles
159  plaq_c_s = param.beta * Real(5)/( Real(3)* u_s_4 );
160  rect_c_s = - param.beta / ( Real(12)*u_s_6 );
161 
162  // Now take care of anisotropy
163  if ( param.aniso.anisoP == true ) {
166  }
167 
168  END_CODE();
169  }
170 
171 }
172 
Spatial part of Tree level LW action.
Primary include file for CHROMA library code.
Spatial anisotropic Symanzik improved gauge action.
void init(void)
Private initializer.
void deriv(multi1d< LatticeColorMatrix > &result, const Handle< GaugeState< P, Q > > &state) const
Compute dS/dU.
AnisoSymSpatialGaugeActParams param
Double S(const Handle< GaugeState< P, Q > > &state) const
Compute the actions.
Abstract base class for gauge actions.
Definition: gaugeact.h:25
virtual const GaugeBC< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > & getGaugeBC() const
Return the gauge BC object for this action.
Definition: gaugeact.h:46
virtual void zero(P &ds_u) const =0
Zero some gauge-like field in place on the masked links.
Support class for fermion actions and linear operators.
Definition: state.h:74
Class for counted reference semantics.
Definition: handle.h:33
static T & Instance()
Definition: singleton.h:432
int mu
Definition: cool.cc:24
int nu
Definition: cool.cc:25
All gauge create-state method.
Fermion action factories.
Nd
Definition: meslate.cc:74
GaugeAction< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createGaugeAct(XMLReader &xml, const std::string &path)
bool registerAll()
Register all the factories.
static bool registered
Local registration flag.
void deriv_part(const int mu, const int nu, const int t_dir, const Real &c_plaq_munu, const Real &c_rect_munu, const bool noTemporal2Link, multi1d< LatticeColorMatrix > &ds_u, const multi1d< LatticeColorMatrix > &u)
void S_part(int mu, int nu, int t_dir, Real c_plaq_munu, Real c_rect_munu, bool noTemporal2Link, LatticeReal &lgimp, const multi1d< LatticeColorMatrix > &u)
Handle< CreateGaugeState< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > reader(XMLReader &xml_in, const std::string &path)
Helper function for the CreateGaugeState readers.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
START_CODE()
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
Definition: pbg5p_w.cc:28
Double zero
Definition: invbicg.cc:106
FloatingPoint< double > Double
Definition: gtest.h:7351
::std::string string
Definition: gtest.h:1979
Double sum
Definition: qtopcor.cc:37
Real sub_zero
Arbitrary constant (zero point energy)
AnisoParam_t aniso
The anisotropy parameters.
bool use_subtraction
Whether to use subtraction trick.