CHROMA
aniso_sym_temporal_gaugeact.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Temporal part of Anisotropic Tree leve LW gauge action
3  */
4 
5 #include "chromabase.h"
9 
11 namespace Chroma
12 {
13 
14  namespace AnisoSymTemporalGaugeActEnv
15  {
17  multi1d<LatticeColorMatrix> >* createGaugeAct(XMLReader& xml,
18  const std::string& path)
19  {
21  AnisoSymGaugeActParams(xml, path));
22  }
23 
24  const std::string name = "ANISO_SYM_TEMPORAL_GAUGEACT";
25 
26  //! Local registration flag
27  static bool registered = false;
28 
29  //! Register all the factories
30  bool registerAll()
31  {
32  bool success = true;
33  if (! registered)
34  {
35  success &= TheGaugeActFactory::Instance().registerObject(name, createGaugeAct);
36  registered = true;
37  }
38  return success;
39  }
40 
41  }
42 
43 
44  //! Compute action due to temporal \mu x 2\nu rectangles and plaquettes
46  {
47  START_CODE();
48 
49  const multi1d<LatticeColorMatrix>& u_bc = state->getLinks();
50 
51  LatticeReal lgimp = zero;
52 
53  int mu;
54  int nu;
55 
56  // length 1 in the t_dir (nu = t_dir)
57  nu = param.aniso.t_dir;
58  for(mu=0; mu < Nd; mu++) {
59  if( mu != nu ) {
61  nu,
63  plaq_c_t,
64  rect_c_t_2,
65  true,
66  lgimp,
67  u_bc);
68  }
69  }
70 
71  // length 2 in the t_dir (mu = t_dir)
72  // No rectangle contribution but still some plaquette
73  // It is OK to conitnue to accumulate into lgimp
74  // At this point the unwanted rectangles will be skipped
75  mu = param.aniso.t_dir;
76  for(int nu=0; nu < Nd; nu++) {
77  if( mu != nu ) {
79  nu,
81  plaq_c_t,
82  rect_c_t_2,
83  true,
84  lgimp,
85  u_bc);
86  }
87  }
88 
89 
90  // If user gave a zero point energy, subtract it off
91  if( param.use_subtraction ) {
92  LatticeReal ff;
93  ff = param.sub_zero;
94  lgimp -= ff;
95  }
96 
97  Double ret_val = sum(lgimp);
98 
99  // Multiply in normalisation
100  ret_val *= -Double(1)/Double(Nc);
101 
102  END_CODE();
103 
104  return ret_val;
105  }
106 
107  //! Compute dS/dU
108  void AnisoSymTemporalGaugeAct::deriv(multi1d<LatticeColorMatrix>& result,
109  const Handle< GaugeState<P,Q> >& state) const
110  {
111  START_CODE();
112 
113  result.resize(Nd);
114  int mu;
115  int nu;
116 
117  multi1d<LatticeColorMatrix> ds_tmp(Nd);
118 
119 
120  const multi1d<LatticeColorMatrix>& u_bc = state->getLinks();
121 
122  for(mu=0; mu < Nd; mu++) {
123  result[mu] =zero;
124  ds_tmp[mu]= zero;
125  }
126 
127  // length 1 in the t_dir (nu = t_dir)
128  // Accumulate into ds_tmp
129  nu = param.aniso.t_dir;
130  for(mu=0; mu < Nd; mu++) {
131  if( mu != nu ) {
133  nu,
134  param.aniso.t_dir,
135  plaq_c_t,
136  rect_c_t_2,
137  true,
138  ds_tmp,
139  u_bc);
140 
141  }
142  }
143 
144 
145  // length 2 in the t_dir (mu = t_dir)
146  // Accumulate into ds_tmp
147 
148  mu = param.aniso.t_dir;
149  for(int nu=0; nu < Nd; nu++) {
150  if( mu != nu ) {
152  nu,
153  param.aniso.t_dir,
154  plaq_c_t,
155  rect_c_t_2,
156  true,
157  ds_tmp,
158  u_bc);
159 
160  }
161  }
162 
163  // Close up the loops
164  for(int mu=0; mu < Nd; mu++) {
165  result[mu] = u_bc[mu]*ds_tmp[mu];
166  }
167 
168  // Apply BCs
169  getGaugeBC().zero(result);
170 
171  END_CODE();
172 
173  }
174 
175  // Private initializer
176  void
178  {
179  START_CODE();
180 
181  // Do the plaquette first. Spatial and temporal coeffs
182  // anisotropy multiplied in in the terms constructor
183 
184  // Various tadpole things
185  // spatial powers
186  Real u_s_2 = param.u_s * param.u_s;
187  Real u_s_4 = u_s_2 * u_s_2;
188 
189  // temporal powers
190  Real u_t_2 = param.u_t * param.u_t;
191 
192  // Parameter needed for gauge act, but should never be used
193  plaq_c_t = param.beta * Real(4) / ( Real(3) * u_s_2 * u_t_2 );
194 
195  // Loops that are short in the time direction
196  // Param needed for rect_gaugeact driver, but never used
197  rect_c_t_2 = - param.beta / ( Real(12)*u_s_4*u_t_2);
198 
199  // Fold in aniso factors
200  if( param.aniso.anisoP ) {
203  }
204 
205  QDPIO::cout << "Real(Nc)*(u_s_2*u_t_2+u_s_4*u_t_2)="<<Real(Nc)*( Real(3)*u_s_2*u_t_2/Real(4)-Real(12)*u_s_4*u_t_2)/param.beta << std::endl;
206  END_CODE();
207  }
208 
209 }
210 
Temporal Part of Tree Level LW gauge action.
Primary include file for CHROMA library code.
Temporal anisotropic Symanzik improved gauge action.
void deriv(multi1d< LatticeColorMatrix > &result, const Handle< GaugeState< P, Q > > &state) const
Compute dS/dU.
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
bool use_subtraction
Whether to use subtraction trick.
Real sub_zero
Arbitrary constant (zero point energy)
Real u_t
Temporal Tadpole coupling.
Real u_s
Spatial Tadpole coupling.