CHROMA
inline_spectrum_s.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Inline construction of staggered spectrum
3  *
4  * Spectrum calculations
5  */
6 
9 #include "meas/glue/mesplq.h"
10 #include "meas/smear/ape_smear.h"
12 
13 #include "util/ft/sftmom.h"
14 #include "util/info/proginfo.h"
15 #include "io/param_io.h"
17 
18 // staggered stuff
19 #include "handle.h"
20 #include "state.h"
23 
25 
26 #include "util/ferm/transf.h"
28 #include "meas/smear/fuzz_smear.h"
30 
31 
33 
35 #include "util_compute_meson_s.h"
38 
39 namespace Chroma
40 {
41  int build_basic_8_props(multi1d<LatticeStaggeredPropagator> stag_prop,
42  stag_src_type type_of_src,
43  bool gauge_shift, bool sym_shift,
44  int fuzz_width,
45  const multi1d<LatticeColorMatrix> & u,
46  const multi1d<LatticeColorMatrix> & u_smr,
48  & qprop,
49  XMLWriter & xml_out,
50  Real RsdCG, Real Mass, int j_decay ) ;
51 
52 }
53 
54 
55 // ------------------------
56 
57 
58 namespace Chroma {
59 
60  int compute_quark_propagator_s(LatticeStaggeredFermion & psi,
61  stag_src_type type_of_src,
62  bool gauge_shift,
63  bool sym_shift,
64  int fuzz_width,
65  const multi1d<LatticeColorMatrix> & u ,
66  multi1d<LatticeColorMatrix> & u_smr,
68  XMLWriter & xml_out,
69  Real RsdCG, Real Mass,
70  int j_decay,
71  int src_ind, int color_source);
72 
73  int compute_quark_propagator_s(LatticeStaggeredFermion & psi,
74  stag_src_type type_of_src,
75  bool gauge_shift,
76  bool sym_shift,
77  const multi1d<LatticeColorMatrix> & u ,
79  XMLWriter & xml_out,
80  Real RsdCG, Real Mass,
81  int j_decay,
82  int src_ind, int color_source, int t_source=0);
83 
84 
85  int compute_quark_propagator_s(LatticeStaggeredFermion & psi1,
86  LatticeStaggeredFermion & psi2,
87  stag_src_type type_of_src,
88  bool gauge_shift,
89  bool sym_shift,
90  const multi1d<LatticeColorMatrix> & u ,
93  XMLWriter & xml_out,
94  Real RsdCG, Real Mass1, Real Mass2,
95  int j_decay,
96  int src_ind, int color_source, int t_source) ;
97 
98  int compute_quark_propagator_s(LatticeStaggeredFermion & psi,
99  stag_src_type type_of_src,
100  bool gauge_shift,
101  bool sym_shift,
102  int fuzz_width,
103  const multi1d<LatticeColorMatrix> & u ,
104  multi1d<LatticeColorMatrix> & u_smr,
106  XMLWriter & xml_out,
107  Real RsdCG, Real Mass,
108  int j_decay,
109  int src_ind, int color_source,
110  LatticeStaggeredFermion & q_source_in ) ;
111 
112 
113  int compute_quark_propagator_s(LatticeStaggeredFermion & psi,
114  stag_src_type type_of_src,
115  bool gauge_shift,
116  bool sym_shift,
117  const multi1d<LatticeColorMatrix> & u ,
119  XMLWriter & xml_out,
120  Real RsdCG, Real Mass,
121  int j_decay,
122  int src_ind, int color_source, int t_source,
123  LatticeStaggeredFermion & q_source_in ) ;
124 
125 
126 
127  int compute_quark_propagator_s(LatticeStaggeredFermion & psi1,
128  LatticeStaggeredFermion & psi2,
129  stag_src_type type_of_src,
130  bool gauge_shift,
131  bool sym_shift,
132  const multi1d<LatticeColorMatrix> & u ,
135  XMLWriter & xml_out,
136  Real RsdCG, Real Mass1, Real Mass2,
137  int j_decay,
138  int src_ind, int color_source, int t_source,
139  LatticeStaggeredFermion & q_source_in) ;
140 
141 
143  LatticeStaggeredPropagator & quark_propagator,
144  XMLWriter & xml_out,
145  int j_decay, int tlength) ;
146 
148  LatticeStaggeredPropagator & quark_propagator_a,
149  LatticeStaggeredPropagator & quark_propagator_b,
150  LatticeStaggeredPropagator & quark_propagator_c,
151  XMLWriter & xml_out,
152  int j_decay, int tlength);
153 
155  LatticeStaggeredPropagator & quark_propagator_a,
156  LatticeStaggeredPropagator & quark_propagator_b,
157  LatticeStaggeredPropagator & quark_propagator_c,
158  XMLWriter & xml_out,
159  int j_decay, int tlength,
160  bool binary_baryon_dump, std::string binary_name);
161 
162 
164  XMLWriter &xml_out, int fuzz_width ) ;
165 
166 
167  void compute_vary_baryon_s(XMLWriter &xml_out, int t_source, int fuzz_width,
168  int j_decay, int t_len,
169  LatticeStaggeredPropagator &
170  quark_propagator_Lsink_Lsrc,
171  LatticeStaggeredPropagator &
172  quark_propagator_Fsink_Lsrc,
173  LatticeStaggeredPropagator &
174  quark_propagator_Lsink_Fsrc,
175  LatticeStaggeredPropagator &
176  quark_propagator_Fsink_Fsrc) ;
177 
178 
179  void compute_vary_baryon_s(XMLWriter &xml_out, int t_source, int fuzz_width,
180  int j_decay, int t_len,
181  LatticeStaggeredPropagator &
182  quark_propagator_Lsink_Lsrc,
183  LatticeStaggeredPropagator &
184  quark_propagator_Fsink_Lsrc,
185  LatticeStaggeredPropagator &
186  quark_propagator_Lsink_Fsrc,
187  LatticeStaggeredPropagator &
188  quark_propagator_Fsink_Fsrc,
189  bool binary_baryon_dump,
190  std::string binary_name) ;
191 
192 
193 
194 
195  int compute_singlet_ps(LatticeStaggeredFermion & psi,
196  LatticeStaggeredPropagator quark_propagator,
197  stag_src_type type_of_src,
198  bool gauge_shift,
199  bool sym_shift,
200  const multi1d<LatticeColorMatrix> & u ,
202  qprop,
203  XMLWriter & xml_out,
204  Real RsdCG, Real Mass,
205  int j_decay, int t_source, int t_length);
206 
207  int compute_vary_singlet_ps(LatticeStaggeredFermion & psi,
208  LatticeStaggeredPropagator & quark_propagator_Lsink_Lsrc,
209  LatticeStaggeredPropagator & quark_propagator_Fsink_Lsrc,
210  LatticeStaggeredPropagator & quark_propagator_Lsink_Fsrc,
211  LatticeStaggeredPropagator & quark_propagator_Fsink_Fsrc,
212  stag_src_type type_of_src,
213  bool gauge_shift,
214  bool sym_shift,
215  const multi1d<LatticeColorMatrix> & u ,
216  const multi1d<LatticeColorMatrix> & u_smr ,
218  XMLWriter & xml_out,
219  Real RsdCG, Real Mass,
220  int j_decay, int t_source, int t_length,
221  int fuzz_width);
222 
223 }
224 
225 // ----------
226 /***************************************************************************/
227 /***************************************************************************/
228 
229 namespace Chroma {
230 
231  /***************************************************************************/
232 
233  namespace InlineStaggeredSpectrumEnv
234  {
235  namespace
236  {
237  AbsInlineMeasurement* createMeasurement(XMLReader& xml_in,
238  const std::string& path) {
239  return new InlineStaggeredSpectrum(InlineStaggeredSpectrumParams(xml_in, path));
240  }
241 
242  //! Local registration flag
243  bool registered = false;
244  }
245 
246  const std::string name = "SPECTRUM_S";
247 
248  //! Register all the factories
249  bool registerAll()
250  {
251  bool success = true;
252  if (! registered)
253  {
254  success &= TheInlineMeasurementFactory::Instance().registerObject(name,
255  createMeasurement);
256  registered = true;
257  }
258  return success;
259  }
260  }
261 
262  /***************************************************************************/
263 
264 
265  //! Reader for parameters
266  void read(XMLReader& xml, const std::string& path,
268  {
269  XMLReader paramtop(xml, path);
270 
271  int version;
272  read(paramtop, "version", version);
273 
274  // switch (version)
275 
276  read(paramtop, "Meson_local", param.Meson_local);
277  read(paramtop, "Meson_charm_local", param.Meson_charm_local);
278  read(paramtop, "Meson_charm_noisy_local", param.Meson_charm_noisy_local);
279  read(paramtop, "Wilson_loops", param.Wilson_loops);
280  read(paramtop, "Pion_nondegen_noisy_local", param.Pion_nondegen_noisy_local);
281 
282  param.Pion_nondegen_noisy_local2 = false ;
283  if (paramtop.count("Pion_nondegen_noisy_local2") == 1)
284  read(paramtop, "Pion_nondegen_noisy_local2", param.Pion_nondegen_noisy_local2);
285 
286  param.Pion_nondegen_noisy_local3 = false ;
287  if (paramtop.count("Pion_nondegen_noisy_local3") == 1)
288  read(paramtop, "Pion_nondegen_noisy_local3", param.Pion_nondegen_noisy_local3);
289 
290  param.Pion_nondegen_noisy_local4 = false ;
291  if (paramtop.count("Pion_nondegen_noisy_local4") == 1)
292  read(paramtop, "Pion_nondegen_noisy_local4", param.Pion_nondegen_noisy_local4);
293 
294 
295 
296  read(paramtop, "Baryon_local", param.Baryon_local);
297  read(paramtop, "Baryon_vary", param.Baryon_vary);
298  read(paramtop, "LocalPion_vary", param.LocalPion_vary);
299 
300  if( paramtop.count("LocalScalar_vary") > 0 ) {
301  read(paramtop, "LocalScalar_vary", param.LocalScalar_vary);
302  }
303  else
304  {
305  param.LocalScalar_vary = false ;
306  }
307 
308  read(paramtop, "disconnected_local", param.disconnected_local);
309  read(paramtop, "disconnected_fuzz", param.disconnected_fuzz);
310  read(paramtop, "singletPs_Conn_local", param.ps4link_singlet_conn);
311  read(paramtop, "singletPs_Conn_local_fuzz", param.ps4link_singlet_conn_fuzz);
312 
313  read(paramtop, "eight_pions", param.eight_pions);
314  read(paramtop, "eight_scalars", param.eight_scalars);
315  read(paramtop, "eight_rhos", param.eight_rhos);
316 
317  read(paramtop, "t_srce", param.t_srce);
318  read(paramtop, "nrow", param.nrow);
319  read(paramtop, "sym_shift_oper", param.sym_shift_oper);
320  read(paramtop, "gauge_invar_oper", param.gauge_invar_oper);
321  read(paramtop, "loop_checkpoint", param.loop_checkpoint);
322 
323  param.binary_name = "dump_" ;
324  param.binary_loop_checkpoint = false ;
325  param.binary_meson_dump = false ;
326  param.binary_baryon_dump = false ;
327 
328  if (paramtop.count("binary_loop_checkpoint") == 1){
329  read(paramtop, "binary_loop_checkpoint",
330  param.binary_loop_checkpoint) ;
331  }
332 
333  if (paramtop.count("binary_meson_dump") == 1){
334  read(paramtop, "binary_meson_dump",
335  param.binary_meson_dump) ;
336  }
337 
338  if (paramtop.count("binary_baryon_dump") == 1){
339  read(paramtop, "binary_baryon_dump",
340  param.binary_baryon_dump) ;
341  }
342 
343  if( param.binary_loop_checkpoint || param.binary_baryon_dump ||
344  param.binary_meson_dump )
345  {
346  read(paramtop, "binary_name", param.binary_name) ;
347  }
348 
349 
350 
351 
352  param.fermact = readXMLGroup(paramtop, "FermionAction", "FermAct");
353 
354  if( param.Pion_nondegen_noisy_local )
355  param.fermact2 = readXMLGroup(paramtop, "FermionAction2", "FermAct");
356 
357 
358  if( param.Pion_nondegen_noisy_local2 )
359  param.fermact3 = readXMLGroup(paramtop, "FermionAction3", "FermAct");
360  if( param.Pion_nondegen_noisy_local )
361  param.fermact4 = readXMLGroup(paramtop, "FermionAction4", "FermAct");
362  if( param.Pion_nondegen_noisy_local )
363  param.fermact5 = readXMLGroup(paramtop, "FermionAction5", "FermAct");
364 
365 
366  read(paramtop, "src_seperation", param.src_seperation);
367 
368  if( !param.gauge_invar_oper ){
369  //read gauge-fixing parameters
370  read(paramtop, "GFAccu", param.GFAccu);
371  read(paramtop, "OrPara", param.OrPara );
372  read(paramtop, "GFMax", param.GFMax );
373  }
374 
375 
376  // if(( param.disconnected_local )||(param.disconnected_fuzz)){
377 
379 
380  read(paramtop, "Number_sample", param.Nsamp);
381  read(paramtop, "CFGNO", param.CFGNO);
382  // more work
383  param.volume_source = GAUSSIAN ;
384  read(paramtop, "volume_src", param.volume_source);
385 
386  }else{
387  param.Nsamp = 10 ;
388  param.CFGNO = 10 ;
389  param.volume_source = GAUSSIAN ;
390  }
391 
392  if(((param.Baryon_vary)||(param.ps4link_singlet_conn_fuzz))||
393  ((param.disconnected_fuzz)||(param.LocalPion_vary) || param.LocalScalar_vary )){
394  read(paramtop, "fuzz_width", param.fuzz_width);
395  }else{
396  param.fuzz_width = 0 ;
397  }
398  }
399 
400  /***************************************************************************/
401 
402 
403  //! Writer for parameters
404  void write(XMLWriter& xml, const std::string& path,
406  push(xml, path);
407 
408  int version = 1;
409  write(xml, "version", version);
410 
411  write(xml, "Meson_local", param.Meson_local);
412  write(xml, "Meson_charm_local", param.Meson_charm_local);
413  write(xml, "Meson_charm_noisy_local", param.Meson_charm_noisy_local);
414  write(xml, "Pion_nondegen_noisy_local", param.Pion_nondegen_noisy_local);
415 
416  write(xml, "Pion_nondegen_noisy_local2", param.Pion_nondegen_noisy_local2);
417  write(xml, "Pion_nondegen_noisy_local3", param.Pion_nondegen_noisy_local3);
418  write(xml, "Pion_nondegen_noisy_local4", param.Pion_nondegen_noisy_local4);
419 
420  write(xml, "Wilson_loops", param.Wilson_loops);
421  write(xml, "Baryon_local", param.Baryon_local);
422  write(xml, "Baryon_vary", param.Baryon_vary);
423  write(xml, "disconnected_local", param.disconnected_local);
424  write(xml, "disconnected_fuzz", param.disconnected_fuzz);
425  write(xml, "nrow", param.nrow);
426  write(xml, "t_srce", param.t_srce);
427  write(xml, "volume_source",param.volume_source);
428  write(xml, "fuzz_width", param.fuzz_width);
429  pop(xml);
430  }
431 
432  /***************************************************************************/
433 
434  //! Propagator generation params input
435  void read(XMLReader& xml, const std::string& path,
437  XMLReader inputtop(xml, path);
438 
439 
440  // read(inputtop, "RsdCG", input.invParam.RsdCG);
441  // read(inputtop, "MaxCG", input.invParam.MaxCG);
442  read(inputtop, "invParam", input.invParam); // inverter parameters
443 
444 
445  if( inputtop.count("invParam/MaxCGRestart") > 0 ) {
446  read(inputtop, "invParam/MaxCGRestart", input.invParam.MaxCGRestart);
447  }
448  else {
449  input.invParam.MaxCGRestart = 0 ;
450  }
451 
452  }
453 
454  /***************************************************************************/
455 
456 
457  //! Propagator output
458  void write(XMLWriter& xml, const std::string& path,
460  push(xml, path);
461  write(xml, "Mass", input.Mass);
462  // write(xml,"Inverter",input.invParam.invType);
463  write(xml,"RsdCG", input.invParam.RsdCG);
464  write(xml,"MaxCG", input.invParam.MaxCG);
465  pop(xml);
466  }
467 
468 
469  /***************************************************************************/
470  //! Named object input
471  void read(XMLReader& xml, const std::string& path, InlineStaggeredSpectrumParams::NamedObject_t& input)
472  {
473  XMLReader inputtop(xml, path);
474 
475  read(inputtop, "gauge_id", input.gauge_id);
476  }
477 
478  /***************************************************************************/
479 
480  //! Named object output
481  void write(XMLWriter& xml, const std::string& path, const InlineStaggeredSpectrumParams::NamedObject_t& input)
482  {
483  push(xml, path);
484 
485  write(xml, "gauge_id", input.gauge_id);
486 
487  pop(xml);
488  }
489 
490  /***************************************************************************/
491 
492  // Param stuff
494  {
495  frequency = 0;
496  }
497 
498  /***************************************************************************/
499 
501  const std::string& path) {
502  try {
503  XMLReader paramtop(xml_in, path);
504 
505  if (paramtop.count("Frequency") == 1){
506  read(paramtop, "Frequency", frequency);
507  }else {
508  frequency = 1;
509  }
510 
511  // Parameters for source construction
512  read(paramtop, "Param", param);
513 
514  // Read in the output propagator/source configuration info
515  read(paramtop, "Inversion", prop_param);
516 
517  // Read in the gauge field id
518  read(paramtop, "NamedObject", named_obj);
519 
520  // Possible alternate XML file pattern
521  if (paramtop.count("xml_file") != 0) {
522  read(paramtop, "xml_file", xml_file);
523  }
524  } catch(const std::string& e) {
525  QDPIO::cerr << "Caught Exception reading XML: " << e << std::endl;
526  QDP_abort(1);
527  }
528  }
529 
530  /***************************************************************************/
531 
532  void
534  const std::string& path) {
535  push(xml_out, path);
536 
537  Chroma::write(xml_out, "Param", param);
538  Chroma::write(xml_out, "Inversion", prop_param);
539  Chroma::write(xml_out, "NamedObject", named_obj);
540  QDP::write(xml_out, "xml_file", xml_file);
541 
542  pop(xml_out);
543  }
544 
545  /***************************************************************************/
546 
547 
548  int
549  build_basic_8_props(multi1d<LatticeStaggeredPropagator> &stag_prop,
550  stag_src_type type_of_src,
551  bool gauge_shift, bool sym_shift,
552  int fuzz_width,
553  const multi1d<LatticeColorMatrix> & u,
554  multi1d<LatticeColorMatrix> & u_smr,
556  qprop,
557  XMLWriter & xml_out,
558  Real RsdCG, Real Mass, int j_decay){
559 
560 
561  LatticeStaggeredFermion q_source, psi ;
562  LatticeStaggeredFermion q_source_fuzz ;
563  LatticeStaggeredPropagator quark_propagator;
564 
565  int ncg_had = 0; // count CG iterations
566 
567  psi = zero; // note this is ``zero'' and not 0
568 
569 
570 
571  for(int src_ind = 0; src_ind < 8 ; ++src_ind){
572  stag_prop[src_ind] = zero ;
573 
574  for(int color_source = 0; color_source < Nc; ++color_source) {
575 
576  ncg_had += compute_quark_propagator_s(psi,type_of_src,
577  fuzz_width,
578  gauge_shift, sym_shift,
579  u, u_smr, qprop, xml_out,
580  RsdCG, Mass, j_decay,
581  src_ind, color_source) ;
582 
583 
584  /*
585  * Move the solution to the appropriate components
586  * of quark propagator.
587  */
588  FermToProp(psi, quark_propagator, color_source);
589  } //color_source
590 
591  stag_prop[src_ind] = quark_propagator;
592 
593  }// end src_ind
594 
595  return ncg_had;
596 
597  }
598  /***************************************************************************/
599 
600  // no fuzzing version
601  int
602  build_basic_8_props(multi1d<LatticeStaggeredPropagator> &stag_prop,
603  stag_src_type type_of_src,
604  bool gauge_shift, bool sym_shift,
605  const multi1d<LatticeColorMatrix> & u,
607  qprop,
608  XMLWriter & xml_out,
609  Real RsdCG, Real Mass, int j_decay){
610 
611 
612  LatticeStaggeredFermion q_source, psi ;
613  LatticeStaggeredFermion q_source_fuzz ;
614  LatticeStaggeredPropagator quark_propagator;
615 
616  int ncg_had = 0; // count CG iterations
617 
618  psi = zero; // note this is ``zero'' and not 0
619 
620 
621 
622  for(int src_ind = 0; src_ind < 8 ; ++src_ind){
623  stag_prop[src_ind] = zero ;
624 
625  for(int color_source = 0; color_source < Nc; ++color_source) {
626 
627  ncg_had += compute_quark_propagator_s(psi,type_of_src,
628  gauge_shift, sym_shift,
629  u, qprop, xml_out,
630  RsdCG, Mass, j_decay,
631  src_ind, color_source) ;
632 
633 
634  /*
635  * Move the solution to the appropriate components
636  * of quark propagator.
637  */
638  FermToProp(psi, quark_propagator, color_source);
639  } //color_source
640 
641  stag_prop[src_ind] = quark_propagator;
642 
643  }// end src_ind
644 
645  return ncg_had;
646  }
647 
648  /***************************************************************************/
649  int
650  MakeFuzzedCornerProp(LatticeStaggeredFermion & psi,
651  int fuzz_width,
652  bool gauge_shift, bool sym_shift,
653  const multi1d<LatticeColorMatrix> & u ,
654  multi1d<LatticeColorMatrix> & u_smr,
656  qprop,
657  XMLWriter & xml_out,
658  Real RsdCG, Real Mass,
659  int j_decay,
660  bool do_fuzzing,
661  LatticeStaggeredFermion &psi_fuzz,
662  LatticeStaggeredPropagator &quark_propagator_Lsink_Lsrc,
663  LatticeStaggeredPropagator &quark_propagator_Fsink_Lsrc,
664  LatticeStaggeredPropagator &quark_propagator_Lsink_Fsrc,
665  LatticeStaggeredPropagator &quark_propagator_Fsink_Fsrc
666  ){
667 
668  // stag_src_type type_of_src = LOCAL_SRC ;
670 
671  QDPIO::cout << "LOCAL INVERSIONS" << std::endl;
672  int ncg_had = 0 ;
673 
674  for(int color_source = 0; color_source < Nc; ++color_source){
675  psi = zero; // note this is ``zero'' and not 0
676 
677  const int src_ind = 0 ;
678  ncg_had += compute_quark_propagator_s(psi,type_of_src,
679  gauge_shift, sym_shift,
680  fuzz_width,
681  u, u_smr, qprop, xml_out,
682  RsdCG, Mass,
683  j_decay, src_ind, color_source) ;
684 
685  /*
686  * Move the solution to the appropriate components
687  * of quark propagator.
688  */
689  FermToProp(psi, quark_propagator_Lsink_Lsrc, color_source);
690 
691 
692  // fuzz at the sink
693  if( do_fuzzing ) {
694  fuzz_smear(u_smr, psi, psi_fuzz, fuzz_width, j_decay) ;
695  FermToProp(psi_fuzz, quark_propagator_Fsink_Lsrc, color_source);
696  }
697  } // color_source
698 
699 
700  if( do_fuzzing ){
701  type_of_src = FUZZED_SRC ;
702 
703  QDPIO::cout << "FUZZED SOURCE INVERSIONS" << std::endl;
704 
705  for(int color_source = 0; color_source < Nc; ++color_source) {
706  psi = zero; // note this is ``zero'' and not 0
707 
708  const int src_ind = 0 ;
709 
710  ncg_had += compute_quark_propagator_s(psi,type_of_src,
711  gauge_shift, sym_shift,
712  fuzz_width,
713  u, u_smr, qprop, xml_out,
714  RsdCG, Mass, j_decay, src_ind,
715  color_source);
716 
717  /*
718  * Move the solution to the appropriate components
719  * of quark propagator.
720  */
721  FermToProp(psi, quark_propagator_Lsink_Fsrc, color_source);
722 
723 
724  // fuzz at the sink
725  fuzz_smear(u_smr, psi, psi_fuzz, fuzz_width, j_decay) ;
726  FermToProp(psi_fuzz, quark_propagator_Fsink_Fsrc, color_source);
727 
728  } //color_source
729 
730  } // end of compute fuzzed correlator
731 
732  return ncg_had;
733  }
734  /***************************************************************************/
735  int
736  MakeCornerProp(LatticeStaggeredFermion & psi,
737  bool gauge_shift, bool sym_shift,
738  const multi1d<LatticeColorMatrix> & u ,
740  XMLWriter & xml_out,
741  Real RsdCG, Real Mass,
742  int j_decay,
743  LatticeStaggeredPropagator &quark_propagator_Lsink_Lsrc,
744  stag_src_type type_of_src, int t_source = 0 ){
745 
746  // stag_src_type type_of_src = LOCAL_SRC ;
747  // stag_src_type type_of_src = GAUGE_INVAR_LOCAL_SOURCE;
748 
749  // QDPIO::cout << "LOCAL INVERSIONS" << std::endl;
750  int ncg_had = 0 ;
751 
752  for(int color_source = 0; color_source < Nc; ++color_source){
753  psi = zero; // note this is ``zero'' and not 0
754 
755  const int src_ind = 0 ;
756  ncg_had += compute_quark_propagator_s(psi,type_of_src,
757  gauge_shift, sym_shift,
758  u, qprop, xml_out,
759  RsdCG, Mass,
760  j_decay, src_ind,
761  color_source,t_source) ;
762 
763  /*
764  * Move the solution to the appropriate components
765  * of quark propagator.
766  */
767  FermToProp(psi, quark_propagator_Lsink_Lsrc, color_source);
768 
769  } // color_source
770 
771  return ncg_had;
772  }
773 
774 
775 
776  int
777  MakeCornerProp(LatticeStaggeredFermion & psi,
778  bool gauge_shift, bool sym_shift,
779  const multi1d<LatticeColorMatrix> & u ,
781  XMLWriter & xml_out,
782  Real RsdCG, Real Mass,
783  int j_decay,
784  LatticeStaggeredPropagator &quark_propagator_Lsink_Lsrc,
785  stag_src_type type_of_src, int t_source,
786  LatticeStaggeredPropagator &qsource_out){
787 
788  // stag_src_type type_of_src = LOCAL_SRC ;
789  // stag_src_type type_of_src = GAUGE_INVAR_LOCAL_SOURCE;
790  LatticeStaggeredFermion q_source ;
791 
792 
793  // QDPIO::cout << "LOCAL INVERSIONS" << std::endl;
794  int ncg_had = 0 ;
795 
796  for(int color_source = 0; color_source < Nc; ++color_source){
797  psi = zero; // note this is ``zero'' and not 0
798 
799  // load the source
800  PropToFerm(qsource_out,q_source, color_source);
801 
802  const int src_ind = 0 ;
803  ncg_had += compute_quark_propagator_s(psi,type_of_src,
804  gauge_shift, sym_shift,
805  u, qprop, xml_out,
806  RsdCG, Mass,
807  j_decay, src_ind,
808  color_source,t_source,q_source) ;
809 
810  /*
811  * Move the solution to the appropriate components
812  * of quark propagator.
813  */
814  FermToProp(psi, quark_propagator_Lsink_Lsrc, color_source);
815 
816 
817 
818  } // color_source
819 
820  return ncg_had;
821  }
822 
823 
824 
825 
826 
827  int
828  MakeCornerProp(LatticeStaggeredFermion & psi_1,
829  bool gauge_shift, bool sym_shift,
830  const multi1d<LatticeColorMatrix> & u ,
833  XMLWriter & xml_out,
834  Real RsdCG, Real Mass_1,Real Mass_2,
835  int j_decay,
836  LatticeStaggeredPropagator &quark_propagator_Lsink_Lsrc_1,
837  LatticeStaggeredPropagator &quark_propagator_Lsink_Lsrc_2,
838  stag_src_type type_of_src, int t_source = 0 ){
839 
840  LatticeStaggeredFermion psi_2 ;
841  int ncg_had = 0 ;
842 
843  for(int color_source = 0; color_source < Nc; ++color_source){
844  psi_1 = zero; // note this is ``zero'' and not 0
845  psi_2 = zero; // note this is ``zero'' and not 0
846 
847  const int src_ind = 0 ;
848  ncg_had += compute_quark_propagator_s(psi_1,psi_2,type_of_src,
849  gauge_shift, sym_shift,
850  u, qprop_1,qprop_2, xml_out,
851  RsdCG, Mass_1,Mass_2,
852  j_decay, src_ind,
853  color_source,t_source) ;
854 
855  /*
856  * Move the solution to the appropriate components
857  * of quark propagator.
858  */
859  FermToProp(psi_1, quark_propagator_Lsink_Lsrc_1, color_source);
860  FermToProp(psi_2, quark_propagator_Lsink_Lsrc_2, color_source);
861 
862  } // color_source
863 
864  return ncg_had;
865  }
866 
867 
868  /* Also store the random source for additional inversions
869 
870 
871  */
872 
873  int
874  MakeCornerProp(LatticeStaggeredFermion & psi_1,
875  bool gauge_shift, bool sym_shift,
876  const multi1d<LatticeColorMatrix> & u ,
879  XMLWriter & xml_out,
880  Real RsdCG, Real Mass_1,Real Mass_2,
881  int j_decay,
882  LatticeStaggeredPropagator &quark_propagator_Lsink_Lsrc_1,
883  LatticeStaggeredPropagator &quark_propagator_Lsink_Lsrc_2,
884  stag_src_type type_of_src, int t_source,
885  LatticeStaggeredPropagator &qsource_out ){
886 
887  LatticeStaggeredFermion psi_2 ;
888  LatticeStaggeredFermion q_source ;
889 
890 
891  int ncg_had = 0 ;
892 
893  for(int color_source = 0; color_source < Nc; ++color_source){
894  psi_1 = zero; // note this is ``zero'' and not 0
895  psi_2 = zero; // note this is ``zero'' and not 0
896 
897  // load the source
898  PropToFerm( qsource_out, q_source,color_source);
899 
900 
901  const int src_ind = 0 ;
902  ncg_had += compute_quark_propagator_s(psi_1,psi_2,type_of_src,
903  gauge_shift, sym_shift,
904  u, qprop_1,qprop_2, xml_out,
905  RsdCG, Mass_1,Mass_2,
906  j_decay, src_ind,
907  color_source,t_source,q_source) ;
908 
909  /*
910  * Move the solution to the appropriate components
911  * of quark propagator.
912  */
913  FermToProp(psi_1, quark_propagator_Lsink_Lsrc_1, color_source);
914  FermToProp(psi_2, quark_propagator_Lsink_Lsrc_2, color_source);
915 
916 
917  // save the source
918  FermToProp(q_source, qsource_out, color_source);
919 
920  } // color_source
921 
922  return ncg_had;
923  }
924 
925 
926 
927  /***************************************************************************/
928 
929  void
930  DoFuzzing(const multi1d<LatticeColorMatrix> & u,
931  multi1d<LatticeColorMatrix> & u_smr,
932  int j_decay){
933 
934  QDPIO::cout << "Starting to APE smear the gauge configuration" << std::endl;
935 
936  Real sm_fact = 2.5; // typical parameter
937  int sm_numb = 10; // number of smearing hits
938 
939  int BlkMax = 100; // max iterations in max-ing trace
940  Real BlkAccu = 1.0e-5; // accuracy of max-ing
941 
942  u_smr = u;
943  for(int i=0; i < sm_numb; ++i){
944  multi1d<LatticeColorMatrix> u_tmp(Nd);
945 
946  for(int mu = 0; mu < Nd; ++mu){
947  if ( mu != j_decay ){
948  APE_Smear(u_smr, u_tmp[mu], mu, 0, sm_fact, BlkAccu, BlkMax,
949  j_decay);
950  }else{
951  u_tmp[mu] = u_smr[mu];
952  }
953  }
954  u_smr = u_tmp;
955  }
956 
957 
958 
959  }
960 
961 
962  /***************************************************************************/
963 
964  // Function call
965  void
966  InlineStaggeredSpectrum::operator()(unsigned long update_no,
967  XMLWriter& xml_out) {
968  // If xml file not empty, then use alternate
969  if (params.xml_file != ""){
970  std::string xml_file = makeXMLFileName(params.xml_file, update_no);
971 
972  push(xml_out, "spectrum_s");
973  write(xml_out, "update_no", update_no);
974  write(xml_out, "xml_file", xml_file);
975  pop(xml_out);
976 
977  XMLFileWriter xml(xml_file);
978  func(update_no, xml);
979  }
980  else
981  {
982  func(update_no, xml_out);
983  }
984  }
985 
986 
987  /*** **/
988 
989  void meson_charm(LatticeStaggeredPropagator & quark_prop,
990  XMLWriter& xml_out,
991  const multi1d<LatticeColorMatrix> & u,
992  int t_source, int j_decay, int t_length)
993  {
994  push(xml_out, "local_meson_charm_correlators");
995 
996  // local pseudoscalar pion
997  staggered_local_pion pion(t_length,u) ;
998  pion.compute(quark_prop,quark_prop,j_decay) ;
999  pion.dump(t_source,xml_out) ;
1000 
1001  bool avg_equiv_mom = true ;
1002  int mom2_max = 2 ;
1003  // non-zero momentum
1004  multi1d<int> tsrc(4) ;
1005  tsrc[0] = tsrc[1] = tsrc[2] = tsrc[3] = 0 ;
1006  tsrc[j_decay] = t_source ;
1007 
1008  SftMom phases(mom2_max, tsrc, avg_equiv_mom,j_decay);
1009 
1010 
1011  pion.compute_and_dump(quark_prop,quark_prop,j_decay,t_source,
1012  phases,xml_out) ;
1013 
1014  // ( gamma_4 gamma_5 cross gamma_4 gamma_5 ) pion
1015  g4g5_x_g4g5_local_meson pion_g4g5(t_length,u) ;
1016  pion_g4g5.compute(quark_prop,quark_prop,j_decay) ;
1017  pion_g4g5.dump(t_source,xml_out) ;
1018 
1019  // Vector mesons
1020  vector_meson Vector(t_length, u) ;
1021  Vector.compute(quark_prop,j_decay);
1022  Vector.dump(t_source,xml_out);
1023 
1024  pop(xml_out);
1025 
1026  }
1027 
1028 
1029  /**
1030  Non-degenerate noisy heavy-light pseudoscalars
1031 
1032  **/
1033 
1034  void noisy_pion_nondegen(LatticeStaggeredPropagator & quark_prop_1,
1035  Real Mass1,
1036  LatticeStaggeredPropagator & quark_prop_2,
1037  Real Mass2,
1038  XMLWriter& xml_out,
1039  const multi1d<LatticeColorMatrix> & u,
1040  int t_source, int j_decay, int t_length)
1041  {
1042  push(xml_out, "non_degenerate_noisy_pseudoscalar_correlators");
1043 
1044  // local pseudoscalar pion
1045  push(xml_out, "meson_11");
1046  write(xml_out,"Mass",Mass1);
1047  staggered_local_pion pion_1(t_length,u) ;
1048  pion_1.compute(quark_prop_1,quark_prop_1,j_decay) ;
1049  pion_1.dump(t_source,xml_out) ;
1050  pop(xml_out);
1051 
1052  push(xml_out, "meson_22");
1053  write(xml_out,"Mass",Mass2);
1054  staggered_local_pion pion_2(t_length,u) ;
1055  pion_2.compute(quark_prop_2,quark_prop_2,j_decay) ;
1056  pion_2.dump(t_source,xml_out) ;
1057  pop(xml_out);
1058 
1059  push(xml_out, "meson_12");
1060  write(xml_out,"Mass1",Mass1);
1061  write(xml_out,"Mass2",Mass2);
1062  staggered_local_pion pion_12(t_length,u) ;
1063  pion_12.compute(quark_prop_1,quark_prop_2,j_decay) ;
1064  pion_12.dump(t_source,xml_out) ;
1065  pop(xml_out);
1066 
1067 
1068  //-----------------------
1069  pop(xml_out);
1070 
1071  }
1072 
1073 
1074 
1075 
1076 
1077 
1078  /***************************************************************************/
1079 
1080  // Real work done here
1081  void
1082  InlineStaggeredSpectrum::func(unsigned long update_no,
1083  XMLWriter& xml_out)
1084  {
1085  START_CODE();
1086 
1087  StopWatch snoop;
1088  snoop.reset();
1089  snoop.start();
1090 
1091  // Test and grab a reference to the gauge field
1092  XMLBufferWriter gauge_xml;
1093  try
1094  {
1095  TheNamedObjMap::Instance().getData< multi1d<LatticeColorMatrix> >(params.named_obj.gauge_id);
1096  TheNamedObjMap::Instance().get(params.named_obj.gauge_id).getRecordXML(gauge_xml);
1097  }
1098  catch( std::bad_cast )
1099  {
1100  QDPIO::cerr << InlineStaggeredSpectrumEnv::name << ": caught dynamic cast error"
1101  << std::endl;
1102  QDP_abort(1);
1103  }
1104  catch (const std::string& e)
1105  {
1106  QDPIO::cerr << InlineStaggeredSpectrumEnv::name << ": std::map call failed: " << e
1107  << std::endl;
1108  QDP_abort(1);
1109  }
1110  const multi1d<LatticeColorMatrix>& u =
1111  TheNamedObjMap::Instance().getData< multi1d<LatticeColorMatrix> >(params.named_obj.gauge_id);
1112 
1113  QDPIO::cout << InlineStaggeredSpectrumEnv::name << ": Spectroscopy for Staggered-like fermions"
1114  << std::endl;
1115  QDPIO::cout << "Gauge group: SU(" << Nc << ")" << std::endl;
1116 
1117  push(xml_out, "spectrum_s");
1118  write(xml_out, "update_no", update_no);
1119 
1120  /* set some flags **/
1121 
1122  bool do_Baryon_local = params.param.Baryon_local;
1123  bool do_ps4_singlet = params.param.ps4link_singlet_conn;
1124  bool do_ps4_singlet_fuzz = params.param.ps4link_singlet_conn_fuzz;
1125  bool Meson_local = params.param.Meson_local ;
1126  bool Meson_charm_local = params.param.Meson_charm_local ;
1127  bool Meson_charm_noisy_local = params.param.Meson_charm_noisy_local ;
1128  bool Wilson_loops = params.param.Wilson_loops ;
1129  bool Pion_nondegen_noisy_local = params.param.Pion_nondegen_noisy_local ;
1130 
1131  bool Pion_nondegen_noisy_local2 = params.param.Pion_nondegen_noisy_local2 ;
1132  bool Pion_nondegen_noisy_local3 = params.param.Pion_nondegen_noisy_local3 ;
1133  bool Pion_nondegen_noisy_local4 = params.param.Pion_nondegen_noisy_local4 ;
1134 
1135  bool do_Baryon_vary = params.param.Baryon_vary ;
1136  bool do_LocalPion_vary = params.param.LocalPion_vary;
1137  bool do_LocalScalar_vary = params.param.LocalScalar_vary;
1138  bool do_8_pions = params.param.eight_pions;
1139  bool do_8_scalars = params.param.eight_scalars;
1140  bool do_8_rhos = params.param.eight_rhos;
1141  bool do_fuzzed_disc_loops = params.param.disconnected_fuzz ;
1142  bool do_local_disc_loops = params.param.disconnected_local ;
1143 
1144  //change this to do stochastic connected loops
1145  bool do_stoch_conn_corr = false;
1146 
1147  bool do_fuzzing = false;
1148  bool do_variational_spectra = false;
1149 
1150  bool need_basic_8 = false;
1151 
1152  bool need_fuzzed_corner_prop = false;
1153 
1154  bool done_ps4_singlet = false;
1155  bool done_ps4_singlet_fuzz = false;
1156  bool done_local_baryons = false;
1157  bool done_fuzzed_baryons = false;
1158  bool done_local_disc_loops = false;
1159  bool done_fuzzed_disc_loops = false;
1160  bool done_meson_corr = false;
1161  bool done_meson_charm_corr = false;
1162 
1163  //shouldnt be hard-coded
1164  stag_src_type type_of_src = GAUGE_INVAR_LOCAL_SOURCE ;
1165 
1166 
1167  if( ( do_Baryon_vary || do_LocalPion_vary || do_LocalScalar_vary )||
1168  (do_fuzzed_disc_loops||do_ps4_singlet_fuzz)){
1169  // need smeared links
1170  do_fuzzing = true ;
1171  }
1172 
1173  if (( do_Baryon_vary || do_LocalPion_vary)||(do_ps4_singlet_fuzz) || do_LocalScalar_vary ) {
1174 
1175  // make the fuzzed corner props
1176  // (LsrcLsnk, LsrcFsnk,FsrcLsink,FsrcFsnk)
1177 
1178  do_variational_spectra = true;
1179  }
1180 
1181  if( do_8_pions || do_8_scalars || do_8_rhos){
1182  need_basic_8 = true;
1183  }
1184 
1185 
1186  int ncg_had = 0; // tally of all CG iterations
1187 
1188 
1189  bool gauge_shift = true;
1190  bool sym_shift = true;
1191  bool loop_checkpoint = false;
1192  const int j_decay = Nd-1;
1193  int Nsamp;
1194  int CFGNO;
1195  VolSrc_type volume_source;
1196  int src_seperation;
1197  int t_length;
1198 
1199 
1200  gauge_shift = params.param.gauge_invar_oper; // use covar shift?
1201  sym_shift = params.param.sym_shift_oper; // use symm shift?
1202  loop_checkpoint = params.param.loop_checkpoint; // write all meas?
1203  Nsamp = params.param.Nsamp; // # of stoch srcs
1204  CFGNO = params.param.CFGNO; // seed
1205  volume_source = params.param.volume_source; // type of vol src
1206  src_seperation = params.param.src_seperation; // sep of dilute srcs
1207  t_length = params.param.nrow[j_decay]; // length of t dir
1208  Real RsdCG = params.prop_param.invParam.RsdCG;// CG residual
1209  // Real Mass = params.prop_param.Mass; // fermion mass
1210  Real Mass ;
1211  int fuzz_width = params.param.fuzz_width; // fuzzing width
1212  int t_source = params.param.t_srce[j_decay]; // source t coord
1213 
1214  /*
1215  * Sanity checks
1216  */
1217 
1218 
1219  QDPIO::cout << "Volume: " << params.param.nrow[0];
1220  for (int i=1; i<Nd; ++i) {
1221  QDPIO::cout << " x " << params.param.nrow[i];
1222  }
1223  QDPIO::cout << std::endl;
1224 
1225  proginfo(xml_out); // Print out basic program info
1226 
1227 
1228  // Write out the input
1229  params.write(xml_out, "Input");
1230 
1231  // Write out the config info
1232  write(xml_out, "Config_info", gauge_xml);
1233 
1234  push(xml_out, "Output_version");
1235  write(xml_out, "out_version", 1);
1236  pop(xml_out);
1237 
1238  // First calculate some gauge invariant observables just for info.
1239  MesPlq(xml_out, "Observables", u);
1240 
1241  // Typedefs to save typing
1242  typedef LatticeStaggeredFermion T;
1243  typedef multi1d<LatticeColorMatrix> P;
1244  typedef multi1d<LatticeColorMatrix> Q;
1245 
1246 #if 0
1247  // Create a fermion state
1248  // boundary has been deleted
1250 
1251  // Initialize fermion action
1252  AsqtadFermActParams asq_param;
1253  asq_param.Mass = params.prop_param.Mass;
1254  asq_param.u0 = params.prop_param.u0;
1255  AsqtadFermAct S_f(cfs, asq_param);
1256  Handle< FermState<T,P,Q> > state(S_f.createState(u));
1257 #endif
1258 
1259  //
1260  // Initialize fermion action
1261  //
1262 
1263  XMLReader fermact_reader ;
1264  // Make a memory 'input stream' out of the XML, so we can open an
1265  // XML Reader on it.
1266  try{
1267  std::istringstream is(params.param.fermact.xml);
1268 
1269  // Open a reader on the memory stream.
1270  // XMLReader fermact_reader(is);
1271  fermact_reader.open(is);
1272  }
1273  catch (...)
1274  {
1275  QDPIO::cerr << "Error reading action name " << std::endl;
1276  throw;
1277  }
1278 
1281  fermact_reader,
1283  // Cast of a pointer to a reference?
1284  StaggeredTypeFermAct<T,P,Q>& S_f= *(fermact);
1285 
1286  Mass = S_f.getQuarkMass() ;
1287  params.prop_param.Mass = S_f.getQuarkMass() ;
1288 
1289  // Set up a state for the current u,
1290  // (compute fat & triple links)
1291  // Use S_f.createState so that S_f can pass in u0
1292 
1293  Handle< FermState<T,P,Q> > state(S_f.createState(u));
1294 
1295  // Jiggery-pokery to turn a CG struct into a GroupXML_t for the qprops
1296  GroupXML_t inv_param;
1297  {
1298  XMLBufferWriter xml_buf;
1299  write(xml_buf, "InvertParam", params.prop_param.invParam);
1300  XMLReader xml_in(xml_buf);
1301  inv_param = readXMLGroup(xml_in, "/InvertParam", "invType");
1302  }
1304  qprop(S_f.qprop(state, inv_param));
1305 
1306 
1307 
1308  //
1309  // local inversions
1310  //
1311  LatticeStaggeredFermion psi ;
1312  LatticeStaggeredFermion q_source ;
1313 
1314 
1315  if( Wilson_loops )
1316  {
1317  // push(xml_out, "Wilson_loops") ;
1318  Wloop(xml_out,"Wilson_loops", u) ;
1319  // pop(xml_out);
1320  }
1321 
1322 
1323 
1324  // Do local disconnected loops if we are not going to do fuzzed
1325  // disconnected loops.
1326 
1327  if ((( do_local_disc_loops ) && (do_stoch_conn_corr )) &&
1328  (!do_fuzzed_disc_loops)){
1329  push(xml_out, "disconnected_loops");
1330 
1331  StopWatch swatch;
1332  swatch.start();
1333  ks_local_loops_and_stoch_conn(qprop, q_source, psi , u, xml_out,
1334  gauge_shift, sym_shift, loop_checkpoint,
1335  t_length, Mass, Nsamp, RsdCG, CFGNO,
1336  volume_source, src_seperation, j_decay);
1337  swatch.stop();
1338  double time_in_sec = swatch.getTimeInSeconds();
1339  QDPIO::cout << "PROF1:ks_local_loops_and_stoch_conn" << time_in_sec << " sec" << std::endl;
1340 
1341  pop(xml_out);
1342 
1343  done_local_disc_loops = true;
1344  }
1345 
1346 
1347  if((( do_local_disc_loops ) && (!done_local_disc_loops))&&
1348  (!do_fuzzed_disc_loops)){
1349  push(xml_out, "disconnected_loops");
1350 
1351  StopWatch swatch;
1352  swatch.start();
1353  ks_local_loops(qprop, q_source, psi , u, xml_out,
1354  gauge_shift, sym_shift, loop_checkpoint,
1355  t_length, Mass, Nsamp, RsdCG, CFGNO, volume_source,
1356  src_seperation, j_decay);
1357 
1358  swatch.stop();
1359  double time_in_sec = swatch.getTimeInSeconds();
1360  QDPIO::cout << "PROF2:ks_local_loops " << time_in_sec << " sec" << std::endl;
1361 
1362  done_local_disc_loops = true;
1363 
1364  pop(xml_out);
1365  }
1366 
1367 
1368 
1369  if (need_basic_8 ){
1370  //Dont need to allocate u_smr here
1371 
1372  multi1d<LatticeStaggeredPropagator> stag_prop(8);
1373 
1374  StopWatch swatch;
1375  swatch.start();
1376  ncg_had += build_basic_8_props(stag_prop, type_of_src, gauge_shift,
1377  sym_shift, u, qprop, xml_out, RsdCG,
1378  Mass, j_decay);
1379  swatch.stop();
1380  double time_in_sec = swatch.getTimeInSeconds();
1381  QDPIO::cout << "PROF3:build_basic_8_props " << time_in_sec << " sec" << std::endl;
1382 
1383 
1384  // put the spectrum calls here
1385  if(do_8_pions){
1386  // do pion stuff
1387 
1388  StopWatch swatch;
1389  swatch.start();
1390  compute_8_pions( stag_prop, u , gauge_shift, sym_shift,
1391  xml_out, j_decay, t_length, t_source,
1394 
1395  swatch.stop();
1396  double time_in_sec = swatch.getTimeInSeconds();
1397  QDPIO::cout << "PROF4:compute_8_pions " << time_in_sec << " sec" << std::endl;
1398 
1399  }
1400  if(do_8_scalars){
1401  // do scalar stuff
1402  compute_8_scalars( stag_prop, u, gauge_shift, sym_shift,
1403  xml_out, j_decay, t_length, t_source,
1406 
1407  }
1408  if(do_8_rhos){
1409  // do Vector stuff
1410  compute_8_vectors( stag_prop, u, gauge_shift, sym_shift,
1411  xml_out, j_decay, t_length, t_source,
1414  }
1415 
1416 
1417  // if we need to do 4-link singlets and local baryons, do them here
1418  // so we can re-use the stag_pro[0] as the local corner prop
1419 
1420  if((( do_ps4_singlet ) && (!done_ps4_singlet))&&(!do_ps4_singlet_fuzz)) {
1421  //only do the non-fuzzed ps singlet if we are not doing the fuzzed
1422  // ps singlet connected, as the latter does both
1423 
1424  StopWatch swatch;
1425  swatch.start();
1426 
1427  type_of_src = GAUGE_INVAR_LOCAL_SOURCE ;
1428  ncg_had +=
1429  compute_singlet_ps(psi,stag_prop[0], type_of_src, gauge_shift,
1430  sym_shift, u, qprop, xml_out, RsdCG,Mass,
1431  j_decay, t_source, t_length);
1432 
1433  done_ps4_singlet = true;
1434  swatch.stop();
1435  double time_in_sec = swatch.getTimeInSeconds();
1436  QDPIO::cout << "PROF5:compute_singlet_ps " << time_in_sec << " sec" << std::endl;
1437 
1438 
1439  }
1440 
1441 
1442  if((( do_Baryon_local) &&(!done_local_baryons)) && (!do_Baryon_vary)) {
1443 
1444  push(xml_out, "baryon_correlators");
1445 
1446  // describe the source
1447  std::string NN ;
1448  write(xml_out, "source_time", t_source);
1449  push(xml_out, "smearing_info");
1450  NN = "L" ;
1451  write_smearing_info(NN, LOCAL_SRC,xml_out, fuzz_width) ;
1452  pop(xml_out);
1453  std::string b_tag("srcLLL_sinkLLL_nucleon") ;
1454  std::string b_filename(params.param.binary_name+b_tag);
1455  ks_compute_baryon(b_tag,stag_prop[0],stag_prop[0],stag_prop[0],
1456  xml_out, j_decay, t_length,
1457  params.param.binary_baryon_dump,b_filename) ;
1458 
1459  pop(xml_out);
1460  done_local_baryons = true;
1461  }
1462 
1463 
1464  } // basic 8
1465 
1466 
1467 
1468  // fuzz the gauge configuration. if needed
1469 
1470  if( do_fuzzing ){
1471 
1472  LatticeStaggeredFermion psi_fuzz ;
1473  multi1d<LatticeColorMatrix> u_smr(Nd);
1474 
1475  u_smr = u ;
1476 
1477  {
1478  StopWatch swatch;
1479  swatch.start();
1480  DoFuzzing(u, u_smr, j_decay);
1481  swatch.stop();
1482  double time_in_sec = swatch.getTimeInSeconds();
1483  QDPIO::cout << "PROF6: DoFuzzing " << time_in_sec << " sec" << std::endl;
1484  }
1485 
1486  if ( do_variational_spectra ){
1487 
1488  // only allocate these if needed
1489  LatticeStaggeredPropagator quark_propagator_Lsink_Lsrc;
1490  LatticeStaggeredPropagator quark_propagator_Fsink_Lsrc ;
1491  LatticeStaggeredPropagator quark_propagator_Lsink_Fsrc ;
1492  LatticeStaggeredPropagator quark_propagator_Fsink_Fsrc ;
1493 
1494  {
1495  StopWatch swatch;
1496  swatch.start();
1497 
1498  ncg_had+= MakeFuzzedCornerProp(psi, fuzz_width, gauge_shift,
1499  sym_shift, u, u_smr, qprop,
1500  xml_out, RsdCG, Mass, j_decay,
1501  do_fuzzing, psi_fuzz,
1502  quark_propagator_Lsink_Lsrc,
1503  quark_propagator_Fsink_Lsrc,
1504  quark_propagator_Lsink_Fsrc,
1505  quark_propagator_Fsink_Fsrc );
1506  swatch.stop();
1507  double time_in_sec = swatch.getTimeInSeconds();
1508  QDPIO::cout << "PROF7:MakeFuzzedCornerProp " << time_in_sec << " sec" << std::endl;
1509 
1510  }
1511 
1512 
1513  {
1514 
1515  //testing crap
1516  DComplex productLL;
1517  DComplex productLF;
1518  DComplex productFL;
1519  DComplex productFF;
1520 
1521  LatticeComplex test_corr_fnLL;
1522  LatticeComplex test_corr_fnLF;
1523  LatticeComplex test_corr_fnFL;
1524  LatticeComplex test_corr_fnFF;
1525 
1526  test_corr_fnLL = trace(adj(quark_propagator_Lsink_Lsrc)
1527  *quark_propagator_Lsink_Lsrc);
1528  test_corr_fnFL = trace(adj(quark_propagator_Fsink_Lsrc)
1529  *quark_propagator_Fsink_Lsrc);
1530  test_corr_fnLF = trace(adj(quark_propagator_Lsink_Fsrc)
1531  *quark_propagator_Lsink_Fsrc);
1532  test_corr_fnFF = trace(adj(quark_propagator_Fsink_Fsrc)
1533  *quark_propagator_Fsink_Fsrc);
1534 
1535  productLL = sum(test_corr_fnLL);
1536  productFL = sum(test_corr_fnFL);
1537  productLF = sum(test_corr_fnLF);
1538  productFF = sum(test_corr_fnFF);
1539 
1540  QDPIO::cout << "product of LL= " << productLL << std::endl;
1541  QDPIO::cout << "product of FL= " << productFL << std::endl;
1542  QDPIO::cout << "product of LF= " << productLF << std::endl;
1543  QDPIO::cout << "product of FF= " << productFF << std::endl;
1544  // one copy on output
1545  }
1546 
1547 
1548 
1549 
1550  if( do_Baryon_vary ) {
1551 
1553  fuzz_width,
1554  j_decay,t_length,
1555  quark_propagator_Lsink_Lsrc,
1556  quark_propagator_Fsink_Lsrc,
1557  quark_propagator_Lsink_Fsrc,
1558  quark_propagator_Fsink_Fsrc,
1561 
1562  done_local_baryons = true;
1563  done_fuzzed_baryons = true;
1564 
1565  }
1566 
1567 
1568  if( do_LocalPion_vary ) {
1569  compute_vary_ps(quark_propagator_Lsink_Lsrc,
1570  quark_propagator_Fsink_Lsrc,
1571  quark_propagator_Lsink_Fsrc,
1572  quark_propagator_Fsink_Fsrc,
1573  u, gauge_shift, sym_shift,
1574  xml_out,j_decay,
1575  t_length,t_source);
1576  }
1577 
1578 
1579  if( do_LocalScalar_vary ) {
1580  compute_vary_scalar(quark_propagator_Lsink_Lsrc,
1581  quark_propagator_Fsink_Lsrc,
1582  quark_propagator_Lsink_Fsrc,
1583  quark_propagator_Fsink_Fsrc,
1584  u, gauge_shift, sym_shift,
1585  xml_out,j_decay,
1586  t_length,t_source);
1587  }
1588 
1589  if(( do_ps4_singlet_fuzz ) && (!done_ps4_singlet_fuzz)) {
1590 
1591 
1592  ncg_had +=
1593  compute_vary_singlet_ps(psi, quark_propagator_Lsink_Lsrc,
1594  quark_propagator_Fsink_Lsrc,
1595  quark_propagator_Lsink_Fsrc,
1596  quark_propagator_Fsink_Fsrc,
1597  type_of_src, gauge_shift, sym_shift, u ,
1598  u_smr , qprop, xml_out, RsdCG, Mass,
1599  j_decay, t_source, t_length,fuzz_width);
1600 
1601  done_ps4_singlet = true;
1602  done_ps4_singlet_fuzz = true;
1603 
1604  }
1605 
1606 
1607  // if we need to do local 4-link singlets and local baryons,
1608  // do them here so we can re-use quark_propagator_Lsink_Lsrc
1609  // as the local corner prop
1610 
1611  if(( do_ps4_singlet ) && (!done_ps4_singlet)) {
1612  type_of_src = GAUGE_INVAR_LOCAL_SOURCE ;
1613 
1614  ncg_had +=
1615  compute_singlet_ps(psi,quark_propagator_Lsink_Lsrc, type_of_src,
1616  gauge_shift, sym_shift, u, qprop, xml_out,
1617  RsdCG, Mass, j_decay, t_source, t_length);
1618 
1619  done_ps4_singlet = true;
1620  }
1621 
1622 
1623  if(( do_Baryon_local) &&(!done_local_baryons)) {
1624 
1625  push(xml_out, "baryon_correlators");
1626 
1627  // describe the source
1628  std::string NN ;
1629  write(xml_out, "source_time", t_source);
1630  push(xml_out, "smearing_info");
1631  NN = "L" ;
1632  write_smearing_info(NN, LOCAL_SRC,xml_out, fuzz_width) ;
1633  pop(xml_out);
1634  std::string b_tag("srcLLL_sinkLLL_nucleon") ;
1635  ks_compute_baryon(b_tag,quark_propagator_Lsink_Lsrc,
1636  quark_propagator_Lsink_Lsrc,
1637  quark_propagator_Lsink_Lsrc,
1638  xml_out, j_decay, t_length,
1641 
1642  pop(xml_out);
1643  done_local_baryons = true;
1644  }
1645 
1646 
1647  }// do_variational_spectra
1648 
1649 
1650 
1651  // still have the smeared links if needed for fuzzed loops
1652 
1653  if(( do_fuzzed_disc_loops )&&(!done_fuzzed_disc_loops)) {
1654  push(xml_out, "disconnected_loops");
1655 
1656  StopWatch swatch;
1657  swatch.start();
1658 
1659  ks_fuzz_loops(qprop,q_source, psi ,psi_fuzz , u, u_smr,xml_out,
1660  gauge_shift, sym_shift, loop_checkpoint, t_length, Mass,
1661  Nsamp, RsdCG, CFGNO, volume_source, fuzz_width,
1662  src_seperation, j_decay,
1665  swatch.stop();
1666  double time_in_sec = swatch.getTimeInSeconds();
1667  QDPIO::cout << "PROF9:ks_fuzz_loops " << time_in_sec << " sec" << std::endl;
1668 
1669 
1670  /* for testing
1671 
1672  ks_fuzz_loops_stoch_conn(qprop,q_source,psi ,psi_fuzz ,u,u_smr,
1673  xml_out, gauge_shift, sym_shift,
1674  loop_checkpoint, t_length, Mass, Nsamp,
1675  RsdCG, CFGNO, volume_source, fuzz_width,
1676  src_seperation, j_decay);
1677  */
1678  pop(xml_out);
1679  done_local_disc_loops = true;
1680  done_fuzzed_disc_loops = true;
1681  }
1682 
1683 
1684  } // do fuzzing
1685 
1686 
1687 
1688 
1689  //might still need to local pions or baryons
1690 
1691  if((( do_ps4_singlet ) && (!done_ps4_singlet)) ||
1692  (( do_Baryon_local) &&(!done_local_baryons)) ||
1693  ( Meson_local && ! done_meson_corr ) ||
1694  ( Meson_charm_local && ! done_meson_charm_corr)
1695  )
1696  {
1697 
1698  //still need to compute local corner propagator
1699  LatticeStaggeredPropagator local_corner_prop;
1700 
1701  ncg_had +=
1702  MakeCornerProp(psi, gauge_shift, sym_shift, u , qprop, xml_out, RsdCG,
1703  Mass, j_decay,
1704  local_corner_prop, type_of_src, t_source);
1705 
1706 
1707 
1708  if(( do_ps4_singlet ) && (!done_ps4_singlet)) {
1709  type_of_src = GAUGE_INVAR_LOCAL_SOURCE ;
1710 
1711  ncg_had +=
1712  compute_singlet_ps(psi,local_corner_prop, type_of_src, gauge_shift,
1713  sym_shift, u, qprop, xml_out, RsdCG, Mass,
1714  j_decay, t_source, t_length);
1715 
1716  done_ps4_singlet = true;
1717  }
1718 
1719 
1720  if(( do_Baryon_local) &&(!done_local_baryons)) {
1721 
1722  push(xml_out, "baryon_correlators");
1723 
1724  // describe the source
1725  std::string NN ;
1726  write(xml_out, "source_time", t_source);
1727  push(xml_out, "smearing_info");
1728  NN = "L" ;
1729  write_smearing_info(NN, LOCAL_SRC,xml_out, fuzz_width) ;
1730  pop(xml_out);
1731  std::string b_tag("srcLLL_sinkLLL_nucleon") ;
1732  ks_compute_baryon(b_tag,local_corner_prop, local_corner_prop,
1733  local_corner_prop, xml_out, j_decay, t_length,
1736 
1737  pop(xml_out);
1738  done_local_baryons = true;
1739  }
1740 
1741  // local meson correlators
1742  if( !done_meson_corr && Meson_local )
1743  {
1744  push(xml_out, "local_meson_correlators");
1745  staggered_local_pion pion(t_length,u) ;
1746  pion.compute(local_corner_prop,local_corner_prop,j_decay) ;
1747  pion.dump(t_source,xml_out) ;
1748  pop(xml_out);
1749  done_meson_corr = true ;
1750  }
1751 
1752 
1753  // local meson correlators
1754  if( !done_meson_charm_corr && Meson_charm_local )
1755  {
1756  meson_charm(local_corner_prop,
1757  xml_out, u,t_source,j_decay,t_length) ;
1758 
1759  done_meson_charm_corr = true ;
1760  }
1761 
1762 
1763  } // end if-then compute quark propagator
1764 
1765 
1766  if( Meson_charm_noisy_local
1767  || Pion_nondegen_noisy_local
1768  || Pion_nondegen_noisy_local2
1769  || Pion_nondegen_noisy_local3
1770  || Pion_nondegen_noisy_local4
1771  )
1772  {
1773  int seed = t_source + t_length * CFGNO ;
1774  RNG::setrn(seed);
1775  QDPIO::cout << "Seeded RNG for noisy time slice source " << seed << std::endl;
1776  QDPIO::cout << "Set from t_source " << t_source << " CFG " << CFGNO << "\n" ;
1777  }
1778 
1779 
1780  // compute wall source
1781  if( Meson_charm_noisy_local )
1782  {
1783  push(xml_out, "noisy_local_meson_correlators");
1784 
1785  LatticeStaggeredPropagator noisy_corner_prop;
1786 
1787  QDPIO::cout << "Starting inversion for noisy wall source \n" ;
1788  ncg_had +=
1789  MakeCornerProp(psi, gauge_shift, sym_shift, u , qprop, xml_out, RsdCG,
1790  Mass, j_decay,
1791  noisy_corner_prop, NOISY_LOCAL_SOURCE , t_source);
1792 
1793 
1794  meson_charm(noisy_corner_prop,xml_out, u,t_source,j_decay,t_length) ;
1795 
1796  pop(xml_out);
1797  }
1798 
1799  LatticeStaggeredPropagator quark_source_nondegen ;
1800  LatticeStaggeredPropagator noisy_corner_prop_strange;
1801 
1802 
1803  if( Pion_nondegen_noisy_local )
1804  {
1805  push(xml_out, "noisy_local_nondegen_meson_correlators");
1806  QDPIO::cout << "Setting up second inverter for nondegen\n" ;
1807 
1808  // create second inverter for different mass
1809  XMLReader fermact_reader2 ;
1810  try{
1811  std::istringstream is(params.param.fermact2.xml);
1812  fermact_reader2.open(is);
1813  }
1814  catch (...)
1815  {
1816  QDPIO::cerr << "Error reading SECOND action name " << std::endl;
1817  throw;
1818  }
1819 
1822  fermact_reader2,params.param.fermact2.path));
1823 
1824  StaggeredTypeFermAct<T,P,Q>& S_f2= *(fermact2);
1825  Handle< FermState<T,P,Q> > state2(S_f2.createState(u));
1826 
1828  qprop2(S_f2.qprop(state, inv_param));
1829 
1830  Real Mass2 = S_f2.getQuarkMass() ;
1831  Real Mass1 = S_f.getQuarkMass() ;
1832 
1833 
1834  LatticeStaggeredPropagator noisy_corner_prop_2;
1835 
1836  type_of_src = GAUGE_INVAR_LOCAL_SOURCE ;
1837  // type_of_src = NOISY_LOCAL_SOURCE ;
1838 
1839  QDPIO::cout << "Starting non-degen inversions for local source\n" ;
1840  ncg_had +=
1841  MakeCornerProp(psi, gauge_shift, sym_shift, u , qprop, qprop2,
1842  xml_out, RsdCG,
1843  Mass1, Mass2, j_decay,
1844  noisy_corner_prop_strange, noisy_corner_prop_2,
1845  type_of_src , t_source,quark_source_nondegen);
1846 
1847  noisy_pion_nondegen(noisy_corner_prop_strange,Mass1,
1848  noisy_corner_prop_2,Mass2,
1849  xml_out, u,t_source,j_decay,t_length) ;
1850 
1851  pop(xml_out);
1852  }
1853 
1854 
1855 
1856 
1857  if( Pion_nondegen_noisy_local2 )
1858  {
1859  push(xml_out, "noisy_local_nondegen_meson_correlators_2");
1860  QDPIO::cout << "Setting up third inverter for nondegen\n" ;
1861 
1862  // create second inverter for different mass
1863  XMLReader fermact_reader2 ;
1864  try{
1865  std::istringstream is(params.param.fermact3.xml);
1866  fermact_reader2.open(is);
1867  }
1868  catch (...)
1869  {
1870  QDPIO::cerr << "Error reading THIRD action name " << std::endl;
1871  throw;
1872  }
1873 
1876  fermact_reader2,params.param.fermact3.path));
1877 
1878  StaggeredTypeFermAct<T,P,Q>& S_f2= *(fermact2);
1879  Handle< FermState<T,P,Q> > state2(S_f2.createState(u));
1880 
1882  qprop2(S_f2.qprop(state, inv_param));
1883 
1884  Real Mass2 = S_f2.getQuarkMass() ;
1885  Real Mass1 = S_f.getQuarkMass() ;
1886 
1887  LatticeStaggeredPropagator noisy_corner_prop_2;
1888 
1889  type_of_src = GAUGE_INVAR_LOCAL_SOURCE ;
1890  // type_of_src = LOAD_IN_SOURCE ;
1891 
1892  QDPIO::cout << "Starting 2nd inversions for local source\n" ;
1893  ncg_had +=
1894  MakeCornerProp(psi, gauge_shift, sym_shift, u ,qprop2,
1895  xml_out, RsdCG,
1896  Mass2, j_decay,
1897  noisy_corner_prop_2,
1898  type_of_src , t_source,quark_source_nondegen);
1899 
1900 
1901 
1902 
1903  noisy_pion_nondegen(noisy_corner_prop_strange,Mass1,
1904  noisy_corner_prop_2,Mass2,
1905  xml_out, u,t_source,j_decay,t_length) ;
1906 
1907  pop(xml_out);
1908  }
1909 
1910 
1911 
1912 
1913 
1914 
1915  if( Pion_nondegen_noisy_local3 )
1916  {
1917  push(xml_out, "noisy_local_nondegen_meson_correlators_3");
1918  QDPIO::cout << "Setting up fourth inverter for nondegen\n" ;
1919 
1920  // create second inverter for different mass
1921  XMLReader fermact_reader4 ;
1922  try{
1923  std::istringstream is(params.param.fermact4.xml);
1924  fermact_reader4.open(is);
1925  }
1926  catch (...)
1927  {
1928  QDPIO::cerr << "Error reading FOURTH action name " << std::endl;
1929  throw;
1930  }
1931 
1934  fermact_reader4,params.param.fermact4.path));
1935 
1936  StaggeredTypeFermAct<T,P,Q>& S_f2= *(fermact2);
1937  Handle< FermState<T,P,Q> > state2(S_f2.createState(u));
1938 
1940  qprop2(S_f2.qprop(state, inv_param));
1941 
1942  Real Mass2 = S_f2.getQuarkMass() ;
1943  Real Mass1 = S_f.getQuarkMass() ;
1944 
1945  LatticeStaggeredPropagator noisy_corner_prop_2;
1946 
1947  // type_of_src = LOAD_IN_SOURCE ;
1948  type_of_src = GAUGE_INVAR_LOCAL_SOURCE ;
1949 
1950  QDPIO::cout << "Starting 3rd inversions for local source\n" ;
1951  ncg_had +=
1952  MakeCornerProp(psi, gauge_shift, sym_shift, u ,qprop2,
1953  xml_out, RsdCG,
1954  Mass2, j_decay,
1955  noisy_corner_prop_2,
1956  type_of_src , t_source,quark_source_nondegen);
1957 
1958 
1959  noisy_pion_nondegen(noisy_corner_prop_strange,Mass1,
1960  noisy_corner_prop_2,Mass2,
1961  xml_out, u,t_source,j_decay,t_length) ;
1962 
1963  pop(xml_out);
1964  }
1965 
1966 
1967 
1968 
1969 
1970  if( Pion_nondegen_noisy_local4 )
1971  {
1972  push(xml_out, "noisy_local_nondegen_meson_correlators_4");
1973  QDPIO::cout << "Setting up fifth inverter for nondegen\n" ;
1974 
1975  // create second inverter for different mass
1976  XMLReader fermact_reader5 ;
1977  try{
1978  std::istringstream is(params.param.fermact5.xml);
1979  fermact_reader5.open(is);
1980  }
1981  catch (...)
1982  {
1983  QDPIO::cerr << "Error reading FIFTH action name " << std::endl;
1984  throw;
1985  }
1986 
1989  fermact_reader5,params.param.fermact5.path));
1990 
1991  StaggeredTypeFermAct<T,P,Q>& S_f2= *(fermact5);
1992  Handle< FermState<T,P,Q> > state2(S_f2.createState(u));
1993 
1995  qprop2(S_f2.qprop(state, inv_param));
1996 
1997  Real Mass2 = S_f2.getQuarkMass() ;
1998  Real Mass1 = S_f.getQuarkMass() ;
1999 
2000  LatticeStaggeredPropagator noisy_corner_prop_2;
2001 
2002  // type_of_src = LOAD_IN_SOURCE ;
2003  type_of_src = GAUGE_INVAR_LOCAL_SOURCE ;
2004  QDPIO::cout << "Starting 4th inversions for local source\n" ;
2005 
2006  ncg_had +=
2007  MakeCornerProp(psi, gauge_shift, sym_shift, u ,qprop2,
2008  xml_out, RsdCG,
2009  Mass2, j_decay,
2010  noisy_corner_prop_2,
2011  type_of_src , t_source,quark_source_nondegen);
2012 
2013  noisy_pion_nondegen(noisy_corner_prop_strange,Mass1,
2014  noisy_corner_prop_2,Mass2,
2015  xml_out, u,t_source,j_decay,t_length) ;
2016 
2017  pop(xml_out);
2018  }
2019 
2020 
2021 
2022 
2023 
2024  pop(xml_out); // spectrum_s
2025 
2026  snoop.stop();
2027  QDPIO::cout << InlineStaggeredSpectrumEnv::name << ": total time = "
2028  << snoop.getTimeInSeconds()
2029  << " secs" << std::endl;
2030 
2031  QDPIO::cout << InlineStaggeredSpectrumEnv::name << ": ran successfully" << std::endl;
2032 
2033  END_CODE();
2034  } // end of InlineStaggeredSpectrum
2035 
2036 }
Inline measurement factory.
Asqtad staggered fermion action.
Create a simple ferm connection state.
virtual SystemSolver< T > * qprop(Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam) const
Return quark prop solver, solution of unpreconditioned system.
virtual FermState< T, P, Q > * createState(const Q &q) const
Given links (coordinates Q) create the state needed for the linear operators.
Definition: fermact.h:59
Class for counted reference semantics.
Definition: handle.h:33
Inline measurement of Wilson loops.
void operator()(const unsigned long update_no, XMLWriter &xml_out)
Do the measurement.
void func(const unsigned long update_no, XMLWriter &xml_out)
Do the measurement.
InlineStaggeredSpectrumParams params
Fourier transform phase factor support.
Definition: sftmom.h:35
static T & Instance()
Definition: singleton.h:432
Staggered-like fermion actions.
Definition: fermact.orig.h:644
virtual const Real getQuarkMass() const =0
Return the quark mass.
void compute(LatticeStaggeredPropagator &quark_prop_A, LatticeStaggeredPropagator &quark_prop_B, int j_decay)
void dump(int t_source, XMLWriter &xml_out)
Definition: hadron_corr_s.h:33
void compute(LatticeStaggeredPropagator &quark_prop_A, LatticeStaggeredPropagator &quark_prop_B, int j_decay)
Definition: pion_local_s.cc:56
void compute_and_dump(LatticeStaggeredPropagator &quark_prop_A, LatticeStaggeredPropagator &quark_prop_B, int j_decay, int, const SftMom &phases, XMLWriter &xml)
void compute(multi1d< LatticeStaggeredPropagator > &quark_props, int j_decay)
int mu
Definition: cool.cc:24
Stochastic source enum.
Fermion actions.
Fuzzed sources.
void PropToFerm(const LatticePropagatorF &b, LatticeFermionF &a, int color_index, int spin_index)
Extract a LatticeFermion from a LatticePropagator.
Definition: transf.cc:226
void FermToProp(const LatticeFermionF &a, LatticePropagatorF &b, int color_index, int spin_index)
Insert a LatticeFermion into a LatticePropagator.
Definition: transf.cc:98
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.
void Wloop(const multi1d< LatticeColorMatrix > &u, multi2d< Double > &plane_plaq_11, multi2d< Double > &plane_plaq_12, multi2d< Double > &plane_plaq_13, multi2d< Double > &plane_plaq_14)
Return the value of the 11, 12, 13, 14 Wilson loops.
Definition: wloop.cc:32
void proginfo(XMLWriter &xml)
Print out basic information about this program.
Definition: proginfo.cc:24
std::string makeXMLFileName(std::string xml_file, unsigned long update_no)
Return a xml file name for inline measurements.
GroupXML_t readXMLGroup(XMLReader &xml_in, const std::string &path, const std::string &type_name)
Read group and return as a std::string.
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
Class for counted reference semantics.
Inline staggered spectrum calculations.
Wrapper routines for computing loops with staggeref fermions.
void setrn(int iseed[4])
Definition: make_seeds.cc:38
Make xml file writer.
int j_decay
Definition: meslate.cc:22
Nd
Definition: meslate.cc:74
Named object function std::map.
static bool registered
Local registration flag.
multi1d< LatticeColorMatrix > P
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > const multi1d< Real > enum InvType invType const multi1d< Real > & RsdCG
Definition: pbg5p_w.cc:30
void DoFuzzing(const multi1d< LatticeColorMatrix > &u, multi1d< LatticeColorMatrix > &u_smr, int j_decay)
static multi1d< LatticeColorMatrix > u
void compute_vary_baryon_s(XMLWriter &xml_out, int t_source, int fuzz_width, int j_decay, int t_len, LatticeStaggeredPropagator &quark_propagator_Lsink_Lsrc, LatticeStaggeredPropagator &quark_propagator_Fsink_Lsrc, LatticeStaggeredPropagator &quark_propagator_Lsink_Fsrc, LatticeStaggeredPropagator &quark_propagator_Fsink_Fsrc)
void write_smearing_info(std::string name, stag_src_type type_of_src, XMLWriter &xml_out, int fuzz_width)
LinOpSysSolverMGProtoClover::Q Q
void noisy_pion_nondegen(LatticeStaggeredPropagator &quark_prop_1, Real Mass1, LatticeStaggeredPropagator &quark_prop_2, Real Mass2, XMLWriter &xml_out, const multi1d< LatticeColorMatrix > &u, int t_source, int j_decay, int t_length)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > const multi1d< Real > & Mass
Definition: pbg5p_w.cc:29
int MakeFuzzedCornerProp(LatticeStaggeredFermion &psi, int fuzz_width, bool gauge_shift, bool sym_shift, const multi1d< LatticeColorMatrix > &u, multi1d< LatticeColorMatrix > &u_smr, Handle< SystemSolver< LatticeStaggeredFermion > > &qprop, XMLWriter &xml_out, Real RsdCG, Real Mass, int j_decay, bool do_fuzzing, LatticeStaggeredFermion &psi_fuzz, LatticeStaggeredPropagator &quark_propagator_Lsink_Lsrc, LatticeStaggeredPropagator &quark_propagator_Fsink_Lsrc, LatticeStaggeredPropagator &quark_propagator_Lsink_Fsrc, LatticeStaggeredPropagator &quark_propagator_Fsink_Fsrc)
push(xml_out,"Condensates")
void ks_compute_baryon(std::string name, LatticeStaggeredPropagator &quark_propagator, XMLWriter &xml_out, int j_decay, int tlength)
void ks_local_loops_and_stoch_conn(Handle< SystemSolver< LatticeStaggeredFermion > > &qprop, LatticeStaggeredFermion &q_source1, LatticeStaggeredFermion &psi1, const multi1d< LatticeColorMatrix > &u, XMLWriter &xml_out, bool gauge_shift, bool sym_shift, bool loop_checkpoint, int t_length, Real Mass, int Nsamp, Real RsdCG, int CFGNO, VolSrc_type volume_source, int src_seperation, int j_decay)
LinOpSysSolverMGProtoClover::T T
void compute_vary_scalar(LatticeStaggeredPropagator &prop_Lsn_Lsr, LatticeStaggeredPropagator &prop_Fsn_Lsr, LatticeStaggeredPropagator &prop_Lsn_Fsr, LatticeStaggeredPropagator &prop_Fsn_Fsr, const multi1d< LatticeColorMatrix > &u, bool gauge_shift, bool sym_shift, XMLWriter &xml_out, int j_decay, int t_length, int t_source)
void compute_8_scalars(multi1d< LatticeStaggeredPropagator > &stag_prop, const multi1d< LatticeColorMatrix > &u, bool gauge_shift, bool sym_shift, XMLWriter &xml_out, int j_decay, int t_length, int t_source, bool binary_meson_dump, std::string binary_name)
int i
Definition: pbg5p_w.cc:55
void compute_8_vectors(multi1d< LatticeStaggeredPropagator > &stag_prop, const multi1d< LatticeColorMatrix > &u, bool gauge_shift, bool sym_shift, XMLWriter &xml_out, int j_decay, int t_length, int t_source, bool binary_meson_dump, std::string binary_name)
void compute_8_pions(multi1d< LatticeStaggeredPropagator > &stag_prop, const multi1d< LatticeColorMatrix > &u, bool gauge_shift, bool sym_shift, XMLWriter &xml_out, int j_decay, int t_length, int t_source, bool binary_meson_dump, std::string binary_name)
int build_basic_8_props(multi1d< LatticeStaggeredPropagator > stag_prop, stag_src_type type_of_src, bool gauge_shift, bool sym_shift, int fuzz_width, const multi1d< LatticeColorMatrix > &u, const multi1d< LatticeColorMatrix > &u_smr, Handle< SystemSolver< LatticeStaggeredFermion > > &qprop, XMLWriter &xml_out, Real RsdCG, Real Mass, int j_decay)
LatticeFermion psi
Definition: mespbg5p_w.cc:35
int compute_vary_singlet_ps(LatticeStaggeredFermion &psi, LatticeStaggeredPropagator &quark_propagator_Lsink_Lsrc, LatticeStaggeredPropagator &quark_propagator_Fsink_Lsrc, LatticeStaggeredPropagator &quark_propagator_Lsink_Fsrc, LatticeStaggeredPropagator &quark_propagator_Fsink_Fsrc, stag_src_type type_of_src, bool gauge_shift, bool sym_shift, const multi1d< LatticeColorMatrix > &u, const multi1d< LatticeColorMatrix > &u_smr, Handle< SystemSolver< LatticeStaggeredFermion > > &qprop, XMLWriter &xml_out, Real RsdCG, Real Mass, int j_decay, int t_source, int t_length, int fuzz_width)
void ks_fuzz_loops(Handle< SystemSolver< LatticeStaggeredFermion > > &qprop, LatticeStaggeredFermion &q_source, LatticeStaggeredFermion &psi, LatticeStaggeredFermion &psi_fuzz, const multi1d< LatticeColorMatrix > &u, const multi1d< LatticeColorMatrix > &u_smr, XMLWriter &xml_out, bool gauge_shift, bool sym_shift, bool loop_checkpoint, int t_length, Real Mass, int Nsamp, Real RsdCG, int CFGNO, VolSrc_type volume_source, int fuzz_width, int src_seperation, int j_decay, bool binary_loop_checkpoint, std::string binary_name)
pop(xml_out)
void MesPlq(const multi1d< LatticeColorMatrixF3 > &u, multi2d< Double > &plane_plaq, Double &link)
Definition: mesplq.cc:83
void write(XMLWriter &xml, const std::string &path, const InlineStaggeredSpectrumParams::NamedObject_t &input)
Named object output.
void ks_local_loops(Handle< SystemSolver< LatticeStaggeredFermion > > &qprop, LatticeStaggeredFermion &q_source, LatticeStaggeredFermion &psi, const multi1d< LatticeColorMatrix > &u, XMLWriter &xml_out, bool gauge_shift, bool sym_shift, bool loop_checkpoint, int t_length, Real Mass, int Nsamp, Real RsdCG, int CFGNO, VolSrc_type volume_source, int src_seperation, int j_decay)
@ GAUSSIAN
Definition: enum_loops_s.h:18
START_CODE()
int MakeCornerProp(LatticeStaggeredFermion &psi, bool gauge_shift, bool sym_shift, const multi1d< LatticeColorMatrix > &u, Handle< SystemSolver< LatticeStaggeredFermion > > &qprop, XMLWriter &xml_out, Real RsdCG, Real Mass, int j_decay, LatticeStaggeredPropagator &quark_propagator_Lsink_Lsrc, stag_src_type type_of_src, int t_source=0)
int compute_quark_propagator_s(LatticeStaggeredFermion &psi, stag_src_type type_of_src, bool gauge_shift, bool sym_shift, int fuzz_width, const multi1d< LatticeColorMatrix > &u, multi1d< LatticeColorMatrix > &u_smr, Handle< SystemSolver< LatticeStaggeredFermion > > &qprop, XMLWriter &xml_out, Real RsdCG, Real Mass, int j_decay, int src_ind, int color_source)
int compute_singlet_ps(LatticeStaggeredFermion &psi, LatticeStaggeredPropagator quark_propagator, stag_src_type type_of_src, bool gauge_shift, bool sym_shift, const multi1d< LatticeColorMatrix > &u, Handle< SystemSolver< LatticeStaggeredFermion > > &qprop, XMLWriter &xml_out, Real RsdCG, Real Mass, int j_decay, int t_source, int t_length)
void meson_charm(LatticeStaggeredPropagator &quark_prop, XMLWriter &xml_out, const multi1d< LatticeColorMatrix > &u, int t_source, int j_decay, int t_length)
void compute_vary_ps(LatticeStaggeredPropagator &quark_propagator_Lsink_Lsrc, LatticeStaggeredPropagator &quark_propagator_Fsink_Lsrc, LatticeStaggeredPropagator &quark_propagator_Lsink_Fsrc, LatticeStaggeredPropagator &quark_propagator_Fsink_Fsrc, const multi1d< LatticeColorMatrix > &u, bool gauge_shift, bool sym_shift, XMLWriter &xml_out, int j_decay, int t_length, int t_source)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
Definition: pbg5p_w.cc:28
const WilsonTypeFermAct< multi1d< LatticeFermion > > & S_f
Definition: pbg5p_w.cc:27
Double zero
Definition: invbicg.cc:106
::std::string string
Definition: gtest.h:1979
Various parameter structs and reader/writers.
Print out basic info about this program.
Double sum
Definition: qtopcor.cc:37
Fourier transform phase factor support.
Simple fermionic BC.
Support class for fermion actions and linear operators.
Params for asqtad ferm acts.
Hold group xml and type id.
struct Chroma::InlineStaggeredSpectrumParams::Quark_Prop_t prop_param
struct Chroma::InlineStaggeredSpectrumParams::NamedObject_t named_obj
struct Chroma::InlineStaggeredSpectrumParams::Param_t param
void write(XMLWriter &xml_out, const std::string &path)
Compute staggered quark propagator.
@ GAUGE_INVAR_LOCAL_SOURCE
@ NOISY_LOCAL_SOURCE