CHROMA
inline_genprop_matelem_pt_colorvec_w.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Compute the matrix element of LatticeColorVector*M^-1*Gamma*M^-1**LatticeColorVector
3  *
4  * Generalized propagator calculation on a colorstd::vector
5  */
6 
7 #include "handle.h"
8 //#include "meas/inline/hadron/inline_genprop_matelem_pt_colorvec_w.h"
13 #include "meas/smear/displace.h"
14 #include "meas/glue/mesplq.h"
15 #include "qdp_map_obj.h"
16 #include "util/ferm/key_val_db.h"
18 #include "util/ft/sftmom.h"
19 #include "util/info/proginfo.h"
21 
23 #include "io/qprop_io.h"
24 #include "util/ferm/transf.h"
25 
26 namespace Chroma
27 {
28  /*!
29  * \ingroup hadron
30  *
31  * @{
32  */
33  namespace InlineGenPropMatElemPtColorVecEnv
34  {
35  // Reader for input parameters
36  void read(XMLReader& xml, const std::string& path, Params::Param_t::DispGamma_t& param)
37  {
38  XMLReader paramtop(xml, path);
39 
40  read(paramtop, "gamma", param.gamma);
41  read(paramtop, "displacement", param.displacement);
42  }
43 
44  // Reader for input parameters
45  void read(XMLReader& xml, const std::string& path, Params::Param_t& param)
46  {
47  XMLReader paramtop(xml, path);
48 
49  int version;
50  read(paramtop, "version", version);
51 
52  switch (version)
53  {
54  case 1:
55  param.restrict_plateau = false;
56  param.avg_equiv_mom = false;
57  break;
58 
59  case 2:
60  read(paramtop, "restrict_plateau", param.restrict_plateau);
61  read(paramtop, "avg_equiv_mom", param.avg_equiv_mom);
62  break;
63 
64  default :
65  QDPIO::cerr << "Input parameter version " << version << " unsupported." << std::endl;
66  QDP_abort(1);
67  }
68 
69  read(paramtop, "t_sink", param.t_sink);
70  read(paramtop, "mom2_max", param.mom2_max);
71  read(paramtop, "mom_offset", param.mom_offset);
72  read(paramtop, "displacement_length", param.displacement_length);
73  read(paramtop, "DisplacementGammaList", param.disp_gamma_list);
74  read(paramtop, "num_vecs", param.num_vecs);
75  read(paramtop, "mass_label", param.mass_label);
76 
77  param.link_smearing = readXMLGroup(paramtop, "LinkSmearing", "LinkSmearingType");
78  }
79 
80 
81  // Writer for input parameters
82  void write(XMLWriter& xml, const std::string& path, const Params::Param_t::DispGamma_t& param)
83  {
84  push(xml, path);
85 
86  write(xml, "gamma", param.gamma);
87  write(xml, "displacement", param.displacement);
88 
89  pop(xml);
90  }
91 
92  // Writer for input parameters
93  void write(XMLWriter& xml, const std::string& path, const Params::Param_t& param)
94  {
95  push(xml, path);
96 
97  int version = 2;
98 
99  write(xml, "version", version);
100  write(xml, "restrict_plateau", param.restrict_plateau);
101  write(xml, "avg_equiv_mom", param.avg_equiv_mom);
102  write(xml, "t_sink", param.t_sink);
103  write(xml, "mom_offset", param.mom_offset);
104  write(xml, "mom2_max", param.mom2_max);
105  write(xml, "displacement_length", param.displacement_length);
106  write(xml, "DisplacementGammaList", param.disp_gamma_list);
107  write(xml, "num_vecs", param.num_vecs);
108  write(xml, "mass_label", param.mass_label);
109 
110  xml << param.link_smearing.xml;
111 
112  pop(xml);
113  }
114 
115  //! Read named objects
116  void read(XMLReader& xml, const std::string& path, Params::NamedObject_t& input)
117  {
118  XMLReader inputtop(xml, path);
119 
120  read(inputtop, "gauge_id", input.gauge_id);
121  read(inputtop, "source_prop_id", input.source_prop_id);
122  read(inputtop, "sink_prop_id", input.sink_prop_id);
123  read(inputtop, "genprop_op_file", input.genprop_op_file);
124  }
125 
126  //! Write named objects
127  void write(XMLWriter& xml, const std::string& path, const Params::NamedObject_t& input)
128  {
129  push(xml, path);
130 
131  write(xml, "gauge_id", input.gauge_id);
132  write(xml, "source_prop_id", input.source_prop_id);
133  write(xml, "sink_prop_id", input.sink_prop_id);
134  write(xml, "genprop_op_file", input.genprop_op_file);
135 
136  pop(xml);
137  }
138 
139  // Writer for input parameters
140  void write(XMLWriter& xml, const std::string& path, const Params& param)
141  {
142  param.writeXML(xml, path);
143  }
144  }
145 
146 
147  namespace InlineGenPropMatElemPtColorVecEnv
148  {
149  // Anonymous namespace for registration
150  namespace
151  {
152  AbsInlineMeasurement* createMeasurement(XMLReader& xml_in,
153  const std::string& path)
154  {
155  return new InlineMeas(Params(xml_in, path));
156  }
157 
158  //! Local registration flag
159  bool registered = false;
160  }
161 
162  const std::string name = "GENPROP_MATELEM_PT_COLORVEC";
163 
164  //! Register all the factories
165  bool registerAll()
166  {
167  bool success = true;
168  if (! registered)
169  {
170  success &= LinkSmearingEnv::registerAll();
171  success &= TheInlineMeasurementFactory::Instance().registerObject(name, createMeasurement);
172  registered = true;
173  }
174  return success;
175  }
176 
177 
178  //! Anonymous namespace
179  /*! Diagnostic stuff */
180  namespace
181  {
182  StandardOutputStream& operator<<(StandardOutputStream& os, const multi1d<int>& d)
183  {
184  if (d.size() > 0)
185  {
186  os << d[0];
187 
188  for(int i=1; i < d.size(); ++i)
189  os << " " << d[i];
190  }
191 
192  return os;
193  }
194  }
195 
196 
197  //----------------------------------------------------------------------------
198  // Param stuff
200  {
201  frequency = 0;
202  param.mom2_max = 0;
203  }
204 
205  Params::Params(XMLReader& xml_in, const std::string& path)
206  {
207  try
208  {
209  XMLReader paramtop(xml_in, path);
210 
211  if (paramtop.count("Frequency") == 1)
212  read(paramtop, "Frequency", frequency);
213  else
214  frequency = 1;
215 
216  // Read program parameters
217  read(paramtop, "Param", param);
218 
219  // Read in the output propagator/source configuration info
220  read(paramtop, "NamedObject", named_obj);
221 
222  // Possible alternate XML file pattern
223  if (paramtop.count("xml_file") != 0)
224  {
225  read(paramtop, "xml_file", xml_file);
226  }
227  }
228  catch(const std::string& e)
229  {
230  QDPIO::cerr << __func__ << ": Caught Exception reading XML: " << e << std::endl;
231  QDP_abort(1);
232  }
233  }
234 
235 
236  void
237  Params::writeXML(XMLWriter& xml_out, const std::string& path) const
238  {
239  push(xml_out, path);
240 
241  // Parameters for source construction
242  write(xml_out, "Param", param);
243 
244  // Write out the output propagator/source configuration info
245  write(xml_out, "NamedObject", named_obj);
246 
247  pop(xml_out);
248  }
249 
250 
251  //----------------------------------------------------------------------------
252  //! Generalized propagator operator
254  {
255  int t_slice; /*!< Propagator time slice */
256  int t_source; /*!< Source time slice */
257  int t_sink; /*!< Source time slice */
258  int spin_l; /*!< Source spin index */
259  int spin_r; /*!< Sink spin index */
260  int gamma; /*!< The gamma matrix number - [0,Ns^2) */
261  multi1d<int> displacement; /*!< Displacement dirs of right colorstd::vector */
262  multi1d<int> mom; /*!< D-1 momentum of this operator */
263  std::string mass_label; /*!< A mass label */
264  };
265 
266  //! Generalized propagator operator
268  {
269  multi2d<ComplexD> op; /*!< Colorstd::vector source and sink with momentum projection */
270  };
271 
272 
273  //----------------------------------------------------------------------------
274  //! Holds key and value as temporaries
276  {
279  };
280 
281 
282  //----------------------------------------------------------------------------
283  //! KeyGenPropElementalOperator reader
284  void read(BinaryReader& bin, KeyGenPropElementalOperator_t& param)
285  {
286  read(bin, param.t_slice);
287  read(bin, param.t_source);
288  read(bin, param.t_sink);
289  read(bin, param.spin_l);
290  read(bin, param.spin_r);
291  read(bin, param.gamma);
292  read(bin, param.displacement);
293  read(bin, param.mom);
294  read(bin, param.mass_label, 32);
295  }
296 
297  //! GenPropElementalOperator write
298  void write(BinaryWriter& bin, const KeyGenPropElementalOperator_t& param)
299  {
300  write(bin, param.t_slice);
301  write(bin, param.t_source);
302  write(bin, param.t_sink);
303  write(bin, param.spin_l);
304  write(bin, param.spin_r);
305  write(bin, param.gamma);
306  write(bin, param.displacement);
307  write(bin, param.mom);
308  write(bin, param.mass_label);
309  }
310 
311 
312  //----------------------------------------------------------------------------
313  //! PropElementalOperator reader
314  void read(BinaryReader& bin, ValGenPropElementalOperator_t& param)
315  {
316  int n;
317  read(bin, n); // the size is always written, even if 0
318  param.op.resize(n,n);
319 
320  for(int i=0; i < n; ++i)
321  {
322  for(int j=0; j < n; ++j)
323  {
324  read(bin, param.op(i,j));
325  }
326  }
327  }
328 
329  //! GenPropElementalOperator write
330  void write(BinaryWriter& bin, const ValGenPropElementalOperator_t& param)
331  {
332  int n = param.op.size1(); // all sizes the same
333  write(bin, n);
334  for(int i=0; i < n; ++i)
335  {
336  for(int j=0; j < n; ++j)
337  {
338  write(bin, param.op(i,j));
339  }
340  }
341  }
342 
343 
344  //----------------------------------------------------------------------------
345  //! Normalize just one displacement array
346  multi1d<int> normDisp(const multi1d<int>& orig)
347  {
348  START_CODE();
349 
350  multi1d<int> disp;
351  multi1d<int> empty;
352  multi1d<int> no_disp(1); no_disp[0] = 0;
353 
354  // NOTE: a no-displacement is recorded as a zero-length array
355  // Convert a length one array with no displacement into a no-displacement array
356  if (orig.size() == 1)
357  {
358  if (orig == no_disp)
359  disp = empty;
360  else
361  disp = orig;
362  }
363  else
364  {
365  disp = orig;
366  }
367 
368  END_CODE();
369 
370  return disp;
371  } // void normDisp
372 
373 
374  //-------------------------------------------------------------------------------
375  // Function call
376  void
377  InlineMeas::operator()(unsigned long update_no,
378  XMLWriter& xml_out)
379  {
380  // If xml file not empty, then use alternate
381  if (params.xml_file != "")
382  {
383  std::string xml_file = makeXMLFileName(params.xml_file, update_no);
384 
385  push(xml_out, "GenPropMatElemPtColorVec");
386  write(xml_out, "update_no", update_no);
387  write(xml_out, "xml_file", xml_file);
388  pop(xml_out);
389 
390  XMLFileWriter xml(xml_file);
391  func(update_no, xml);
392  }
393  else
394  {
395  func(update_no, xml_out);
396  }
397  }
398 
399 
400  // Function call
401  void
402  InlineMeas::func(unsigned long update_no,
403  XMLWriter& xml_out)
404  {
405  START_CODE();
406 
407  StopWatch snoop;
408  snoop.reset();
409  snoop.start();
410 
411  StopWatch swiss;
412 
413  push(xml_out, "GenPropMatElemPtColorVec");
414  write(xml_out, "update_no", update_no);
415 
416  QDPIO::cout << name << ": Generalized propagator color-std::vector matrix element" << std::endl;
417 
418  // Test and grab a reference to the gauge field
419  XMLBufferWriter gauge_xml;
420  XMLReader source_prop_file_xml, source_prop_record_xml;
421  XMLReader sink_prop_file_xml, sink_prop_record_xml;
422  try
423  {
424  TheNamedObjMap::Instance().getData< multi1d<LatticeColorMatrix> >(params.named_obj.gauge_id);
425  TheNamedObjMap::Instance().get(params.named_obj.gauge_id).getRecordXML(gauge_xml);
426 
427  TheNamedObjMap::Instance().getData<LatticePropagator>(params.named_obj.source_prop_id);
429 
430  // Snarf the prop info. This is will throw if the prop_id is not there
431  TheNamedObjMap::Instance().get(params.named_obj.source_prop_id).getFileXML(source_prop_file_xml);
432  TheNamedObjMap::Instance().get(params.named_obj.source_prop_id).getRecordXML(source_prop_record_xml);
433 
434  // Snarf the prop info. This is will throw if the prop_id is not there
435  TheNamedObjMap::Instance().get(params.named_obj.sink_prop_id).getFileXML(sink_prop_file_xml);
436  TheNamedObjMap::Instance().get(params.named_obj.sink_prop_id).getRecordXML(sink_prop_record_xml);
437  }
438  catch( std::bad_cast )
439  {
440  QDPIO::cerr << name << ": caught dynamic cast error" << std::endl;
441  QDP_abort(1);
442  }
443  catch (const std::string& e)
444  {
445  QDPIO::cerr << name << ": std::map call failed: " << e << std::endl;
446  QDP_abort(1);
447  }
448  // Cast should be valid now
449  const multi1d<LatticeColorMatrix>& u =
450  TheNamedObjMap::Instance().getData< multi1d<LatticeColorMatrix> >(params.named_obj.gauge_id);
451 
452  const LatticePropagator& source_prop =
453  TheNamedObjMap::Instance().getData<LatticePropagator>(params.named_obj.source_prop_id);
454  const QDP::MapObject<KeyPropColorVec_t,LatticeFermion>& sink_ferm_map =
456 
457  push(xml_out, "Output_version");
458  write(xml_out, "out_version", 2);
459  pop(xml_out);
460 
461  proginfo(xml_out); // Print out basic program info
462 
463  // Write out the input
464  params.writeXML(xml_out, "Input");
465 
466  // Write out the source header
467  write(xml_out, "Source_prop_file_info", source_prop_file_xml);
468  write(xml_out, "Source_prop_record_info", source_prop_record_xml);
469  write(xml_out, "Sink_prop_file_info", sink_prop_file_xml);
470  write(xml_out, "Sink_prop_record_info", sink_prop_record_xml);
471 
472  // Write out the config info
473  write(xml_out, "Config_info", gauge_xml);
474 
475  //First calculate some gauge invariant observables just for info.
476  //This is really cheap.
477  MesPlq(xml_out, "Observables", u);
478 
479 
480  PropSourceConst_t source_header;
481 
482  read(source_prop_record_xml, "/Propagator/PropSource", source_header);
483 
484 
485  QDPIO::cout << "Point Propagator successfully found and parsed" << std::endl;
486 
487  //multi1d<int> source = prop_header.source_header.getTSrce();
488  multi1d<int> source = source_header.getTSrce();
489 
490  int decay_dir = source_header.j_decay ;
491  int t_source = source_header.t_source;
492 
493  //Real Mass = getMass(source_header.fermact);
494  //QDPIO::cout << "Mass = " << Mass << std::endl;
495  QDPIO::cout << "source = "
496  << source[0]<<" "
497  << source[1]<<" "
498  << source[2]<<" "
499  << source[3]<< std::endl;
500 
501 
502  //
503  // Initialize the slow Fourier transform phases
504  //
506  params.param.avg_equiv_mom, decay_dir);
507 
508  //
509  // Smear the gauge field if needed
510  //
511  multi1d<LatticeColorMatrix> u_smr = u;
512 
513  try
514  {
515  std::istringstream xml_l(params.param.link_smearing.xml);
516  XMLReader linktop(xml_l);
517  QDPIO::cout << "Link smearing type = " << params.param.link_smearing.id << std::endl;
518 
519 
521  linkSmearing(TheLinkSmearingFactory::Instance().createObject(params.param.link_smearing.id,
522  linktop,
524 
525  (*linkSmearing)(u_smr);
526  }
527  catch(const std::string& e)
528  {
529  QDPIO::cerr << name << ": Caught Exception link smearing: " << e << std::endl;
530  QDP_abort(1);
531  }
532 
533  MesPlq(xml_out, "Smeared_Observables", u_smr);
534 
535  //
536  // DB storage
537  //
538  BinaryStoreDB< SerialDBKey<KeyGenPropElementalOperator_t>, SerialDBData<ValGenPropElementalOperator_t> >
539  qdp_db;
540 
541  // Open the file, and write the meta-data and the binary for this operator
542  if (! qdp_db.fileExists(params.named_obj.genprop_op_file))
543  {
544  XMLBufferWriter file_xml;
545 
546  push(file_xml, "DBMetaData");
547  write(file_xml, "id", std::string("genPropElemOp"));
548  write(file_xml, "lattSize", QDP::Layout::lattSize());
549  write(file_xml, "decay_dir", decay_dir);
550  proginfo(file_xml); // Print out basic program info
551  write(file_xml, "Params", params.param);
552  write(file_xml, "Op_Info", params.param.disp_gamma_list);
553  write(file_xml, "Source_prop_record_info", source_prop_record_xml);
554  write(file_xml, "Sink_prop_record_info", sink_prop_record_xml);
555  write(file_xml, "Config_info", gauge_xml);
556  write(file_xml, "source", source);
557  pop(file_xml);
558 
559  // NOTE: we always write a metadata, even if the file exists.
560  // Probably should not do this if a file already exists.
561  // Yukky, but add on a bunch of padding.
562  // This is in case a latter task writes another metadata.
563  std::string file_str(file_xml.str());
564  qdp_db.setMaxUserInfoLen(file_str.size());
565 
566  qdp_db.open(params.named_obj.genprop_op_file, O_RDWR | O_CREAT, 0664);
567 
568  qdp_db.insertUserdata(file_str);
569  }
570  else
571  {
572  qdp_db.open(params.named_obj.genprop_op_file, O_RDWR, 0664);
573  }
574 
575 
576  //
577  // Generalized propagatos
578  //
579  QDPIO::cout << "Building generalized propagators" << std::endl;
580 
581  push(xml_out, "ElementalOps");
582 
583  // Loop over all time slices for the source. This is the same
584  // as the subsets for phases
585 
586  const bool restrict_plateau = params.param.restrict_plateau;
587  const int num_vecs = params.param.num_vecs;
588  const int t_sink = params.param.t_sink;
589 
590  // Define the start and end region for the plateau
591  int t_start;
592  int t_end;
593 
594  if (restrict_plateau)
595  {
596  t_start = t_source;
597  t_end = t_sink;
598 
599  if (t_source > t_sink)
600  {
601  t_end += phases.numSubsets();
602  }
603  }
604  else
605  {
606  t_start = 0;
607  t_end = phases.numSubsets() - 1;
608  }
609 
610  // Loop over each operator
611  for(int l=0; l < params.param.disp_gamma_list.size(); ++l)
612  {
613  StopWatch watch;
614 
615  QDPIO::cout << "Elemental operator: op = " << l << std::endl;
616 
617  // Make sure displacement is something sensible
618  multi1d<int> disp = normDisp(params.param.disp_gamma_list[l].displacement);
619 
620  // Fold in the gamma_5 associated with hermiticity of the sink.
621  // Can multiply the desired Gamma on the left by gamma_5
622  int gamma = params.param.disp_gamma_list[l].gamma;
623  int gamma_tmp = (Ns*Ns-1) ^ gamma;
624 
625  QDPIO::cout << "gamma=" << gamma_tmp << " displacement= " << disp << std::endl;
626 
627  // Build the operator
628  swiss.reset();
629  swiss.start();
630 
631  // Big loop over the momentum projection
632  for(int mom_num = 0 ; mom_num < phases.numMom() ; ++mom_num)
633  {
634  // Loop over spins
635  for(int spin_r=0; spin_r < Ns; ++spin_r)
636  {
637  QDPIO::cout << "spin_r = " << spin_r << std::endl;
638 
639  for(int spin_l=0; spin_l < Ns; ++spin_l)
640  {
641  QDPIO::cout << "spin_l = " << spin_l << std::endl;
642 
643  // The keys for the spin and displacements for this particular elemental operator
644  // No displacement for left colorstd::vector, only displace right colorstd::vector
645  // Invert the time - make it an independent key
646  multi1d<KeyValGenPropElementalOperator_t> buf(phases.numSubsets());
647  for(int tt=t_start; tt <= t_end; ++tt)
648  {
649  int t = tt % phases.numSubsets(); // mod back into a normal interval
650 
651  buf[t].key.key().t_slice = t;
652  buf[t].key.key().t_source = t_source;
653  buf[t].key.key().t_sink = t_sink;
654  buf[t].key.key().spin_r = spin_r;
655  buf[t].key.key().spin_l = spin_l;
656  buf[t].key.key().mass_label = params.param.mass_label;
657  buf[t].key.key().mom = phases.numToMom(mom_num);
658  buf[t].key.key().gamma = gamma;
659  buf[t].key.key().displacement = disp; // only right colorstd::vector
660 
661  buf[t].val.data().op.resize(num_vecs, Nc);
662  }
663 
664  for(int color_r = 0; color_r < Nc; ++color_r)
665  {
666 
667  LatticeFermion q ;
668  PropToFerm(source_prop, q, color_r, spin_r);
669 
670  // Displace the right std::vector and multiply by the momentum phase
671  LatticeFermion shift_ferm = Gamma(gamma_tmp) * displace(u_smr, q,
673  disp);
674 
675  for(int i = 0; i < params.param.num_vecs; ++i)
676  {
677  KeyPropColorVec_t key_l;
678  key_l.t_source = t_sink;
679  key_l.colorvec_src = i;
680  key_l.spin_src = spin_l;
681 
682  watch.reset();
683  watch.start();
684 
685  // Contract over color indices
686  // Do the relevant quark contraction
687  LatticeFermion tmpvec_sink; sink_ferm_map.get(key_l, tmpvec_sink);
688 
689  LatticeComplex lop = localInnerProduct(tmpvec_sink, shift_ferm);
690 
691  // Reweight the phase in case there was momentum averaging
692  Real reweight;
693  if (phases.multiplicity(mom_num) > 0)
694  reweight = Real(phases.multiplicity(mom_num));
695  else
696  reweight = 1.0;
697 
698  // Slow fourier-transform
699  multi1d<ComplexD> op_sum = sumMulti(reweight * phases[mom_num] * lop, phases.getSet());
700 
701  watch.stop();
702 
703  for(int tt=t_start; tt <= t_end; ++tt)
704  {
705  int t = tt % phases.numSubsets(); // mod back into a normal interval
706  buf[t].val.data().op(i,color_r) = op_sum[t];
707  }
708  } // end for i
709  } // end for j
710 
711  QDPIO::cout << "insert: mom= " << phases.numToMom(mom_num) << " displacement= " << disp << std::endl;
712  for(int tt=t_start; tt <= t_end; ++tt)
713  {
714  int t = tt % phases.numSubsets(); // mod back into a normal interval
715  qdp_db.insert(buf[t].key, buf[t].val);
716  }
717 
718  } // end for spin_l
719  } // end for spin_r
720  } // mom_num
721 
722  swiss.stop();
723 
724  QDPIO::cout << "GenProp operator= " << l
725  << " time= "
726  << swiss.getTimeInSeconds()
727  << " secs" << std::endl;
728 
729  } // for l
730 
731  pop(xml_out); // ElementalOps
732 
733  // Close the namelist output file XMLDAT
734  pop(xml_out); // GenPropMatElemColorVector
735 
736  snoop.stop();
737  QDPIO::cout << name << ": total time = "
738  << snoop.getTimeInSeconds()
739  << " secs" << std::endl;
740 
741  QDPIO::cout << name << ": ran successfully" << std::endl;
742 
743  END_CODE();
744  } // func
745  } // namespace InlineGenPropMatElemPtColorVecEnv
746 
747  /*! @} */ // end of group hadron
748 
749 } // namespace Chroma
Inline measurement factory.
Class for counted reference semantics.
Definition: handle.h:33
void func(const unsigned long update_no, XMLWriter &xml_out)
Do the measurement.
void operator()(const unsigned long update_no, XMLWriter &xml_out)
Do the measurement.
Serializable value harness.
Definition: key_val_db.h:69
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
multi1d< int > numToMom(int mom_num) const
Convert momenta id to actual array of momenta.
Definition: sftmom.h:78
int numMom() const
Number of momenta.
Definition: sftmom.h:60
int multiplicity(int mom_num) const
Return the the multiplicity for this momenta id.
Definition: sftmom.h:94
const Set & getSet() const
The set to be used in sumMulti.
Definition: sftmom.h:57
static T & Instance()
Definition: singleton.h:432
Parallel transport a lattice field.
void PropToFerm(const LatticePropagatorF &b, LatticeFermionF &a, int color_index, int spin_index)
Extract a LatticeFermion from a LatticePropagator.
Definition: transf.cc:226
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.
T displace(const multi1d< LatticeColorMatrix > &u, const T &psi, int length, int dir, const Subset &sub)
Apply a displacement operator to a lattice field.
Definition: displace.cc:41
Class for counted reference semantics.
Compute the matrix element of LatticeColorVector*M^-1*Gamma*M^-1**LatticeColorVector.
Key for propagator colorstd::vector sources.
Key and values for DB.
unsigned j
Definition: ldumul_w.cc:35
unsigned n
Definition: ldumul_w.cc:36
Make xml file writer.
int t
Definition: meslate.cc:37
Double q
Definition: mesq.cc:17
Named object function std::map.
static bool registered
Local registration flag.
multi1d< int > normDisp(const multi1d< int > &orig)
Normalize just one displacement array.
void read(XMLReader &xml, const std::string &path, Params::Param_t::DispGamma_t &param)
void write(XMLWriter &xml, const std::string &path, const Params::Param_t::DispGamma_t &param)
QDPSubTypeTrait< typename BinaryReturn< C1, C2, FnLocalInnerProduct >::Type_t >::Type_t localInnerProduct(const QDPSubType< T1, C1 > &l, const QDPType< T2, C2 > &r)
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
push(xml_out,"Condensates")
int i
Definition: pbg5p_w.cc:55
pop(xml_out)
void MesPlq(const multi1d< LatticeColorMatrixF3 > &u, multi2d< Double > &plane_plaq, Double &link)
Definition: mesplq.cc:83
DComplex d
Definition: invbicg.cc:99
START_CODE()
::std::string string
Definition: gtest.h:1979
int l
Definition: pade_trln_w.cc:111
Print out basic info about this program.
Routines associated with Chroma propagator IO.
Fourier transform phase factor support.
void writeXML(XMLWriter &xml_out, const std::string &path) const
Propagator source construction parameters.
Definition: qprop_io.h:27
multi1d< int > getTSrce() const
Definition: qprop_io.cc:120