CHROMA
t_propagator_fuzz_baryon_s.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Main code for propagator generation
3  *
4  * Start to add fuzzed source to the staggered
5  * project.
6  */
7 
8 #include <iostream>
9 #include <cstdio>
10 
11 #define MAIN
12 
13 // Include everything...
14 #include "chroma.h"
15 
16 // more work -- this should be in chroma.h
17 #include "meas/smear/fuzz_smear.h"
18 
19 /*
20  * Here we have various temporary definitions
21  */
22 /*
23 
24 
25 enum FermType {
26 FERM_TYPE_STAGGERED,
27 FERM_TYPE_UNKNOWN
28 };
29 
30 
31 using namespace Chroma;
32 
33 
34 /*
35 * Input
36 */
37 
38 
39 // Parameters which must be determined from the XML input
40 // and written to the XML output
41 struct Param_t
42 {
44  Real Mass; // Staggered mass
45  Real u0; // Tadpole Factor
46 
47  PropType prop_type; // storage order for stored propagator
48 
50 
51  Real GFAccu, OrPara; // Gauge fixing tolerance and over-relaxation param
52  int GFMax; // Maximum gauge fixing iterations
53 
54  multi1d<int> nrow;
55  multi1d<int> boundary;
56  multi1d<int> t_srce;
57 };
58 
59 
60 struct Prop_t
61 {
64 };
65 
66 struct Propagator_input_t
67 {
69  Param_t param;
70  Cfg_t cfg;
71  Prop_t prop;
72 };
73 
74 
75 //
76 void read(XMLReader& xml, const std::string& path, Prop_t& input)
77 {
78  XMLReader inputtop(xml, path);
79 
80 // read(inputtop, "source_file", input.source_file);
81  read(inputtop, "prop_file", input.prop_file);
82 }
83 
84 
85 
86 // Reader for input parameters
87 void read(XMLReader& xml, const std::string& path, Propagator_input_t& input)
88 {
89  XMLReader inputtop(xml, path);
90 
91 
92  // First, read the input parameter version. Then, if this version
93  // includes 'Nc' and 'Nd', verify they agree with values compiled
94  // into QDP++
95 
96  // Read in the IO_version
97  try
98  {
99  read(inputtop, "IO_version/version", input.io_version.version);
100  }
101  catch (const std::string& e)
102  {
103  QDPIO::cerr << "Error reading data: " << e << std::endl;
104  throw;
105  }
106 
107 
108  // Currently, in the supported IO versions, there is only a small difference
109  // in the inputs. So, to make code simpler, extract the common bits
110 
111  // Read the uncommon bits first
112  try
113  {
114  XMLReader paramtop(inputtop, "param"); // push into 'param' group
115 
116  switch (input.io_version.version)
117  {
118  /**************************************************************************/
119  case 1 :
120  /**************************************************************************/
121  break;
122 
123  default :
124  /**************************************************************************/
125 
126  QDPIO::cerr << "Input parameter version " << input.io_version.version << " unsupported." << std::endl;
127  QDP_abort(1);
128  }
129  }
130  catch (const std::string& e)
131  {
132  QDPIO::cerr << "Error reading data: " << e << std::endl;
133  throw;
134  }
135 
136 
137  // Read the common bits
138  try
139  {
140  XMLReader paramtop(inputtop, "param"); // push into 'param' group
141 
142  {
143  std::string ferm_type_str;
144  read(paramtop, "FermTypeP", ferm_type_str);
145  if (ferm_type_str == "STAGGERED") {
147  }
148  }
149 
150  // GTF NOTE: I'm going to switch on FermTypeP here because I want
151  // to leave open the option of treating masses differently.
152  switch (input.param.FermTypeP) {
153  case FERM_TYPE_STAGGERED :
154 
155  QDPIO::cout << " PROPAGATOR: Propagator for Staggered fermions" << std::endl;
156 
157  read(paramtop, "Mass", input.param.Mass);
158  read(paramtop, "u0" , input.param.u0);
159 
160  break;
161 
162  default :
163  QDP_error_exit("Fermion type not supported\n.");
164  }
165 
166 // read(paramtop, "invType", input.param.invType);
167  read(paramtop, "RsdCG", input.param.invParam.RsdCG);
168  read(paramtop, "MaxCG", input.param.invParam.MaxCG);
169  read(paramtop, "GFAccu", input.param.GFAccu);
170  read(paramtop, "OrPara", input.param.OrPara);
171  read(paramtop, "GFMax", input.param.GFMax);
172 
173  read(paramtop, "nrow", input.param.nrow);
174  read(paramtop, "boundary", input.param.boundary);
175  read(paramtop, "t_srce", input.param.t_srce);
176  }
177  catch (const std::string& e)
178  {
179  QDPIO::cerr << "Error reading data: " << e << std::endl;
180  throw;
181  }
182 
183 
184  // Read in the gauge configuration file name
185  try
186  {
187  read(inputtop, "Cfg", input.cfg);
188  read(inputtop, "Prop", input.prop);
189  }
190  catch (const std::string& e)
191  {
192  QDPIO::cerr << "Error reading data: " << e << std::endl;
193  throw;
194  }
195 }
196 
197 
200 
201 /*
202  Function to return the type of staggered
203  source.
204 */
205 
206 stag_src_type get_stag_src(XMLReader& xml, const std::string& path)
207 {
208  stag_src_type ans ;
209 
210  try
211  {
212  std::string src_name;
213  read(xml, path, src_name);
214  if (src_name == "LOCAL_SRC")
215  {
216  QDPIO::cout << "****> LOCAL SOURCE <****" << std::endl;
217  ans = LOCAL_SRC ;
218  }
219  else if (src_name == "GAUGE_INVAR_LOCAL_SOURCE")
220  {
221  QDPIO::cout << "****> GAUGE INVARIANT LOCAL SOURCE <****" << std::endl;
222  ans = GAUGE_INVAR_LOCAL_SOURCE ;
223  }
224  else if (src_name == "FUZZED_SRC")
225  {
226  QDPIO::cout << "***> FUZZED SOURCE ****" << std::endl;
227  ans = FUZZED_SRC ;
228  }
229 
230  else
231  {
232  QDPIO::cerr << "src_name " << src_name << " out of range " << std::endl;
233  QDP_abort(1);
234  }
235  }
236  catch (const std::string& e)
237  {
238  QDPIO::cerr << "Error reading data: " << e << std::endl;
239  throw;
240  }
241 
242  return ans ;
243 }
244 
245 ////////////////////////////////////////////////////////////
246 ////////////////////////////////////////////////////////////
247 
249  LatticeStaggeredPropagator & quark_propagator,
250  XMLFileWriter & xml_out,
251  int j_decay, int tlength) ;
252 
253 
255  LatticeStaggeredPropagator & quark_propagator_a,
256  LatticeStaggeredPropagator & quark_propagator_b,
257  LatticeStaggeredPropagator & quark_propagator_c,
258  XMLFileWriter & xml_out,
259  int j_decay, int tlength) ;
260 
261 
262 int ks_compute_quark_propagator(LatticeStaggeredFermion & psi,
263  stag_src_type type_of_src,
264  int fuzz_width,
265  multi1d<LatticeColorMatrix> & u ,
266  multi1d<LatticeColorMatrix> & u_smr,
268  XMLFileWriter & xml_out,
269  Real RsdCG, Real Mass,
270  int j_decay,
271  int src_ind, int color_source) ;
272 
273 
275  XMLFileWriter &xml_out, int fuzz_width ) ;
276 
277 ////////////////////////////////////////////////////////////
278 ////////////////////////////////////////////////////////////
279 
280 //! Propagator generation
281 /*! \defgroup t_propagator_fuzz Propagator generation
282  * \ingroup testsmain
283  *
284  * Main program for propagator generation.
285  */
286 
287 int main(int argc, char **argv)
288 {
289  // Put the machine into a known state
290  Chroma::initialize(&argc, &argv);
291 
292  // Input parameter structure
293  Propagator_input_t input;
294 
295  // Get the name of the input file and read its contents
296 
297  XMLReader xml_in ;
299  try
300  {
301  xml_in.open(in_name);
302  }
303  catch (...)
304  {
305  QDPIO::cerr << "Error reading input file " << in_name << std::endl;
306  QDPIO::cerr << "The input file name can be passed via the -i flag " << std::endl;
307  QDPIO::cerr << "The default name is ./DATA" << std::endl;
308  throw;
309  }
310 
311 
312  // Read data
313  read(xml_in, "/propagator", input);
314 
315  // Specify lattice size, shape, etc.
316  Layout::setLattSize(input.param.nrow);
317  Layout::create();
318 
319  // Read in the configuration along with relevant information.
320  multi1d<LatticeColorMatrix> u(Nd);
321 
322  XMLReader gauge_file_xml, gauge_xml;
323  gaugeStartup(gauge_file_xml, gauge_xml, u, input.cfg);
324 
325 
326  int fuzz_width = 2 ;
327  try
328  {
329  read(xml_in, "/propagator/param/fuzz_width",fuzz_width );
330  }
331  catch (const std::string& e)
332  {
333  QDPIO::cerr << "Error reading fuzzing width " << e << std::endl;
334  throw;
335  }
336  QDPIO::cout << "fuzz width = " << fuzz_width << std::endl;
337 
338 
339  bool use_gauge_invar_oper ;
340  use_gauge_invar_oper = false ;
341  read(xml_in, "/propagator/param/use_gauge_invar_oper",use_gauge_invar_oper );
342 
343 
344  //
345  // gauge invariance test
346  //
347 
348  // this parameter will be read from the input file
349  bool do_gauge_transform ;
350  do_gauge_transform = false ;
351  read(xml_in, "/propagator/param/do_gauge_transform",do_gauge_transform );
352 
353  if( do_gauge_transform )
354  {
355  // gauge transform the gauge fields
356  multi1d<LatticeColorMatrix> u_trans(Nd);
357 
358  // create a random gauge transform
359  LatticeColorMatrix v ;
360 
361  gaussian(v);
362  reunit(v) ;
363 
364  for(int dir = 0 ; dir < Nd ; ++dir)
365  {
366  u_trans[dir] = v*u[dir]*adj(shift(v,FORWARD,dir)) ;
367  u[dir] = u_trans[dir] ;
368  }
369 
370  QDPIO::cout << "Random gauge transform done" << std::endl;
371 
372  } // end of gauge transform
373 
374 
375 
376  // Instantiate XML writer for the output
377  XMLFileWriter& xml_out = Chroma::getXMLOutputInstance();
378  push(xml_out, "fuzzed_hadron_corr");
379 
380  // Write out the input parameter file
381  write(xml_out, "Input", xml_in);
382 
383  // Write out the config header
384  write(xml_out, "Config_info", gauge_xml);
385 
386 
387  push(xml_out, "Output_version");
388  write(xml_out, "out_version", 1);
389  pop(xml_out);
390 
391  xml_out.flush();
392 
393  // Check if the gauge field configuration is unitarized
394  unitarityCheck(u);
395 
396  // Calculate some gauge invariant observables just for info.
397  MesPlq(xml_out, "Observables", u);
398  xml_out.flush();
399 
400  // Fix to the coulomb gauge
401  int n_gf;
402  int j_decay = Nd-1;
403 
404  if( ! use_gauge_invar_oper )
405  {
406  QDPIO::cout << "Starting Coulomb gauge fixing" << std::endl;
407  coulGauge(u, n_gf, j_decay, input.param.GFAccu, input.param.GFMax, true, input.param.OrPara);
408  QDPIO::cout << "No. of gauge fixing iterations =" << n_gf << std::endl;
409  }
410 
411  //
412  // Ape fuzz the gauge fields
413  //
414 
415  multi1d<LatticeColorMatrix> u_smr(Nd);
416 
417 
418  QDPIO::cout << "Starting to APE smear the gauge configuration" << std::endl;
419 
420  Real sm_fact = 2.5; // typical parameter
421  int sm_numb = 10; // number of smearing hits
422 
423  int BlkMax = 100; // max iterations in max-ing trace
424  Real BlkAccu = 1.0e-5; // accuracy of max-ing
425 
426  u_smr = u;
427  for(int i=0; i < sm_numb; ++i)
428  {
429  multi1d<LatticeColorMatrix> u_tmp(Nd);
430 
431  for(int mu = 0; mu < Nd; ++mu)
432  if ( mu != j_decay )
433  APE_Smear(u_smr, u_tmp[mu], mu, 0, sm_fact, BlkAccu, BlkMax, j_decay);
434  else
435  u_tmp[mu] = u_smr[mu];
436 
437  u_smr = u_tmp;
438  }
439 
440 
441 
442  //
443  // --- end of APE smearing -----
444  //
445 
446  // Calcluate plaq on the gauge fixed field
447  MesPlq(xml_out, "Observables", u);
448  xml_out.flush();
449 
450  // Create a fermion BC. Note, the handle is on an ABSTRACT type.
452 
453  //
454  // Initialize fermion action
455  //
456  AsqtadFermAct S_f(fbc, input.param.Mass, input.param.u0);
457 
458  // Set up a state for the current u,
459  // (compute fat & triple links)
460  // Use S_f.createState so that S_f can pass in u0
461 
462  GroupXML_t inv_param;
463  {
464  XMLBufferWriter xml_buf;
465  write(xml_buf, "InvertParam", input.param.invParam);
466  XMLReader xml_in(xml_buf);
467  inv_param = readXMLGroup(xml_in, "/InvertParam", "invType");
468  }
469  Handle<const ConnectState > state(S_f.createState(u));
471 
472 
473  //
474  // Loop over the source color, creating the source
475  // and calling the relevant propagator routines.
476  //
477 
478  LatticeStaggeredPropagator quark_propagator_Lsink_Lsrc;
479  LatticeStaggeredPropagator quark_propagator_Fsink_Lsrc;
480  LatticeStaggeredPropagator quark_propagator_Lsink_Fsrc;
481  LatticeStaggeredPropagator quark_propagator_Fsink_Fsrc;
482 
483  int ncg_had = 0;
484 
485  LatticeStaggeredFermion psi ;
486  LatticeStaggeredFermion psi_fuzz;
487 
488  // pass the origin from input file
489  int t_source = 0;
490  QDPIO::cout << "Source time slice = " << t_source << std::endl;
491 
492 
493 
494  //
495  // Local source inversions
496  //
497 
498  stag_src_type type_of_src = LOCAL_SRC ;
499  QDPIO::cout << "LOCAL INVERSIONS" << std::endl;
500 
501  for(int color_source = 0; color_source < Nc; ++color_source)
502  {
503  psi = zero; // note this is ``zero'' and not 0
504 
505  const int src_ind = 0 ;
506  ncg_had += ks_compute_quark_propagator(psi,type_of_src, fuzz_width,
507  u, u_smr, qprop, xml_out,
508  input.param.invParam.RsdCG,
509  input.param.Mass,
510  j_decay,
511  src_ind, color_source) ;
512 
513  /*
514  * Move the solution to the appropriate components
515  * of quark propagator.
516  */
517  FermToProp(psi, quark_propagator_Lsink_Lsrc, color_source);
518 
519  //
520  // fuzz at the sink
521  //
522 
523  fuzz_smear(u_smr, psi,psi_fuzz, fuzz_width, j_decay) ;
524  FermToProp(psi_fuzz, quark_propagator_Fsink_Lsrc, color_source);
525 
526 
527  } //color_source
528 
529 
530 
531 
532  //
533  // Fuzzed source inversions
534  //
535 
536  type_of_src = FUZZED_SRC ;
537  QDPIO::cout << "FUZZED SOURCE INVERSIONS" << std::endl;
538 
539  for(int color_source = 0; color_source < Nc; ++color_source)
540  {
541  psi = zero; // note this is ``zero'' and not 0
542 
543  const int src_ind = 0 ;
544  ncg_had += ks_compute_quark_propagator(psi,type_of_src, fuzz_width,
545  u, u_smr, qprop, xml_out,
546  input.param.invParam.RsdCG,
547  input.param.Mass,
548  j_decay,
549  src_ind, color_source) ;
550 
551  /*
552  * Move the solution to the appropriate components
553  * of quark propagator.
554  */
555  FermToProp(psi, quark_propagator_Lsink_Fsrc, color_source);
556 
557  //
558  // fuzz at the sink
559  //
560 
561  fuzz_smear(u_smr, psi,psi_fuzz, fuzz_width, j_decay) ;
562  FermToProp(psi_fuzz, quark_propagator_Fsink_Fsrc, color_source);
563 
564 
565  } //color_source
566 
567 
568 
569 
570  //
571  // compute some simple baryon correlators
572  //
573 
574  push(xml_out, "baryon_correlators");
575 
576  // describe the source
577  std::string NN ;
578  write(xml_out, "source_time", t_source);
579  push(xml_out, "smearing_info");
580  NN = "L" ;
581  write_smearing_info(NN, LOCAL_SRC,xml_out,fuzz_width) ;
582 
583  NN = "F" ;
584  write_smearing_info(NN,FUZZED_SRC,xml_out,fuzz_width) ;
585 
586  pop(xml_out);
587 
588  // write out the baryon correlators
589  std::string b_tag("srcLLL_sinkLLL_nucleon") ;
590  ks_compute_baryon(b_tag,quark_propagator_Lsink_Lsrc,
591  quark_propagator_Lsink_Lsrc,
592  quark_propagator_Lsink_Lsrc,
593  xml_out, j_decay,
594  input.param.nrow[3]) ;
595 
596  // single quark fuzzed
597 
598  b_tag = "srcLLL_sinkFLL_nucleon" ;
599  ks_compute_baryon(b_tag,
600  quark_propagator_Fsink_Lsrc,
601  quark_propagator_Lsink_Lsrc,
602  quark_propagator_Lsink_Lsrc,
603  xml_out, j_decay,
604  input.param.nrow[3]) ;
605 
606  b_tag = "srcFLL_sinkLLL_nucleon" ;
607  ks_compute_baryon(b_tag,
608  quark_propagator_Lsink_Fsrc,
609  quark_propagator_Lsink_Lsrc,
610  quark_propagator_Lsink_Lsrc,
611  xml_out, j_decay,
612  input.param.nrow[3]) ;
613 
614  b_tag = "srcFLL_sinkFLL_nucleon" ;
615  ks_compute_baryon(b_tag,
616  quark_propagator_Fsink_Fsrc,
617  quark_propagator_Lsink_Lsrc,
618  quark_propagator_Lsink_Lsrc,
619  xml_out, j_decay,
620  input.param.nrow[3]) ;
621 
622 
623 
624  // double quark fuzzed
625 
626  b_tag = "srcLLL_sinkFFL_nucleon" ;
627  ks_compute_baryon(b_tag,
628  quark_propagator_Fsink_Lsrc,
629  quark_propagator_Fsink_Lsrc,
630  quark_propagator_Lsink_Lsrc,
631  xml_out, j_decay,
632  input.param.nrow[3]) ;
633 
634  b_tag = "srcFFL_sinkLLL_nucleon" ;
635  ks_compute_baryon(b_tag,
636  quark_propagator_Lsink_Fsrc,
637  quark_propagator_Lsink_Fsrc,
638  quark_propagator_Lsink_Lsrc,
639  xml_out, j_decay,
640  input.param.nrow[3]) ;
641 
642  b_tag = "srcFFL_sinkFFL_nucleon" ;
643  ks_compute_baryon(b_tag,
644  quark_propagator_Fsink_Fsrc,
645  quark_propagator_Fsink_Fsrc,
646  quark_propagator_Lsink_Lsrc,
647  xml_out, j_decay,
648  input.param.nrow[3]) ;
649 
650 
651  // treble quark fuzzed
652 
653  b_tag = "srcLLL_sinkFFF_nucleon" ;
654  ks_compute_baryon(b_tag,
655  quark_propagator_Fsink_Lsrc,
656  quark_propagator_Fsink_Lsrc,
657  quark_propagator_Fsink_Lsrc,
658  xml_out, j_decay,
659  input.param.nrow[3]) ;
660 
661  b_tag = "srcFFF_sinkLLL_nucleon" ;
662  ks_compute_baryon(b_tag,
663  quark_propagator_Lsink_Fsrc,
664  quark_propagator_Lsink_Fsrc,
665  quark_propagator_Lsink_Fsrc,
666  xml_out, j_decay,
667  input.param.nrow[3]) ;
668 
669  b_tag = "srcFFF_sinkFFF_nucleon" ;
670  ks_compute_baryon(b_tag,
671  quark_propagator_Fsink_Fsrc,
672  quark_propagator_Fsink_Fsrc,
673  quark_propagator_Fsink_Fsrc,
674  xml_out, j_decay,
675  input.param.nrow[3]) ;
676 
677 
678 
679  pop(xml_out); // baryon correlators
680 
681 
682  pop(xml_out);
683  xml_out.close();
684  xml_in.close();
685 
686  // Time to bolt
688  QDPIO::cout << "CHROMA_RUN_COMPLETE " << std::endl;
689  exit(0);
690 }
691 
692 
693 //
694 // wrapper routine for baryon operators
695 //
696 
698  LatticeStaggeredPropagator & quark_propagator,
699  XMLFileWriter & xml_out,
700  int j_decay, int tlength)
701 {
702  int bc_spec = 0 ;
703  multi1d<int> coord(Nd);
704  coord[0]=0; coord[1] = 0; coord[2] = 0; coord[3] = 0;
705 
706  multi1d<Complex> barprop(tlength) ;
707 
708  baryon_s(quark_propagator,barprop,
709  coord,j_decay, bc_spec) ;
710 
711 
712  write(xml_out, name, barprop);
713 
714 
715 
716 }
717 
718 
719 
720 //
721 // wrapper routine for baryon operators
722 //
723 
725  LatticeStaggeredPropagator & quark_propagator_a,
726  LatticeStaggeredPropagator & quark_propagator_b,
727  LatticeStaggeredPropagator & quark_propagator_c,
728  XMLFileWriter & xml_out,
729  int j_decay, int tlength)
730 {
731  int bc_spec = 0 ;
732  multi1d<int> coord(Nd);
733  coord[0]=0; coord[1] = 0; coord[2] = 0; coord[3] = 0;
734 
735  multi1d<Complex> barprop(tlength) ;
736 
737  baryon_s(quark_propagator_a,quark_propagator_b,quark_propagator_c,
738  barprop,coord,j_decay, bc_spec) ;
739 
740  write(xml_out, name, barprop);
741 
742 }
743 
744 
745 
746 
747 int ks_compute_quark_propagator(LatticeStaggeredFermion & psi,
748  stag_src_type type_of_src,
749  int fuzz_width,
750  multi1d<LatticeColorMatrix> & u ,
751  multi1d<LatticeColorMatrix> & u_smr,
753  XMLFileWriter & xml_out,
754  Real RsdCG, Real Mass,
755  int j_decay,
756  int src_ind, int color_source)
757 {
758  LatticeStaggeredFermion q_source ;
759  LatticeStaggeredFermion q_source_fuzz ;
760  int ncg_had = 0 ;
761 
762  QDPIO::cout << "Inversion for Color = " << color_source << std::endl;
763  q_source = zero ;
764 
765  if( type_of_src == LOCAL_SRC )
766  {
767  q_source = zero ;
768  multi1d<int> coord(Nd);
769 
770  PropIndexTodelta(src_ind, coord) ;
771  srcfil(q_source, coord,color_source ) ;
772  }
773  else if( type_of_src == GAUGE_INVAR_LOCAL_SOURCE )
774  {
775  q_source = zero ;
776  multi1d<int> coord(Nd);
777 
778  // start with local source
779  coord[0]=0; coord[1] = 0; coord[2] = 0; coord[3] = 0;
780  srcfil(q_source, coord,color_source ) ;
781 
782  // now do the shift
783  PropIndexTodelta(src_ind, coord) ;
784  q_source_fuzz = q_source ;
785  q_source = shiftDeltaPropCov(coord,q_source_fuzz,u,
786  false);
787 
788  }
789  else if( type_of_src == FUZZED_SRC )
790  {
791  q_source = zero ;
792  multi1d<int> coord(Nd);
793 
794  PropIndexTodelta(src_ind, coord) ;
795  srcfil(q_source, coord,color_source ) ;
796 
797 
798  fuzz_smear(u_smr, q_source,q_source_fuzz,
799  fuzz_width, j_decay) ;
800 
801  q_source = q_source_fuzz ;
802  }
803 
804 
805 
806  // Use the last initial guess as the current guess
807 
808  // Compute the propagator for given source color/spin
809  // int n_count;
810 
811  StopWatch swatch;
812  swatch.start();
813 
814  SystemSolverResults_t res n_count = (*qprop)(psi, q_source);
815  swatch.stop();
816  double time_in_sec = swatch.getTimeInSeconds();
817 
818 
819  ncg_had += res.n_count;
820 
821  // this is done for xmldif reasons
822  if( src_ind == 0 )
823  {
824  push(xml_out,"Qprop");
825  write(xml_out, "Staggered_src_tag" , src_ind);
826  write(xml_out, "Mass" , Mass);
827  write(xml_out, "RsdCG", RsdCG);
828  write(xml_out, "n_count", n_count);
829  write(xml_out, "time_in_sec",time_in_sec );
830  pop(xml_out);
831  }
832 
833 
834  return ncg_had ;
835 }
836 
837 
838 
840  XMLFileWriter &xml_out, int fuzz_width )
841 {
842 
843 
844  push(xml_out, "smearing_basis");
845  write(xml_out, "element_tag", name);
846 
847  if( type_of_src == LOCAL_SRC )
848  { write(xml_out, "source_type", "LOCAL_SRC"); }
849  else if( type_of_src == GAUGE_INVAR_LOCAL_SOURCE )
850  { write(xml_out, "source_type", "GAUGE_INVAR_LOCAL_SOURCE"); }
851  else if( type_of_src == FUZZED_SRC )
852  {
853  write(xml_out, "source_type", "FUZZED_SRC");
854  write(xml_out, "fuzzed_width", fuzz_width);
855  }
856 
857  pop(xml_out);
858 
859 }
Primary include file for CHROMA in application codes.
Asqtad staggered fermion action.
Class for counted reference semantics.
Definition: handle.h:33
Concrete class for all gauge actions with simple boundary conditions.
Definition: simple_fermbc.h:42
int mu
Definition: cool.cc:24
Fuzzed sources.
void FermToProp(const LatticeFermionF &a, LatticePropagatorF &b, int color_index, int spin_index)
Insert a LatticeFermion into a LatticePropagator.
Definition: transf.cc:98
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
void unitarityCheck(const multi1d< LatticeColorMatrixF3 > &u)
Check the unitarity of color matrix in SU(N)
Definition: unit_check.cc:20
void gaugeStartup(XMLReader &gauge_file_xml, XMLReader &gauge_xml, multi1d< LatticeColorMatrix > &u, Cfg_t &cfg)
Initialize the gauge fields.
void coulGauge(multi1d< LatticeColorMatrix > &u, int &n_gf, int j_decay, const Real &GFAccu, int GFMax, bool OrDo, const Real &OrPara)
Coulomb (and Landau) gauge fixing.
Definition: coulgauge.cc:37
FermType
Fermion type.
PropType
Propagator type.
GroupXML_t readXMLGroup(XMLReader &xml_in, const std::string &path, const std::string &type_name)
Read group and return as a std::string.
@ FERM_TYPE_STAGGERED
void APE_Smear(const multi1d< LatticeColorMatrix > &u, LatticeColorMatrix &u_smear, int mu, int bl_level, const Real &sm_fact, const Real &BlkAccu, int BlkMax, int j_decay)
Construct APE smeared links from:
Definition: ape_smear.cc:44
void fuzz_smear(const multi1d< LatticeColorMatrix > &ufuzz, const T &psi, T &psifuzz, int length, int j_decay)
apply a fuzz_smear operator to a lattice field
Definition: fuzz_smear.cc:75
void srcfil(LatticeFermion &a, const multi1d< int > &coord, int color_index, int spin_index)
Fill a specific color and spin index with 1.0.
Definition: srcfil.cc:23
int bc_spec
Real Mass
unsigned i
Definition: ldumul_w.cc:34
multi1d< int > coord(Nd)
int j_decay
Definition: meslate.cc:22
Nd
Definition: meslate.cc:74
const std::string name
Name to be used.
gaussian(aux)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > const multi1d< Real > enum InvType invType const multi1d< Real > & RsdCG
Definition: pbg5p_w.cc:30
QDP_error_exit("too many BiCG iterations", n_count, rsd_sq, cp, c, re_rvr, im_rvr, re_a, im_a, re_b, im_b)
static multi1d< LatticeColorMatrix > u
void baryon_s(LatticeStaggeredPropagator &quark_propagator_in, multi1d< Complex > &barprop, multi1d< int > &t_source, int j_decay, int bc_spec)
Definition: baryon_s.cc:51
void initialize(int *argc, char ***argv)
Chroma initialisation routine.
Definition: chroma_init.cc:114
void finalize(void)
Chroma finalization routine.
Definition: chroma_init.cc:308
LatticeStaggeredPropagator shiftDeltaPropCov(multi1d< int > &delta, const LatticeStaggeredPropagator &src, multi1d< LatticeColorMatrix > u, bool sym_flag)
void reunit(LatticeColorMatrixF3 &xa)
Definition: reunit.cc:467
std::string getXMLInputFileName()
Get input file name.
Definition: chroma_init.cc:88
void PropIndexTodelta(int src_index, multi1d< int > &delta)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
Definition: pbg5p_w.cc:28
XMLFileWriter & getXMLOutputInstance()
Get xml output instance.
Definition: chroma_init.cc:359
const WilsonTypeFermAct< multi1d< LatticeFermion > > & S_f
Definition: pbg5p_w.cc:27
Double zero
Definition: invbicg.cc:106
::std::string string
Definition: gtest.h:1979
psi
Definition: pade_trln_w.cc:191
int n_count
Definition: pade_trln_w.cc:69
MesPlq(u, w_plaq, s_plaq, t_plaq, link)
#define FORWARD
Definition: primitives.h:82
Gauge configuration structure.
Definition: cfgtype_io.h:16
Hold group xml and type id.
Params for CG inverter.
Holds return info from SystemSolver call.
Definition: syssolver.h:17
Parameters for running program.
Definition: qpropadd.cc:17
PropType prop_type
Real OrPara
SysSolverCGParams invParam
FermType FermTypeP
multi1d< int > t_srce
multi1d< int > nrow
Definition: qpropadd.cc:18
Real GFAccu
multi1d< int > boundary
Propagators.
std::string source_file
std::string prop_file
IO_version_t io_version
stag_src_type get_stag_src(XMLReader &xml, const std::string &path)
void read(XMLReader &xml, const std::string &path, Prop_t &input)
int main(int argc, char **argv)
stag_src_enum stag_src_type
int ks_compute_quark_propagator(LatticeStaggeredFermion &psi, stag_src_type type_of_src, int fuzz_width, multi1d< LatticeColorMatrix > &u, multi1d< LatticeColorMatrix > &u_smr, Handle< const SystemSolver< LatticeStaggeredFermion > > &qprop, XMLFileWriter &xml_out, Real RsdCG, Real Mass, int j_decay, int src_ind, int color_source)
@ GAUGE_INVAR_LOCAL_SOURCE
void ks_compute_baryon(std::string name, LatticeStaggeredPropagator &quark_propagator, XMLFileWriter &xml_out, int j_decay, int tlength)
void write_smearing_info(std::string name, stag_src_type type_of_src, XMLFileWriter &xml_out, int fuzz_width)
push(xml_out,"Cooled_Topology")
pop(xml_out)