CHROMA
inline_unsmeared_hadron_node_distillation_w.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Inline measurement that construct unsmeared hadron nodes using distillation
3  */
4 
6 
7 #ifndef QDP_IS_QDPJIT_NO_NVPTX
8 
9 #include "qdp_map_obj_memory.h"
10 #include "qdp_map_obj_disk.h"
11 #include "qdp_map_obj_disk_multiple.h"
12 #include "qdp_disk_map_slice.h"
13 #include "handle.h"
14 
16 
17 #include "meas/glue/mesplq.h"
23 #include "util/ferm/key_val_db.h"
24 #include "util/info/proginfo.h"
25 #include "util/ft/sftmom.h"
26 #include "util/ft/time_slice_set.h"
27 #include "io/xml_group_reader.h"
29 
30 #include "util/ferm/key_val_db.h"
31 #include "util/ferm/transf.h"
35 
37 
38 namespace Chroma
39 {
40  /*!
41  * \ingroup hadron
42  *
43  * @{
44  */
45  namespace InlineUnsmearedHadronNodeDistillationEnv
46  {
47  //! Propagator input
48  void read(XMLReader& xml, const std::string& path, Params::NamedObject_t& input)
49  {
50  XMLReader inputtop(xml, path);
51 
52  read(inputtop, "gauge_id", input.gauge_id);
53  read(inputtop, "colorvec_files", input.colorvec_files);
54  read(inputtop, "dist_op_file", input.dist_op_file);
55  }
56 
57  //! Propagator output
58  void write(XMLWriter& xml, const std::string& path, const Params::NamedObject_t& input)
59  {
60  push(xml, path);
61 
62  write(xml, "gauge_id", input.gauge_id);
63  write(xml, "colorvec_files", input.colorvec_files);
64  write(xml, "dist_op_file", input.dist_op_file);
65 
66  pop(xml);
67  }
68 
69 
70  //! Propagator input
71  void read(XMLReader& xml, const std::string& path, Params::Param_t::DispGammaMom_t& input)
72  {
73  XMLReader inputtop(xml, path);
74 
75  read(inputtop, "displacement", input.displacement);
76  read(inputtop, "gamma", input.gamma);
77  read(inputtop, "mom", input.mom);
78  }
79 
80  //! Propagator output
81  void write(XMLWriter& xml, const std::string& path, const Params::Param_t::DispGammaMom_t& input)
82  {
83  push(xml, path);
84 
85  write(xml, "displacement", input.displacement);
86  write(xml, "gamma", input.gamma);
87  write(xml, "mom", input.mom);
88 
89  pop(xml);
90  }
91 
92 
93  //! Propagator input
94  void read(XMLReader& xml, const std::string& path, Params::Param_t::KeySolnProp_t& input)
95  {
96  XMLReader inputtop(xml, path);
97 
98  read(inputtop, "cacheP", input.cacheP);
99  read(inputtop, "num_vecs", input.num_vecs);
100  read(inputtop, "t_source", input.t_source);
101  read(inputtop, "Nt_forward", input.Nt_forward);
102  read(inputtop, "Nt_backward", input.Nt_backward);
103  }
104 
105  //! Propagator output
106  void write(XMLWriter& xml, const std::string& path, const Params::Param_t::KeySolnProp_t& input)
107  {
108  push(xml, path);
109 
110  write(xml, "cacheP", input.cacheP);
111  write(xml, "num_vecs", input.num_vecs);
112  write(xml, "t_source", input.t_source);
113  write(xml, "Nt_forward", input.Nt_forward);
114  write(xml, "Nt_backward", input.Nt_backward);
115 
116  pop(xml);
117  }
118 
119 
120  //! Propagator input
121  void read(XMLReader& xml, const std::string& path, Params::Param_t::SinkSource_t& input)
122  {
123  XMLReader inputtop(xml, path);
124 
125  read(inputtop, "t_sink", input.t_sink);
126  read(inputtop, "t_source", input.t_source);
127  read(inputtop, "Nt_forward", input.Nt_forward);
128  read(inputtop, "Nt_backward", input.Nt_backward);
129  }
130 
131  //! Propagator output
132  void write(XMLWriter& xml, const std::string& path, const Params::Param_t::SinkSource_t& input)
133  {
134  push(xml, path);
135 
136  write(xml, "t_sink", input.t_sink);
137  write(xml, "t_source", input.t_source);
138  write(xml, "Nt_forward", input.Nt_forward);
139  write(xml, "Nt_backward", input.Nt_backward);
140 
141  pop(xml);
142  }
143 
144  //! Propagator input
145  void read(XMLReader& xml, const std::string& path, Params::Param_t::Contract_t& input)
146  {
147  XMLReader inputtop(xml, path);
148 
149  read(inputtop, "use_derivP", input.use_derivP);
150  read(inputtop, "decay_dir", input.decay_dir);
151  read(inputtop, "displacement_length", input.displacement_length);
152  read(inputtop, "mass_label", input.mass_label);
153  read(inputtop, "num_tries", input.num_tries);
154  }
155 
156  //! Propagator output
157  void write(XMLWriter& xml, const std::string& path, const Params::Param_t::Contract_t& input)
158  {
159  push(xml, path);
160 
161  write(xml, "use_derivP", input.use_derivP);
162  write(xml, "decay_dir", input.decay_dir);
163  write(xml, "displacement_length", input.displacement_length);
164  write(xml, "mass_label", input.mass_label);
165  write(xml, "num_tries", input.num_tries);
166 
167  pop(xml);
168  }
169 
170 
171  //! Propagator input
172  void read(XMLReader& xml, const std::string& path, Params::Param_t& input)
173  {
174  XMLReader inputtop(xml, path);
175 
176  read(inputtop, "DispGammaMomList", input.disp_gamma_mom_list);
177  read(inputtop, "Propagator", input.prop);
178  read(inputtop, "PropSources", input.prop_sources);
179  read(inputtop, "SinkSourcePairs", input.sink_source_pairs);
180  read(inputtop, "Contractions", input.contract);
181 
182  input.link_smearing = readXMLGroup(inputtop, "LinkSmearing", "LinkSmearingType");
183  }
184 
185  //! Propagator output
186  void write(XMLWriter& xml, const std::string& path, const Params::Param_t& input)
187  {
188  push(xml, path);
189 
190  write(xml, "DispGammaMomList", input.disp_gamma_mom_list);
191  write(xml, "Propagator", input.prop);
192  write(xml, "PropSources", input.prop_sources);
193  write(xml, "SinkSourcePairs", input.sink_source_pairs);
194  write(xml, "Contractions", input.contract);
195  xml << input.link_smearing.xml;
196 
197  pop(xml);
198  }
199 
200 
201  //! Propagator input
202  void read(XMLReader& xml, const std::string& path, Params& input)
203  {
204  Params tmp(xml, path);
205  input = tmp;
206  }
207 
208  //! Propagator output
209  void write(XMLWriter& xml, const std::string& path, const Params& input)
210  {
211  push(xml, path);
212 
213  write(xml, "Param", input.param);
214  write(xml, "NamedObject", input.named_obj);
215 
216  pop(xml);
217  }
218  } // end namespace
219 
220 
221 
222  //-------------------------------------------------------------------------------
223  //-------------------------------------------------------------------------------
224  namespace InlineUnsmearedHadronNodeDistillationEnv
225  {
226  //----------------------------------------------------------------------------
227  // Convenience type
228  typedef QDP::MapObjectDisk<KeyTimeSliceColorVec_t, TimeSliceIO<LatticeColorVectorF> > MOD_t;
229 
230  // Convenience type
231  typedef QDP::MapObjectDiskMultiple<KeyTimeSliceColorVec_t, TimeSliceIO<LatticeColorVectorF> > MODS_t;
232 
233  // Convenience type
234  typedef QDP::MapObjectMemory<KeyTimeSliceColorVec_t, SubLatticeColorVectorF> SUB_MOD_t;
235 
236  } // end namespace
237 
238 
239  //-------------------------------------------------------------------------------
240  namespace InlineUnsmearedHadronNodeDistillationEnv
241  {
242  // Anonymous namespace for registration
243  namespace
244  {
245  AbsInlineMeasurement* createMeasurement(XMLReader& xml_in,
246  const std::string& path)
247  {
248  return new InlineMeas(Params(xml_in, path));
249  }
250 
251  //! Local registration flag
252  bool registered = false;
253  }
254 
255  const std::string name = "UNSMEARED_HADRON_NODE_DISTILLATION";
256 
257  //! Register all the factories
258  bool registerAll()
259  {
260  bool success = true;
261  if (! registered)
262  {
263  success &= LinkSmearingEnv::registerAll();
264  success &= TheInlineMeasurementFactory::Instance().registerObject(name, createMeasurement);
265  registered = true;
266  }
267  return success;
268  }
269 
270 
271  //! Anonymous namespace
272  /*! Diagnostic stuff */
273  namespace
274  {
275  StandardOutputStream& operator<<(StandardOutputStream& os, const multi1d<int>& d)
276  {
277  if (d.size() > 0)
278  {
279  os << d[0];
280 
281  for(int i=1; i < d.size(); ++i)
282  os << " " << d[i];
283  }
284 
285  return os;
286  }
287 
288  StandardOutputStream& operator<<(StandardOutputStream& os, const std::vector<int>& d)
289  {
290  if (d.size() > 0)
291  {
292  os << d[0];
293 
294  for(int i=1; i < d.size(); ++i)
295  os << " " << d[i];
296  }
297 
298  return os;
299  }
300  }
301 
302 
303 
304  //----------------------------------------------------------------------------
305  // Param stuff
307 
308  Params::Params(XMLReader& xml_in, const std::string& path)
309  {
310  try
311  {
312  XMLReader paramtop(xml_in, path);
313 
314  if (paramtop.count("Frequency") == 1)
315  read(paramtop, "Frequency", frequency);
316  else
317  frequency = 1;
318 
319  // Parameters for source construction
320  read(paramtop, "Param", param);
321 
322  // Read in the output propagator/source configuration info
323  read(paramtop, "NamedObject", named_obj);
324 
325  // Possible alternate XML file pattern
326  if (paramtop.count("xml_file") != 0)
327  {
328  read(paramtop, "xml_file", xml_file);
329  }
330  }
331  catch(const std::string& e)
332  {
333  QDPIO::cerr << __func__ << ": Caught Exception reading XML: " << e << std::endl;
334  QDP_abort(1);
335  }
336  }
337 
338 
339  //----------------------------------------------------------------------------
340  //! KeySolnProp reader
341  void read(BinaryReader& bin, Params::Param_t::KeySolnProp_t& param)
342  {
343  read(bin, param.cacheP);
344  read(bin, param.num_vecs);
345  read(bin, param.t_source);
346  read(bin, param.Nt_forward);
347  read(bin, param.Nt_backward);
348  }
349 
350  //! KeySolnProp write
351  void write(BinaryWriter& bin, const Params::Param_t::KeySolnProp_t& param)
352  {
353  write(bin, param.cacheP);
354  write(bin, param.num_vecs);
355  write(bin, param.t_source);
356  write(bin, param.Nt_forward);
357  write(bin, param.Nt_backward);
358  }
359 
360  //----------------------------------------------------------------------------
361  //! Unsmeared meson operator
363  {
364  int t_sink; /*!< Time sink */
365  int t_slice; /*!< Meson operator time slice */
366  int t_source; /*!< Time source */
367  int colorvec_src; /*!< Colorvec source component */
368  int gamma; /*!< The "gamma" in Gamma(gamma) */
369  bool derivP; /*!< Uses derivatives */
370  std::vector<int> displacement; /*!< Displacement dirs of right colorstd::vector */
371  multi1d<int> mom; /*!< D-1 momentum of this operator */
372  std::string mass; /*!< Some kind of mass label */
373  };
374 
375  //! Meson operator
377  {
378  multi3d<ComplexD> op; /*!< Colorvector source and spin sink */
379  };
380 
381 
382  //----------------------------------------------------------------------------
383  //! Holds key and value as temporaries
385  {
388  };
389 
390 
391  //----------------------------------------------------------------------------
392  //! KeyUnsmearedMesonElementalOperator reader
393  void read(BinaryReader& bin, KeyUnsmearedMesonElementalOperator_t& param)
394  {
395  read(bin, param.t_sink);
396  read(bin, param.t_slice);
397  read(bin, param.t_source);
398  read(bin, param.colorvec_src);
399  read(bin, param.gamma);
400  read(bin, param.derivP);
401  read(bin, param.displacement);
402  read(bin, param.mom);
403  readDesc(bin, param.mass);
404  }
405 
406  //! UnsmearedMesonElementalOperator write
407  void write(BinaryWriter& bin, const KeyUnsmearedMesonElementalOperator_t& param)
408  {
409  write(bin, param.t_sink);
410  write(bin, param.t_slice);
411  write(bin, param.t_source);
412  write(bin, param.colorvec_src);
413  write(bin, param.gamma);
414  write(bin, param.derivP);
415  write(bin, param.displacement);
416  write(bin, param.mom);
417  writeDesc(bin, param.mass);
418  }
419 
420  //! UnsmearedMesonElementalOperator reader
421  void read(XMLReader& xml, const std::string& path, KeyUnsmearedMesonElementalOperator_t& param)
422  {
423  XMLReader paramtop(xml, path);
424 
425  read(paramtop, "t_sink", param.t_sink);
426  read(paramtop, "t_slice", param.t_slice);
427  read(paramtop, "t_source", param.t_source);
428  read(paramtop, "colorvec_src", param.colorvec_src);
429  read(paramtop, "gamma", param.gamma);
430  read(paramtop, "derivP", param.derivP);
431  read(paramtop, "displacement", param.displacement);
432  read(paramtop, "mom", param.mom);
433  read(paramtop, "mass", param.mass);
434  }
435 
436  //! UnsmearedMesonElementalOperator writer
437  void write(XMLWriter& xml, const std::string& path, const KeyUnsmearedMesonElementalOperator_t& param)
438  {
439  push(xml, path);
440 
441  write(xml, "t_sink", param.t_sink);
442  write(xml, "t_slice", param.t_slice);
443  write(xml, "t_source", param.t_source);
444  write(xml, "colorvec_src", param.colorvec_src);
445  write(xml, "gamma", param.gamma);
446  write(xml, "derivP", param.derivP);
447  write(xml, "displacement", param.displacement);
448  write(xml, "mom", param.mom);
449  write(xml, "mass", param.mass);
450 
451  pop(xml);
452  }
453 
454 
455  //----------------------------------------------------------------------------
456  //! UnsmearedMesonElementalOperator reader
457  void read(BinaryReader& bin, ValUnsmearedMesonElementalOperator_t& param)
458  {
459  read(bin, param.op); // the size is always written, even if 0
460  }
461 
462  //! UnsmearedMesonElementalOperator write
463  void write(BinaryWriter& bin, const ValUnsmearedMesonElementalOperator_t& param)
464  {
465  write(bin, param.op);
466  }
467 
468 
469  //----------------------------------------------------------------------------------
470  //----------------------------------------------------------------------------
471  //! Map holding expressions. Key is the mom, val is some unique counter
472  typedef MapObjectMemory< multi1d<int>, int > MapTwoQuarkMom_t;
473 
474  //----------------------------------------------------------------------------------
475  //----------------------------------------------------------------------------------
476  //! Twoquark field
478  {
480  KeyTwoQuarkGamma_t(int g) : gamma(g) {}
481 
482  int gamma; /*!< The gamma in Gamma(gamma) - a number from [0 ... Ns*Ns) */
483  };
484 
485  //----------------------------------------------------------------------------
486  //! Reader
487  void read(BinaryReader& bin, KeyTwoQuarkGamma_t& op)
488  {
489  read(bin, op.gamma);
490  }
491 
492  //! Writer
493  void write(BinaryWriter& bin, const KeyTwoQuarkGamma_t& op)
494  {
495  write(bin, op.gamma);
496  }
497 
498 
499  //----------------------------------------------------------------------------
500  //! Map holding expressions. Key is the two-quark, val is the mom
501  typedef MapObjectMemory< KeyTwoQuarkGamma_t, MapTwoQuarkMom_t > MapTwoQuarkGammaMom_t;
502 
503 
504  //----------------------------------------------------------------------------------
505  //----------------------------------------------------------------------------------
506  //! Twoquark field
508  {
510  KeyTwoQuarkDisp_t(const std::vector<int>& d) : deriv(d) {}
511 
512  std::vector<int> deriv; /*!< Left-right derivative path. This is 1-based. */
513  };
514 
515  //----------------------------------------------------------------------------
516  //! Reader
517  void read(BinaryReader& bin, KeyTwoQuarkDisp_t& op)
518  {
519  read(bin, op.deriv);
520  }
521 
522  //! Writer
523  void write(BinaryWriter& bin, const KeyTwoQuarkDisp_t& op)
524  {
525  write(bin, op.deriv);
526  }
527 
528  //----------------------------------------------------------------------------
529  //! Map holding expressions. Key is the two-quark, val is the weight.
530  typedef MapObjectMemory<KeyTwoQuarkDisp_t, MapTwoQuarkGammaMom_t> MapTwoQuarkDispGammaMom_t;
531 
532 
533  //-------------------------------------------------------------------------------
534  //-------------------------------------------------------------------------------
535  //! Invert off of each source, and do all the checking
536  LatticeFermion doInversion(const SystemSolver<LatticeFermion>& PP, const LatticeColorVector& vec_srce, int spin_source, int num_tries)
537  {
538  //
539  // Loop over each spin source and invert.
540  //
541  LatticeFermion chi = zero;
542  CvToFerm(vec_srce, chi, spin_source);
543 
544  LatticeFermion quark_soln = zero;
545  int ncg_had;
546 
547  // Do the propagator inversion
548  // Check if bad things are happening
549  bool badP = true;
550  for(int nn = 1; nn <= num_tries; ++nn)
551  {
552  // Reset
553  quark_soln = zero;
554  badP = false;
555 
556  // Solve for the solution std::vector
557  SystemSolverResults_t res = PP(quark_soln, chi);
558  ncg_had = res.n_count;
559 
560  // Some sanity checks
561  if (toDouble(res.resid) > 1.0e-3)
562  {
563  QDPIO::cerr << name << ": have a resid > 1.0e-3. That is unacceptable" << std::endl;
564  QDP_abort(1);
565  }
566 
567  // Check for finite values - neither NaN nor Inf
568  if (isfinite(quark_soln))
569  {
570  // Okay
571  break;
572  }
573  else
574  {
575  QDPIO::cerr << name << ": WARNING - found something not finite, may retry\n";
576  badP = true;
577  }
578  }
579 
580  // Sanity check
581  if (badP)
582  {
583  QDPIO::cerr << name << ": this is bad - did not get a finite solution vector after num_tries= " << num_tries << std::endl;
584  QDP_abort(1);
585  }
586 
587  return quark_soln;
588  }
589 
590 
591  //-------------------------------------------------------------------------------
593  {
594  public:
595  SourcePropCache(const multi1d<LatticeColorMatrix>& u,
596  const ChromaProp_t& prop, MODS_t& eigs, int num_tries);
597 
598  //! New t-slice
600 
601  //! The solution
602  const LatticeColorVectorSpinMatrix& getSoln(int t_source, int colorvec_src);
603 
604  //! Getters
605  int getNumVecs(int t_source);
606 
607  private:
608  //! Eigenvectors
610 
611  //! Put it here
613 
614  //! t_source -> prop keys
615  std::map<int, Params::Param_t::KeySolnProp_t> keys;
616 
617  //! Cache: {key -> {colorvec -> LCVSM}}
618  MapObjectMemory<Params::Param_t::KeySolnProp_t, std::map<int, LatticeColorVectorSpinMatrix> > cache;
619 
620  //! qprop
622  };
623 
624 
625  //-------------------------------------------------------------------------------
626  SourcePropCache::SourcePropCache(const multi1d<LatticeColorMatrix>& u,
627  const ChromaProp_t& prop, MODS_t& eigs_, int num_tries_) : eigen_source(eigs_), num_tries(num_tries_)
628  {
629  StopWatch swatch;
630  swatch.reset();
631  swatch.start();
632  QDPIO::cout << __func__ << ": initialize the prop cache" << std::endl;
633 
634  // Typedefs to save typing
635  typedef LatticeFermion T;
636  typedef multi1d<LatticeColorMatrix> P;
637  typedef multi1d<LatticeColorMatrix> Q;
638 
639  //
640  // Initialize fermion action
641  //
642  std::istringstream xml_s(prop.fermact.xml);
643  XMLReader fermacttop(xml_s);
644  QDPIO::cout << "FermAct = " << prop.fermact.id << std::endl;
645 
646  // Generic Wilson-Type stuff
648  S_f(TheFermionActionFactory::Instance().createObject(prop.fermact.id,
649  fermacttop,
650  prop.fermact.path));
651 
652  Handle< FermState<T,P,Q> > state(S_f->createState(u));
653 
654  PP = S_f->qprop(state, prop.invParam);
655 
656  swatch.stop();
657  QDPIO::cout << __func__ << ": finished initializing the prop cache"
658  << " time = " << swatch.getTimeInSeconds()
659  << " secs" << std::endl;
660  }
661 
662 
663  //-------------------------------------------------------------------------------
664  //! New t-slice
666  {
667  if (cache.exist(key)) {
668  QDPIO::cerr << __func__ << ": cache entry already exists" << std::endl;
669  QDP_abort(1);
670  }
671 
672  QDPIO::cout << __func__ << ": new t_source = " << key.t_source << std::endl;
673 
674  //! Insert a new entry
675  keys.insert(std::make_pair(key.t_source, key));
676 
677  //! Cache size will depend on cacheP flag
678  cache.insert(key, std::map<int, LatticeColorVectorSpinMatrix>());
679  }
680 
681 
682  //-------------------------------------------------------------------------------
683  //! New t-slice
684  const LatticeColorVectorSpinMatrix& SourcePropCache::getSoln(int t_slice, int colorvec_ind)
685  {
686  if (keys.find(t_slice) == keys.end()) {
687  QDPIO::cerr << __func__ << ": t_ind does not exist in cache = " << t_slice << std::endl;
688  QDP_abort(1);
689  }
690 
691  // Key
693 
694  if (cache[key].find(colorvec_ind) != cache[key].end()) {
695  //QDPIO::cout << __func__ << ": FOUND KEY - t_slice = " << t_slice << " colorvec_ind = " << colorvec_ind << std::endl;
696  return cache[key].at(colorvec_ind);
697  }
698  else {
699  QDPIO::cout << __func__ << ": CREATING KEY: t_slice = " << t_slice << " colorvec_ind = " << colorvec_ind << std::endl;
700  cache[key].insert(std::make_pair(colorvec_ind, LatticeColorVectorSpinMatrix(zero)));
701  }
702 
703  // Get the source vector
704  StopWatch swatch;
705  swatch.reset();
706  swatch.start();
707 
708  LatticeColorVectorF vec_srce = zero;
709  KeyTimeSliceColorVec_t src_key(t_slice, colorvec_ind);
710  TimeSliceIO<LatticeColorVectorF> time_slice_io(vec_srce, t_slice);
711  eigen_source.get(src_key, time_slice_io);
712 
713  // Loop over each spin source
714  for(int spin_ind=0; spin_ind < Ns; ++spin_ind)
715  {
716  QDPIO::cout << __func__ << ": do t_slice= " << t_slice << " spin_ind= " << spin_ind << " colorvec_ind= " << colorvec_ind << std::endl;
717 
718  StopWatch snarss1;
719  snarss1.reset();
720  snarss1.start();
721 
722  //
723  // Loop over each spin source and invert.
724  // Use the same color vector source. No spin dilution will be used.
725  //
726  LatticeFermion tmp = doInversion(*PP, vec_srce, spin_ind, num_tries);
727 
728  // shove a fermion into a colorvec-spinmatrix
729  FermToProp(tmp, cache[key][colorvec_ind], spin_ind);
730 
731  snarss1.stop();
732  QDPIO::cout << __func__ << ": time to compute prop for t_slice= " << t_slice
733  << " spin_ind= " << spin_ind
734  << " colorvec_ind= " << colorvec_ind
735  << " time = " << snarss1.getTimeInSeconds()
736  << " secs" << std::endl;
737  } // for spin_src
738 
739  swatch.stop();
740  QDPIO::cout << __func__ << ": FINISHED: total time for t_slice = " << t_slice << " colorvec_ind = " << colorvec_ind
741  << " time= " << swatch.getTimeInSeconds() << " secs" << std::endl;
742 
743  return cache[key][colorvec_ind];
744  }
745 
746  //-------------------------------------------------------------------------------
747  //! New t-slice
749  {
750  if (keys.find(t_source) == keys.end()) {
751  QDPIO::cerr << __func__ << ": t_source does not exist in cache = " << t_source << std::endl;
752  QDP_abort(1);
753  }
754 
755  // Key
757 
758  return key.num_vecs;
759  }
760  //----------------------------------------------------------------------------
761  //! Normalize just one displacement array
762  std::vector<int> normDisp(const std::vector<int>& orig)
763  {
764  START_CODE();
765 
766  std::vector<int> disp;
767  std::vector<int> empty;
768  std::vector<int> no_disp(1); no_disp[0] = 0;
769 
770  // NOTE: a no-displacement is recorded as a zero-length array
771  // Convert a length one array with no displacement into a no-displacement array
772  if (orig.size() == 1)
773  {
774  if (orig == no_disp)
775  disp = empty;
776  else
777  disp = orig;
778  }
779  else
780  {
781  disp = orig;
782  }
783 
784  END_CODE();
785 
786  return disp;
787  } // void normDisp
788 
789 
790 
791  //-------------------------------------------------------------------------------
792  // Function call
793  void
794  InlineMeas::operator()(unsigned long update_no,
795  XMLWriter& xml_out)
796  {
797  // If xml file not empty, then use alternate
798  if (params.xml_file != "")
799  {
800  std::string xml_file = makeXMLFileName(params.xml_file, update_no);
801 
802  push(xml_out, "HadronNode");
803  write(xml_out, "update_no", update_no);
804  write(xml_out, "xml_file", xml_file);
805  pop(xml_out);
806 
807  XMLFileWriter xml(xml_file);
808  func(update_no, xml);
809  }
810  else
811  {
812  func(update_no, xml_out);
813  }
814  }
815 
816 
817  //-------------------------------------------------------------------------------
818  // Function call
819  void
820  InlineMeas::func(unsigned long update_no,
821  XMLWriter& xml_out)
822  {
823  START_CODE();
824 
825  StopWatch snoop;
826  snoop.reset();
827  snoop.start();
828 
829  QDPIO::cout << name << ": construct unsmeared hadron nodes via distillation" << std::endl;
830 
831  // Test and grab a reference to the gauge field
832  multi1d<LatticeColorMatrix> u;
833  XMLBufferWriter gauge_xml;
834  try
835  {
836  u = TheNamedObjMap::Instance().getData< multi1d<LatticeColorMatrix> >(params.named_obj.gauge_id);
837  TheNamedObjMap::Instance().get(params.named_obj.gauge_id).getRecordXML(gauge_xml);
838  }
839  catch( std::bad_cast )
840  {
841  QDPIO::cerr << name << ": caught dynamic cast error" << std::endl;
842  QDP_abort(1);
843  }
844  catch (const std::string& e)
845  {
846  QDPIO::cerr << name << ": std::map call failed: " << e << std::endl;
847  QDP_abort(1);
848  }
849 
850  push(xml_out, "UnsmearedHadronNode");
851  write(xml_out, "update_no", update_no);
852 
853  // Write out the input
854  write(xml_out, "Input", params);
855 
856  // Write out the config header
857  write(xml_out, "Config_info", gauge_xml);
858 
859  push(xml_out, "Output_version");
860  write(xml_out, "out_version", 1);
861  pop(xml_out);
862 
863  // Calculate some gauge invariant observables just for info.
864  MesPlq(xml_out, "Observables", u);
865 
866  // Will use TimeSliceSet-s a lot
867  const int decay_dir = params.param.contract.decay_dir;
868  const int Lt = Layout::lattSize()[decay_dir];
869 
870  // A sanity check
871  if (decay_dir != Nd-1)
872  {
873  QDPIO::cerr << name << ": TimeSliceIO only supports decay_dir= " << Nd-1 << "\n";
874  QDP_abort(1);
875  }
876 
877  // Reset
878  if (params.param.contract.num_tries <= 0)
879  {
881  }
882 
883 
884  //
885  // Read in the source along with relevant information.
886  //
887  QDPIO::cout << "Snarf the source from a std::map object disk file" << std::endl;
888 
890  eigen_source.setDebug(0);
891 
892  std::string eigen_meta_data; // holds the eigenvalues
893 
894  try
895  {
896  // Open
897  QDPIO::cout << "Open file= " << params.named_obj.colorvec_files[0] << std::endl;
899 
900  // Snarf the source info.
901  QDPIO::cout << "Get user data" << std::endl;
902  eigen_source.getUserdata(eigen_meta_data);
903  // QDPIO::cout << "User data= " << eigen_meta_data << std::endl;
904 
905  // Write it
906  // QDPIO::cout << "Write to an xml file" << std::endl;
907  // XMLBufferWriter xml_buf(eigen_meta_data);
908  // write(xml_out, "Source_info", xml_buf);
909  }
910  catch (std::bad_cast) {
911  QDPIO::cerr << name << ": caught dynamic cast error" << std::endl;
912  QDP_abort(1);
913  }
914  catch (const std::string& e) {
915  QDPIO::cerr << name << ": error extracting source_header: " << e << std::endl;
916  QDP_abort(1);
917  }
918  catch( const char* e) {
919  QDPIO::cerr << name <<": Caught some char* exception:" << std::endl;
920  QDPIO::cerr << e << std::endl;
921  QDPIO::cerr << "Rethrowing" << std::endl;
922  throw;
923  }
924 
925  QDPIO::cout << "Source successfully read and parsed" << std::endl;
926 
927 #if 0
928  // Sanity check
929  if (params.param.contract.num_vecs > eigen_source.size())
930  {
931  QDPIO::cerr << name << ": number of available eigenvectors is too small\n";
932  QDP_abort(1);
933  }
934  QDPIO::cout << "Number of vecs available is large enough" << std::endl;
935 #endif
936 
937  //
938  // Setup the gauge smearing
939  //
940  QDPIO::cout << "Initalize link smearing" << std::endl;
941  Handle< LinkSmearing > linkSmearing;
942 
943  try
944  {
945  std::istringstream xml_l(params.param.link_smearing.xml);
946  XMLReader linktop(xml_l);
947  QDPIO::cout << "Link smearing type = " << params.param.link_smearing.id << std::endl;
948 
949  linkSmearing = TheLinkSmearingFactory::Instance().createObject(params.param.link_smearing.id,
950  linktop,
952  }
953  catch(const std::string& e)
954  {
955  QDPIO::cerr << name << ": Caught Exception link smearing: " << e << std::endl;
956  QDP_abort(1);
957  }
958 
959  QDPIO::cout << "Link smearing successfully initialized" << std::endl;
960 
961 
962  //
963  // Read through the momentum list and find all the unique phases
964  //
965  QDPIO::cout << "Parse momentum list" << std::endl;
966 
967  //
968  // Check displacements
969  //
970  MapTwoQuarkDispGammaMom_t disp_gamma_moms;
971 
972  // Possible momenta
973  multi2d<int> moms;
974 
975  if (params.param.disp_gamma_mom_list.size() >= 0)
976  {
977  int mom_size = 0;
978  MapObjectMemory<multi1d<int>, int> uniq_mom;
979  for(auto ins = params.param.disp_gamma_mom_list.begin(); ins != params.param.disp_gamma_mom_list.end(); ++ins)
980  {
981  // Sort out momentum
982  QDPIO::cout << name << ": mom= " << ins->mom << std::endl;
983  uniq_mom.insert(ins->mom, 1);
984  QDPIO::cout << " found mom" << std::endl;
985  mom_size = ins->mom.size();
986  QDPIO::cout << " mom_size= " << mom_size << std::endl;
987 
988  //
989  // Build maps of displacements, gammas and their moms
990  //
991  // Make sure displacement is something sensible
992  std::vector<int> disp = normDisp(ins->displacement);
993 
994  // Insert unique combos
995  // Drat - don't have automatic uniqueness generator
996  MapTwoQuarkMom_t george;
998  george.insert(ins->mom, 1);
999  fred.insert(ins->gamma, george);
1000 
1001  if (disp_gamma_moms.exist(disp))
1002  {
1003  if (disp_gamma_moms[disp].exist(ins->gamma))
1004  {
1005  disp_gamma_moms[disp][ins->gamma].insert(ins->mom, 1);
1006  }
1007  else
1008  {
1009  disp_gamma_moms[disp].insert(ins->gamma, george);
1010  }
1011  }
1012  else
1013  {
1014  disp_gamma_moms.insert(disp, fred);
1015  }
1016  }
1017 
1018  int num_mom = uniq_mom.size();
1019  QDPIO::cout << name << ": num_mom= " << num_mom << " mom_size= " << mom_size << std::endl;
1020  moms.resize(num_mom,mom_size);
1021  int i = 0;
1022  for(auto mom = uniq_mom.begin(); mom != uniq_mom.end(); ++mom)
1023  moms[i++] = mom->first;
1024  }
1025  else
1026  {
1027  QDPIO::cerr << name << ": warning - you have an empty disp_gamma_mom_list" << std::endl;
1028  QDP_abort(1);
1029  }
1030 
1031  //
1032  // Initialize the slow Fourier transform phases
1033  //
1034  SftMom phases(moms, params.param.contract.decay_dir);
1035 
1036 
1037 
1038  //
1039  // Smear the gauge field if needed
1040  //
1041  multi1d<LatticeColorMatrix> u_smr = u;
1042 
1043  try
1044  {
1045  std::istringstream xml_l(params.param.link_smearing.xml);
1046  XMLReader linktop(xml_l);
1047  QDPIO::cout << "Link smearing type = " << params.param.link_smearing.id << std::endl;
1048 
1049 
1051  linkSmearing(TheLinkSmearingFactory::Instance().createObject(params.param.link_smearing.id,
1052  linktop,
1054 
1055  (*linkSmearing)(u_smr);
1056  }
1057  catch(const std::string& e)
1058  {
1059  QDPIO::cerr << name << ": Caught Exception link smearing: " << e << std::endl;
1060  QDP_abort(1);
1061  }
1062 
1063  // Record the smeared observables
1064  MesPlq(xml_out, "Smeared_Observables", u_smr);
1065 
1066 
1067  //
1068  // DB storage
1069  //
1070  BinaryStoreDB< SerialDBKey<KeyUnsmearedMesonElementalOperator_t>, SerialDBData<ValUnsmearedMesonElementalOperator_t> > qdp_db;
1071 
1072  // Open the file, and write the meta-data and the binary for this operator
1073  if (! qdp_db.fileExists(params.named_obj.dist_op_file))
1074  {
1075  XMLBufferWriter file_xml;
1076 
1077  push(file_xml, "DBMetaData");
1078  write(file_xml, "id", std::string("unsmearedMesonElemOp"));
1079  write(file_xml, "lattSize", QDP::Layout::lattSize());
1080  write(file_xml, "decay_dir", decay_dir);
1081  proginfo(file_xml); // Print out basic program info
1082  write(file_xml, "Config_info", gauge_xml);
1083  pop(file_xml);
1084 
1085  std::string file_str(file_xml.str());
1086  qdp_db.setMaxUserInfoLen(file_str.size());
1087 
1088  qdp_db.open(params.named_obj.dist_op_file, O_RDWR | O_CREAT, 0664);
1089 
1090  qdp_db.insertUserdata(file_str);
1091  }
1092  else
1093  {
1094  qdp_db.open(params.named_obj.dist_op_file, O_RDWR, 0664);
1095  }
1096 
1097  QDPIO::cout << "Finished opening distillation file" << std::endl;
1098 
1099 
1100  //
1101  // Try the factories
1102  //
1103  try
1104  {
1105  StopWatch swatch;
1106  swatch.reset();
1107 
1108  // Cache manager
1109  QDPIO::cout << name << ": initialize the prop cache" << std::endl;
1111 
1112  // All the desired solutions
1113  QDPIO::cout << name << ": initialize the time sources" << std::endl;
1114  for(auto key = params.param.prop_sources.begin(); key != params.param.prop_sources.end(); ++key)
1115  {
1116  prop_cache.newTimeSource(*key);
1117  }
1118 
1119 
1120  //
1121  // Loop over the source color and spin, creating the source
1122  // and calling the relevant propagator routines.
1123  //
1124  const int g5 = Ns*Ns-1;
1125 
1126  for(auto sink_source = params.param.sink_source_pairs.begin(); sink_source != params.param.sink_source_pairs.end(); ++sink_source)
1127  {
1128  int t_sink = sink_source->t_sink;
1129  int t_source = sink_source->t_source;
1130  int sink_num_vecs = prop_cache.getNumVecs(t_sink);
1131  int srce_num_vecs = prop_cache.getNumVecs(t_source);
1132 
1133  QDPIO::cout << "\n\n--------------------------\nSink-Source pair: t_sink = " << t_sink << " t_source = " << t_source << std::endl;
1134  swatch.reset();
1135  swatch.start();
1136 
1137  //
1138  // Build active t_slice list
1139  //
1140  std::vector<bool> active_t_slices(Lt);
1141 
1142  if (1)
1143  {
1144  // Initialize the active time slices
1145  for(int t=0; t < Lt; ++t)
1146  {
1147  active_t_slices[t] = false;
1148  }
1149 
1150  // Forward
1151  for(int dt=0; dt < sink_source->Nt_forward; ++dt)
1152  {
1153  int t = (t_source + dt) % Lt;
1154  active_t_slices[t] = true;
1155  }
1156 
1157  // Backward
1158  for(int dt=0; dt < sink_source->Nt_backward; ++dt)
1159  {
1160  int t = (t_source - dt + 2*Lt) % Lt;
1161  active_t_slices[t] = true;
1162  }
1163  }
1164 
1165 
1166  //
1167  // Look through sources, do the funny stuff through each soln, and stream the sink vectors past them
1168  //
1169  for(int colorvec_src=0; colorvec_src < srce_num_vecs; ++colorvec_src)
1170  {
1171  QDPIO::cout << "SOURCE: colorvec_src = " << colorvec_src << std::endl;
1172 
1173  StopWatch snarss1;
1174  snarss1.reset();
1175  snarss1.start();
1176 
1177  //
1178  // Loop over each spin source and invert.
1179  // Use the same color vector source. No spin dilution will be used.
1180  //
1181  const LatticeColorVectorSpinMatrix& soln_srce = prop_cache.getSoln(t_source, colorvec_src);
1182 
1183  //
1184  // Cache holding original solution vectors including displacements/derivatives
1185  //
1186  DispSolnCache disp_soln_cache(u_smr, soln_srce);
1187 
1188  //
1189  // Loop over insertions for this source solutiuon vector
1190  // Multiply by insertions
1191  // Stream the sink solution vectors past it, and contract
1192  //
1193  QDPIO::cout << "SOURCE: do insertions for colorvec_src= " << colorvec_src << std::endl;
1194  snarss1.reset();
1195  snarss1.start();
1196 
1197  for(auto dd = disp_gamma_moms.begin(); dd != disp_gamma_moms.end(); ++dd)
1198  {
1199  for(auto gg = dd->second.begin(); gg != dd->second.end(); ++gg)
1200  {
1201  for(auto mm = gg->second.begin(); mm != gg->second.end(); ++mm)
1202  {
1203  StopWatch snarss2;
1204  snarss2.reset();
1205  snarss2.start();
1206 
1207  auto disp = dd->first.deriv;
1208  auto gamma = gg->first.gamma;
1209  auto mom = mm->first;
1210  int mom_num = phases.momToNum(mom);
1211 
1212  QDPIO::cout << "Insertion: disp= " << disp << " gamma= " << gamma << " mom= " << mom << std::endl;
1213 
1214  //
1215  // Finally, the actual insertion
1216  // NOTE: if we did not have the possibility for derivatives, then the displacement,
1217  // and multiply by gamma could be moved outside the mom loop.
1218  // The deriv/disp are cached, so the only cost is a lookup.
1219  // The gamma is really just a rearrangement of spin components, but it does cost
1220  // a traversal of the lattice
1221  // The phases mult is a straight up cost.
1222  //
1223  // NOTE: ultimately, we are using gamma5 hermiticity to change the propagator from source at time
1224  // t_sink to, instead, the t_slice
1225  //
1226  // Also NOTE: the gamma5 is hermitian. We will put the gamma_5 into the insertion, but since the need for the G5
1227  // is a part of the sink solution vector, we will multiply here.
1228  //
1229  // NOTE: with suitable signs, the gamma_5 could be merged with the gamma
1230  LatticeColorVectorSpinMatrix tmp = phases[mom_num] *
1231  (Gamma(g5) * (Gamma(gamma) * disp_soln_cache.getDispVector(params.param.contract.use_derivP,
1232  mom,
1233  disp)));
1234 
1235  // Keys and stuff
1238 
1239  // The keys for the spin and displacements for this particular elemental operator
1240  // No displacement for left colorvector, only displace right colorvector
1241  // Invert the time - make it an independent key
1242  multi1d<KeyValUnsmearedMesonElementalOperator_t> buf(phases.numSubsets());
1243  for(int t=0; t < phases.numSubsets(); ++t)
1244  {
1245  if (! active_t_slices[t]) {continue;}
1246 
1247  buf[t].key.key().derivP = params.param.contract.use_derivP;
1248  buf[t].key.key().t_sink = t_sink;
1249  buf[t].key.key().t_slice = t;
1250  buf[t].key.key().t_source = t_source;
1251  buf[t].key.key().colorvec_src = colorvec_src;
1252  buf[t].key.key().gamma = gamma;
1253  buf[t].key.key().displacement = disp;
1254  buf[t].key.key().mom = mom;
1255  buf[t].key.key().mass = params.param.contract.mass_label;
1256  buf[t].val.data().op.resize(sink_num_vecs,Ns,Ns);
1257  }
1258 
1259  // Stream the sink vectors past the insertion
1260  // Will save a column of the genprop - corresponding to the current colorvec_src
1261  for(int colorvec_snk=0; colorvec_snk < sink_num_vecs; ++colorvec_snk)
1262  {
1263  //QDPIO::cout << "stream: colorvec_snk = " << colorvec_snk << std::endl;
1264 
1265  // Slow fourier-transform
1266  multi1d<SpinMatrixD> fred = sumMulti(localColorInnerProduct(prop_cache.getSoln(t_sink, colorvec_snk), tmp), phases.getSet());
1267 
1268  for(int t=0; t < phases.numSubsets(); ++t)
1269  {
1270  if (! active_t_slices[t]) {continue;}
1271 
1272  // Complete the gamma_5 hermitian adj on the sink by tacking on the gamma_5
1273  SpinMatrixD gred = Gamma(g5) * fred[t];
1274 
1275  for (int spin_snk = 0; spin_snk < Ns; ++spin_snk)
1276  for (int spin_src = 0; spin_src < Ns; ++spin_src)
1277  buf[t].val.data().op(colorvec_snk,spin_snk,spin_src) = peekSpin(gred, spin_snk, spin_src);
1278  }
1279  }
1280 
1281  // Insert these elementals into the db
1282  for(int t=0; t < phases.numSubsets(); ++t)
1283  {
1284  if (! active_t_slices[t]) {continue;}
1285 
1286  //QDPIO::cout << "insert key= " << buf[t].key.key() << std::endl;
1287  //write(xml_out, "Insertion", buf[t].key.key());
1288 
1289  qdp_db.insert(buf[t].key, buf[t].val);
1290  }
1291 
1292  snarss2.stop();
1293  QDPIO::cout << " Time to build elemental: colorvec_src= " << colorvec_src
1294  << " gamma= " << gamma
1295  << " disp= " << disp
1296  << " mom= " << mom
1297  << " time = " << snarss2.getTimeInSeconds() << " secs " <<std::endl;
1298  } // mm
1299  } // gg
1300  } // dd
1301 
1302  snarss1.stop();
1303  QDPIO::cout << "Time to do all insertions for colorvec_src= " << colorvec_src << " time = " << snarss1.getTimeInSeconds() << " secs " <<std::endl;
1304  } // for colorvec_src
1305 
1306  swatch.stop();
1307  QDPIO::cout << "SINK-SOURCE: time to compute all source solution vectors and insertions for t_sink= " << t_sink << " t_source= " << t_source << " time= " << swatch.getTimeInSeconds() << " secs" <<std::endl;
1308  } // for sink_source
1309  }
1310  catch (const std::string& e)
1311  {
1312  QDPIO::cout << name << ": caught exception around qprop: " << e << std::endl;
1313  QDP_abort(1);
1314  }
1315 
1316  // Close db
1317  qdp_db.close();
1318 
1319  // Close the xml output file
1320  pop(xml_out); // UnsmearedHadronNode
1321 
1322  snoop.stop();
1323  QDPIO::cout << name << ": total time = "
1324  << snoop.getTimeInSeconds()
1325  << " secs" << std::endl;
1326 
1327  QDPIO::cout << name << ": ran successfully" << std::endl;
1328 
1329  END_CODE();
1330  } // func
1331  } // namespace InlineUnsmearedHadronNodeDistillationEnv
1332 
1333  /*! @} */ // end of group hadron
1334 
1335 } // namespace Chroma
1336 
1337 #endif
Inline measurement factory.
Cache for distillation.
const LatticeColorVectorSpinMatrix & getDispVector(bool use_derivP, const multi1d< int > &mom, const std::vector< int > &disp)
Accessor.
Class for counted reference semantics.
Definition: handle.h:33
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.
MapObjectMemory< Params::Param_t::KeySolnProp_t, std::map< int, LatticeColorVectorSpinMatrix > > cache
Cache: {key -> {colorvec -> LCVSM}}.
SourcePropCache(const multi1d< LatticeColorMatrix > &u, const ChromaProp_t &prop, MODS_t &eigs, int num_tries)
std::map< int, Params::Param_t::KeySolnProp_t > keys
t_source -> prop keys
const LatticeColorVectorSpinMatrix & getSoln(int t_source, int colorvec_src)
The solution.
Serializable value harness.
Definition: key_val_db.h:69
D & data()
Setter.
Definition: key_val_db.h:78
Serializable key harness.
Definition: key_val_db.h:21
Fourier transform phase factor support.
Definition: sftmom.h:35
int numSubsets() const
Number of subsets - length in decay direction.
Definition: sftmom.h:63
int momToNum(const multi1d< int > &mom_in) const
Convert array of momenta to momenta id.
Definition: sftmom.cc:496
const Set & getSet() const
The set to be used in sumMulti.
Definition: sftmom.h:57
static T & Instance()
Definition: singleton.h:432
EXTERN Real dt
Cache for displaced solution vectors.
Fermion action factories.
All Wilson-type fermion actions.
void CvToFerm(const LatticeColorVectorF &a, LatticeFermionF &b, int spin_index)
Convert (insert) a LatticeColorVector into a LatticeFermion.
Definition: transf.cc:18
void FermToProp(const LatticeFermionF &a, LatticePropagatorF &b, int color_index, int spin_index)
Insert a LatticeFermion into a LatticePropagator.
Definition: transf.cc:98
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.
Class for counted reference semantics.
std::map< std::string, SinkPropContainer_t > prop
MODS_t & eigen_source
Eigenvectors.
Inline measurement that construct unsmeared hadron nodes using distillation.
Key for time-sliced color eigenvectors.
Key and values for DB.
Make xml file writer.
int t
Definition: meslate.cc:37
int t_slice
Definition: meslate.cc:23
Nd
Definition: meslate.cc:74
Named object function std::map.
static bool registered
Local registration flag.
multi1d< LatticeColorMatrix > P
QDP::MapObjectMemory< KeyTimeSliceColorVec_t, SubLatticeColorVectorF > SUB_MOD_t
void read(XMLReader &xml, const std::string &path, Params::NamedObject_t &input)
Propagator input.
std::vector< int > normDisp(const std::vector< int > &orig)
Normalize just one displacement array.
MapObjectMemory< KeyTwoQuarkDisp_t, MapTwoQuarkGammaMom_t > MapTwoQuarkDispGammaMom_t
Map holding expressions. Key is the two-quark, val is the weight.
MapObjectMemory< multi1d< int >, int > MapTwoQuarkMom_t
Map holding expressions. Key is the mom, val is some unique counter.
MapObjectMemory< KeyTwoQuarkGamma_t, MapTwoQuarkMom_t > MapTwoQuarkGammaMom_t
Map holding expressions. Key is the two-quark, val is the mom.
QDP::MapObjectDiskMultiple< KeyTimeSliceColorVec_t, TimeSliceIO< LatticeColorVectorF > > MODS_t
LatticeFermion doInversion(const SystemSolver< LatticeFermion > &PP, const LatticeColorVector &vec_srce, int spin_source, int num_tries)
Invert off of each source, and do all the checking.
QDP::MapObjectDisk< KeyTimeSliceColorVec_t, TimeSliceIO< LatticeColorVectorF > > MOD_t
void write(XMLWriter &xml, const std::string &path, const Params::NamedObject_t &input)
Propagator output.
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
QDP::StandardOutputStream & operator<<(QDP::StandardOutputStream &s, const multi1d< int > &d)
Definition: npr_vertex_w.cc:12
static multi1d< LatticeColorMatrix > u
LinOpSysSolverMGProtoClover::Q Q
LatticeFermion tmp
Definition: mespbg5p_w.cc:36
push(xml_out,"Condensates")
LinOpSysSolverMGProtoClover::T T
int i
Definition: pbg5p_w.cc:55
multi1d< LatticeFermion > chi(Ncb)
pop(xml_out)
void MesPlq(const multi1d< LatticeColorMatrixF3 > &u, multi2d< Double > &plane_plaq, Double &link)
Definition: mesplq.cc:83
DComplex d
Definition: invbicg.cc:99
START_CODE()
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
Print out basic info about this program.
Fourier transform phase factor support.
Propagator parameters.
Definition: qprop_io.h:75
Holds return info from SystemSolver call.
Definition: syssolver.h:17
Convenience for building time-slice subsets.
Read an XML group as a std::string.