CHROMA
monte.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Routine for doing the hybrid (monte carlo) algorithm.
3  */
4 
5 #error "Not tested (or even compiled). However, reasonably well converted."
6 
7 
8 #include "chromabase.h"
10 #include "meas/glue/mesplq.h"
11 #include "meas/glue/fuzglue.h"
12 #include "meas/glue/wilslp.h"
13 #include "meas/glue/topol.h"
14 #include "meas/smear/smear.h"
15 #include "meas/gfix/gfix.h"
16 
17 namespace Chroma {
18 
19 //! Routine for doing the hybrid (monte carlo) algorithm.
20 /*!
21  * \ingroup heatbath
22  *
23  *
24  * \param u gauge field ( Modify )
25  * \param NOver number of overrelaxations steps ( Read )
26  * \param NHeat number of heatbath trials ( Read )
27  *
28  * \param j_decay direction of exponential decay --- for sideways potl ! ( Read )
29  *
30  * \param GlueP flag for glueball measurements ( Read )
31  * \param WilsonP flag for Wilson loop measurements ( Read )
32  * \param TopolP flag for topology measurements ( Read )
33  * \param PrtMes measurements per printout to RESULT file
34  * \param MesItr number of iterations in mod for measurements ( Read )
35  * \param NumTry number of heatbath link trials performed ( Write )
36  * \param NumFail number of heatbath link trials failed ( Write )
37  * \param NumItr number of iterations to perform ( Read )
38  * \param TotalItr total number of iterations to perform ( Read )
39  * \param BlkMax maximum number of SU(3) trace maximimations allowed ( Read )
40  * \param BlkAccu blocking accuracy in glueball code ( Read )
41  * \param TopolItr number of iterations in mod for topology measurement ( Read )
42  * \param TopAccu accuracy for convergence of topological charge ( Read )
43  * \param ActAccu accuracy for convergence of action ratio ( Read )
44  * \param NumTop number of topological charge measurements ( Read )
45  * \param NumCool number of cooling sweeps per topological charge measurement ( Read )
46  * \param HQPotP flag for heavy quark potential measurements ( Read )
47  * \param HQPotItr number of iterations in mod for potential measurement ( Read )
48  * \param FacSmea smearing factor for potential measurement ( Read )
49  * \param NumSmea number of smearing iterations in potential measurement ( Read )
50  * \param GFixP flag for Landau gauge fixing ( Read )
51  * \param GFixItr number of iterations in mod for Landau gauge fixing ( Read )
52  * \param ORlxDo do over-relaxation in gauge fixing ( Read )
53  * \param OrPara over-relaxation parameter in gauge-fixing ( Read )
54  */
55 
56 void monte(multi1d<LatticeColorMatrix>& u(Nd), /* New gauge field cfg. */
57  int NOver, /* Number of overrelaxations steps */
58  int NHeat, /* Number of heatbath trials */
59  int j_decay, /* Direction to measure sideways potl */
60  /* global t_dir is used for everything else! */
61  int GlueP, /* Measure glueballs on-line? */
62  int WilsonP, /* Measure Wilson loops on-line? */
63  int& NumTry, /* Number of heatbath link trials for this run */
64  int& NumFail, /* Number of heatbath link failures for this run */
65  int PrtMes, /* Measurements per printout to RESULT file */
66  int MesItr, /* Iterations per measurement */
67  int NumItr, /* Number of iterations for this run */
68  int TotalItr, /* Total number of iterations */
69 
70  int TopolP, /* Measure topology on-line? */
71  int TopolItr, /* Iterations per topology measurement */
72  Real TopAccu, /* Topological charge measurement accuracy */
73  Real ActAccu, /* Action measurement accuracy */
74  int NumTop, /* Frequency of charge measurement */
75  int NumCool, /* Total number of cooling sweeps */
76 
77  Real BlkAccu, /* Accuracy of blocking in fuzglue. */
78  int BlkMax, /* Maximum number of proj. iterations in fuzglue. */
79 
80  int HQPotP, /* Measure potential on-line? */
81  int HQPotItr, /* Iterations per potential measurement */
82  Real FacSmea, /* Smearing factor */
83  int NumSmea, /* Number of smearing iterations */
84 
85  int GFixP, /* Fix to Landau gauge? */
86  int GFixItr, /* Iterations per Landau gauge fixing */
87  int ORlxDo, /* Do Over-relaxation in gauge fixing */
88  Real OrPara, /* Over-relaxation parameter in gauge-fixing */
89  )
90 {
91  /* Include any hooks in the start macro */
92  START_CODE(); /*# May include declarations and/or code. */
93 
94  multi1d<LatticeColorMatrix> u_tmp(Nd); /* temp. gauge field cfg. */
95  multi1d<LatticeColorMatrix> u_sm(Nd); /* smeared gauge field */
96 
97  multi1d<DComplex> pollp(Nd); /* Polyakov loop */
98  Double w_plaq; /* Whole plaquette */
99  Double s_plaq; /* Spatial plaquette */
100  Double t_plaq; /* Temporal (thermal) plaquette */
101  Double link; /* Trace of link (not gauge invariant) */
102 
103  int GFMax; /* Maximum number of gauge-fixing relaxations */
104  Real GFAccu; /* Gauge-fixing relaxation accuracy */
105  int nrl_gf;
106 
107  /* Start executable code */
108  NumTry = 0;
109  NumFail = 0;
110 
111  /* hardwire some gauge fixing parameters */
112  GFAccu = 1.0e()-6;
113  GFMax = 1000;
114 
115  /* Perform Monte Carlo algorithm and measurements, as requested */
116 
117  /* Do NumItr iterations of NOver overrelaxation steps followed by */
118  /* one heatbath step */
119  for(int n_loop = 1; n_loop <= NumItr; ++n_loop)
120  {
121  TotalItr = TotalItr + 1;
122  int ItrNumber = TotalItr; /* Want a different name here. */
123 
124  /* This is the very first namelist group printed in an iteration */
125  push(xml_out,"NewIteration");
126  write(xml_out, "ItrNumber", ItrNumber);
127  pop(xml_out);
128 
129  /* Perform a Monte Carlo iteration */
130 #if 1
131 #warning "NEED MORE GENERAL SET USAGE HERE"
132  mciter(u, NOver, NHeat, NumTry, NumFail, rb, neighsubl);
133 #endif
134 
135  /* Carry out measurements every MesItr iterations */
136  if ((TotalItr % MesItr) == 0 )
137  {
139 
140  /* Measure Polyakov loops */
141  for(int mu = 0; mu < Nd; ++mu)
142  polylp(u, pollp[mu], mu);
143 
144  push(xml_out,"obsvbl1");
145  write(xml_out, "TotalItr", TotalItr);
146  write(xml_out, "w_plaq", w_plaq);
147  write(xml_out, "s_plaq", s_plaq);
148  write(xml_out, "t_plaq", t_plaq);
149  write(xml_out, "link", link);
150  write(xml_out, "pollp", pollp);
151  pop(xml_out);
152  push(xml_out,"obsvbl2");
153  write(xml_out, "NumTry", NumTry);
154  write(xml_out, "NumFail", NumFail);
155  pop(xml_out);
156 
157  if ( GlueP == YES )
158  fuzglue (u, t_dir, BlkAccu, BlkMax);
159 
160  if ( WilsonP == YES )
161  wilslp (u, t_dir, 3);
162 
163  /* Print statistics every PrtMes measurements */
164  if ((TotalItr & MesItr*PrtMes) == 0)
165  {
166  FPRINTF(trm_out,"\n Heatbath acceptance =%14.7g\n",
167  TO_REAL(NumTry-NumFail)/TO_REAL(NumTry));
168 
169  } /* end of on-line statistics display */
170  } /* end of measurements */
171 
172  /* Calculate topological charge and the action/continuum instanton action ratio. */
173  if ((TotalItr & TopolItr) == 0)
174  {
175  /* Topology */
176  if( TopolP == YES )
177  {
178  u_tmp = u;
179  topol(u_tmp, TopAccu, ActAccu, NumCool, NumTop);
180  }
181  }
182 
183  /* Calculate topological charge and the action/continuum instanton action ratio. */
184  if ((TotalItr & HQPotItr) == 0)
185  {
186  if ( HQPotP ) /* First regular potl on iso or aniso lattices: */
187  {
188  u_sm = u;
189 
190  u_tmp[t_dir] = u_sm[t_dir];
191 
192  /* Smear the space-like links NumSmea times */
193  for(int i = 1; i <= NumSmea; ++i)
194  {
195  for(int mu = 0; mu < Nd; ++mu)
196  if( mu != t_dir )
197  smear(u_sm, u_tmp[mu], mu, 0, FacSmea, BlkAccu, BlkMax, t_dir);
198 
199  u_sm = u_tmp;
200  }
201 
202 
203  push(xml_out,"Smeared_Wilson_Loops");
204  write(xml_out, "NumSmea", NumSmea);
205  write(xml_out, "FacSmea", FacSmea);
206  write(xml_out, "t_dir", t_dir);
207  pop(xml_out);
208  wilslp (u_sm, t_dir, 6);
209 
210 
211  /* In ANISO case do sideways potl ONLY if j_decay != t_dir : */
212 
213  if( AnisoP == YES && j_decay != t_dir && j_decay < Nd )
214  {
215  u_sm = u;
216  u_tmp[j_decay] = u_sm[j_decay];
217 
218  /* Smear the space-like links NumSmea times */
219  for(int i = 1; i <= NumSmea; ++i)
220  {
221  for(int mu = 0; mu < Nd; ++mu)
222  if( mu != j_decay )
223  smear(u_sm, u_tmp[mu], mu, 0, FacSmea, BlkAccu, BlkMax, j_decay);
224  }
225  u_sm = u_tmp;
226 
227  push(xml_out,"Smeared_Wilson_Loops");
228  write(xml_out, "NumSmea", NumSmea);
229  write(xml_out, "FacSmea", FacSmea);
230  write(xml_out, "j_decay", j_decay);
231  pop(xml_out);
232  wilslp(u_sm, j_decay, 6);
233  } /* end of sideways potl */
234 
235  } /* closes HQPotP == YES */
236  }
237 
238  /* Fix to Landau gauge to measure Landau gauge link */
239  if ((TotalItr & GFixItr) == 0)
240  {
241  if( GFixP == YES )
242  {
243  u_tmp = u;
244  gfix(u_tmp, Nd, GFAccu, GFMax, nrl_gf, ORlxDo, OrPara);
245  }
246  }
247 
248  /* This is absolutely the last namelist group Printed in this trajectory */
249  push(xml_out,"EndIteration");
250  write(xml_out, "ItrNumber", ItrNumber);
251  pop(xml_out);
252  } /* end loop over iterations */
253 
254  /* Close out any other code */
255  END_CODE();
256 }
257 
258 } // end namespace Chroma
Primary include file for CHROMA library code.
int mu
Definition: cool.cc:24
Compute 'fuzzy' (blocked) glueball correlation functions.
Gauge fixing routines.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
void polylp(const multi1d< LatticeColorMatrixF3 > &u, DComplex &poly_loop, int mu)
Compute Polyakov loop.
Definition: polylp.cc:40
void wilslp(const multi1d< LatticeColorMatrix > &u, int j_decay, int t_dir, int kind, XMLWriter &xml, const std::string &xml_group)
Calculate Wilson loops.
Definition: wilslp.cc:32
void fuzglue(XMLWriter &xml_out, const std::string &xml_group, const multi1d< LatticeColorMatrix > &u, int j_decay, const Real &BlkAccu, int BlkMax)
Compute 'fuzzy' (blocked) glueball correlation functions.
Definition: fuzglue.cc:32
void mciter(multi1d< LatticeColorMatrix > &u, const LinearGaugeAction &S_g, const HBParams &hbp)
One heatbath interation of updating the gauge field configuration.
Definition: mciter.cc:30
void monte(multi1d< LatticeColorMatrix > &u(Nd), int NOver, int NHeat, int j_decay, int GlueP, int WilsonP, int &NumTry, int &NumFail, int PrtMes, int MesItr, int NumItr, int TotalItr, int TopolP, int TopolItr, Real TopAccu, Real ActAccu, int NumTop, int NumCool, Real BlkAccu, int BlkMax, int HQPotP, int HQPotItr, Real FacSmea, int NumSmea, int GFixP, int GFixItr, int ORlxDo, Real OrPara,)
Routine for doing the hybrid (monte carlo) algorithm.
Definition: monte.cc:56
One heatbath interation of updating the gauge field configuration.
int j_decay
Definition: meslate.cc:22
Nd
Definition: meslate.cc:74
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
static multi1d< LatticeColorMatrix > u
push(xml_out,"Condensates")
int i
Definition: pbg5p_w.cc:55
pop(xml_out)
void MesPlq(const multi1d< LatticeColorMatrixF3 > &u, multi2d< Double > &plane_plaq, Double &link)
Definition: mesplq.cc:83
START_CODE()
FloatingPoint< double > Double
Definition: gtest.h:7351
Double link
Definition: pade_trln_w.cc:146
Double t_plaq
Definition: pade_trln_w.cc:145
Double w_plaq
Definition: pade_trln_w.cc:143
Double s_plaq
Definition: pade_trln_w.cc:144
#define YES
Definition: primitives.h:84
Smearing routines.
Real TopAccu
Definition: topol.cc:12
int NumTop
Definition: topol.cc:15
Real ActAccu
Definition: topol.cc:13
int NumCool
Definition: topol.cc:14
Calculate Wilson loops.