CHROMA
inline_heavy_light_cont_w.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Inline construction of hadron contractions
3  * Still just does static!!
4  * Contraction calculations
5  */
6 
9 #include "meas/glue/mesplq.h"
10 #include "util/ft/sftmom.h"
11 #include "util/info/proginfo.h"
12 #include "io/param_io.h"
13 #include "io/qprop_io.h"
14 #include "meas/hadron/mesQl_w.h"
15 #include "meas/hadron/Ql_3pt_w.h"
16 #include "meas/hadron/curcor2_w.h"
20 
21 namespace Chroma
22 {
23  namespace InlineHeavyLightContEnv
24  {
25  namespace
26  {
27  AbsInlineMeasurement* createMeasurement(XMLReader& xml_in,
28  const std::string& path)
29  {
30  return new InlineHeavyLightCont(InlineHeavyLightContParams(xml_in, path));
31  }
32 
33  //! Local registration flag
34  bool registered = false;
35  }
36 
37  const std::string name = "HEAVY_LIGHT_CONTRACTION";
38 
39  //! Register all the factories
40  bool registerAll()
41  {
42  bool success = true;
43  if (! registered)
44  {
45  success &= TheInlineMeasurementFactory::Instance().registerObject(name, createMeasurement);
46  registered = true;
47  }
48  return success;
49  }
50  }
51 
52 
53 
54  //! Reader for parameters
55  void read(XMLReader& xml, const std::string& path, InlineHeavyLightContParams::Param_t& param)
56  {
57  XMLReader paramtop(xml, path);
58 
59  int version;
60  read(paramtop, "version", version);
61 
62  switch (version)
63  {
64  case 1:
65  break;
66 
67  default:
68  QDPIO::cerr << "Input parameter version " << version << " unsupported." << std::endl;
69  QDP_abort(1);
70  }
71 
72  read(paramtop, "MesonP", param.MesonP);
73  read(paramtop, "FourPt", param.FourPt);
74 
75  }
76 
77 
78  //! Writer for parameters
79  void write(XMLWriter& xml, const std::string& path, const InlineHeavyLightContParams::Param_t& param)
80  {
81  push(xml, path);
82 
83  int version = 1;
84  write(xml, "version", version);
85 
86  write(xml, "MesonP", param.MesonP);
87  write(xml, "FourPt", param.FourPt);
88  write(xml, "nrow", Layout::lattSize());
89 
90  pop(xml);
91  }
92 
93 
94  //! Propagator input
95  void read(XMLReader& xml, const std::string& path, InlineHeavyLightContParams::NamedObject_t::Props_t& input)
96  {
97  XMLReader inputtop(xml, path);
98 
99  read(inputtop, "first_id", input.first_id);
100  read(inputtop, "second_id", input.second_id);
101  if (inputtop.count("third_id") == 1)
102  read(inputtop, "third_id", input.third_id);
103  else
104  input.third_id = "None";
105 
106  if (inputtop.count("heavy_id1") == 1)
107  read(inputtop, "heavy_id1", input.heavy_id1);
108  else
109  input.heavy_id1 = "Static";
110  if (inputtop.count("heavy_id2") == 1)
111  read(inputtop, "heavy_id2", input.heavy_id2);
112  else
113  input.heavy_id2 = "Static";
114  }
115 
116  //! Propagator output
117  void write(XMLWriter& xml, const std::string& path, const InlineHeavyLightContParams::NamedObject_t::Props_t& input)
118  {
119  push(xml, path);
120 
121  write(xml, "first_id", input.first_id);
122  write(xml, "second_id", input.second_id);
123  write(xml, "third_id", input.third_id);
124 
125  write(xml, "heavy_id1", input.heavy_id1);
126  write(xml, "heavy_id2", input.heavy_id2);
127  pop(xml);
128  }
129 
130 
131  //! Propagator input
132  void read(XMLReader& xml, const std::string& path, InlineHeavyLightContParams::NamedObject_t& input)
133  {
134  XMLReader inputtop(xml, path);
135 
136  read(inputtop, "gauge_id", input.gauge_id);
137  read(inputtop, "sink_pairs", input.sink_pairs);
138  }
139 
140  //! Propagator output
141  void write(XMLWriter& xml, const std::string& path, const InlineHeavyLightContParams::NamedObject_t& input)
142  {
143  push(xml, path);
144 
145  write(xml, "gauge_id", input.gauge_id);
146  write(xml, "sink_pairs", input.sink_pairs);
147 
148  pop(xml);
149  }
150 
151 
152  // Param stuff
154  {
155  frequency = 0;
156  }
157 
159  {
160  try
161  {
162  XMLReader paramtop(xml_in, path);
163 
164  if (paramtop.count("Frequency") == 1)
165  read(paramtop, "Frequency", frequency);
166  else
167  frequency = 1;
168 
169  // Parameters for source construction
170  read(paramtop, "Param", param);
171 
172  // Read in the output propagator/source configuration info
173  read(paramtop, "NamedObject", named_obj);
174 
175  // Possible alternate XML file pattern
176  if (paramtop.count("xml_file") != 0)
177  {
178  read(paramtop, "xml_file", xml_file);
179  }
180  }
181  catch(const std::string& e)
182  {
183  QDPIO::cerr << __func__ << ": Caught Exception reading XML: " << e << std::endl;
184  QDP_abort(1);
185  }
186  }
187 
188 
189  void
190  InlineHeavyLightContParams::write(XMLWriter& xml_out, const std::string& path)
191  {
192  push(xml_out, path);
193 
194  Chroma::write(xml_out, "Param", param);
195  Chroma::write(xml_out, "NamedObject", named_obj);
196  QDP::write(xml_out, "xml_file", xml_file);
197 
198  pop(xml_out);
199  }
200 
201  // Anonymous namespace
202  namespace
203  {
204  //! Useful structure holding sink props
205  struct SinkPropContainer_t
206  {
207  ForwardProp_t prop_header;
209  Real Mass;
210 
211  multi1d<int> bc;
212 
217  };
218 
219 
220  //! Useful structure holding sink props
221  struct AllSinkProps_t
222  {
223  SinkPropContainer_t sink_prop_1;
224  SinkPropContainer_t sink_prop_2;
225  SinkPropContainer_t sink_prop_3;
226 
227  SinkPropContainer_t heavy_prop_1;
228  SinkPropContainer_t heavy_prop_2;
229  };
230 
231 
232  //! Read a sink prop
233  void readSinkProp(SinkPropContainer_t& s, const std::string& id)
234  {
235  try
236  {
237  // Try a cast to see if it succeeds
238  const LatticePropagator& foo =
239  TheNamedObjMap::Instance().getData<LatticePropagator>(id);
240 
241  // Snarf the data into a copy
242  s.quark_propagator_id = id;
243 
244  // Snarf the prop info. This is will throw if the prop_id is not there
245  XMLReader prop_file_xml, prop_record_xml;
246  TheNamedObjMap::Instance().get(id).getFileXML(prop_file_xml);
247  TheNamedObjMap::Instance().get(id).getRecordXML(prop_record_xml);
248 
249  // Try to invert this record XML into a ChromaProp struct
250  // Also pull out the id of this source
251  {
252  std::string xpath;
253  read(prop_record_xml, "/SinkSmear", s.prop_header);
254 
255  read(prop_record_xml, "/SinkSmear/PropSource/Source/SourceType", s.source_type);
256  xpath = "/SinkSmear/PropSource/Source/Displacement/DisplacementType";
257  if (prop_record_xml.count(xpath) != 0)
258  read(prop_record_xml, xpath, s.source_disp_type);
259  else
260  s.source_disp_type = NoQuarkDisplacementEnv::getName();
261 
262  read(prop_record_xml, "/SinkSmear/PropSink/Sink/SinkType", s.sink_type);
263  xpath = "/SinkSmear/PropSink/Sink/Displacement/DisplacementType";
264  if (prop_record_xml.count(xpath) != 0)
265  read(prop_record_xml, xpath, s.sink_disp_type);
266  else
267  s.sink_disp_type = NoQuarkDisplacementEnv::getName();
268  }
269  }
270  catch( std::bad_cast )
271  {
272  QDPIO::cerr << InlineHeavyLightContEnv::name << ": caught dynamic cast error"
273  << std::endl;
274  QDP_abort(1);
275  }
276  catch (const std::string& e)
277  {
278  QDPIO::cerr << InlineHeavyLightContEnv::name << ": error message: " << e
279  << std::endl;
280  QDP_abort(1);
281  }
282 
283  // Derived from input prop
284  // Hunt around to find the mass
285  // NOTE: this may be problematic in the future if actions are used with no
286  // clear def. of a Mass
287  QDPIO::cout << "Try action and mass" << std::endl;
288  s.Mass = getMass(s.prop_header.prop_header.fermact);
289  s.bc = getFermActBoundary(s.prop_header.prop_header.fermact);
290 
291  QDPIO::cout << "FermAct = " << s.prop_header.prop_header.fermact.id << std::endl;
292  QDPIO::cout << "Mass = " << s.Mass << std::endl;
293  }
294 
295 
296  //! Read all sinks
297  void readAllSinks(AllSinkProps_t& s,
298  InlineHeavyLightContParams::NamedObject_t::Props_t sink_pair,
299  InlineHeavyLightContParams::Param_t params)
300  {
301  QDPIO::cout << "Attempt to parse forward propagator = " << sink_pair.first_id << std::endl;
302  readSinkProp(s.sink_prop_1, sink_pair.first_id);
303  QDPIO::cout << "Forward propagator successfully parsed" << std::endl;
304 
305  QDPIO::cout << "Attempt to parse forward propagator = " << sink_pair.second_id << std::endl;
306  readSinkProp(s.sink_prop_2, sink_pair.second_id);
307  QDPIO::cout << "Forward propagator successfully parsed" << std::endl;
308 
309  if (sink_pair.third_id != "None"){
310  QDPIO::cout << "Attempt to parse forward propagator = " << sink_pair.third_id << std::endl;
311  readSinkProp(s.sink_prop_3, sink_pair.third_id);
312  QDPIO::cout << "Forward propagator successfully parsed" << std::endl;
313  }
314  else{
315  QDPIO::cout << "Using "<<sink_pair.second_id <<" as dummy spectator." << std::endl;
316  readSinkProp(s.sink_prop_3, sink_pair.second_id);
317  QDPIO::cout << "Forward propagator successfully parsed" << std::endl;
318  }
319  if (sink_pair.heavy_id1 != "Static"){
320  QDPIO::cout << "Attempt to parse forward propagator = " << sink_pair.heavy_id1 << std::endl;
321  readSinkProp(s.heavy_prop_1, sink_pair.heavy_id1);
322  QDPIO::cout << "Forward propagator successfully parsed" << std::endl;
323  }
324  if (sink_pair.heavy_id2 != "Static"){
325  QDPIO::cout << "Attempt to parse forward propagator = " << sink_pair.heavy_id2 << std::endl;
326  readSinkProp(s.heavy_prop_2, sink_pair.heavy_id2);
327  QDPIO::cout << "Forward propagator successfully parsed" << std::endl;
328  }
329  }
330  } // namespace anonymous
331 
332 
333 
334  // Function call
335  void
336  InlineHeavyLightCont::operator()(unsigned long update_no,
337  XMLWriter& xml_out)
338  {
339  // If xml file not empty, then use alternate
340  if (params.xml_file != "")
341  {
342  std::string xml_file = makeXMLFileName(params.xml_file, update_no);
343 
344  push(xml_out, "HeavyLightCont");
345  write(xml_out, "update_no", update_no);
346  write(xml_out, "xml_file", xml_file);
347  pop(xml_out);
348 
349  XMLFileWriter xml(xml_file);
350  func(update_no, xml);
351  }
352  else
353  {
354  func(update_no, xml_out);
355  }
356  }
357 
358  // Real work done here
359  void
360  InlineHeavyLightCont::func(unsigned long update_no,
361  XMLWriter& xml_out)
362  {
363  START_CODE();
364 
365  StopWatch snoop;
366  snoop.reset();
367  snoop.start();
368 
369  // Test and grab a reference to the gauge field
370  XMLBufferWriter gauge_xml;
371  try
372  {
373  TheNamedObjMap::Instance().getData< multi1d<LatticeColorMatrix> >(params.named_obj.gauge_id);
374  TheNamedObjMap::Instance().get(params.named_obj.gauge_id).getRecordXML(gauge_xml);
375  }
376  catch( std::bad_cast )
377  {
378  QDPIO::cerr << InlineHeavyLightContEnv::name << ": caught dynamic cast error"
379  << std::endl;
380  QDP_abort(1);
381  }
382  catch (const std::string& e)
383  {
384  QDPIO::cerr << InlineHeavyLightContEnv::name << ": std::map call failed: " << e
385  << std::endl;
386  QDP_abort(1);
387  }
388  const multi1d<LatticeColorMatrix>& u =
389  TheNamedObjMap::Instance().getData< multi1d<LatticeColorMatrix> >(params.named_obj.gauge_id);
390 
391  push(xml_out, "HeavyLightCont");
392  write(xml_out, "update_no", update_no);
393 
394  QDPIO::cout << " HeavyLightCont: Contractions for Wilson-like fermions" ;
395  QDPIO::cout << std::endl;
396  QDPIO::cout << std::endl << " Gauge group: SU(" << Nc << ")" << std::endl;
397  QDPIO::cout << " volume: " << Layout::lattSize()[0];
398  for (int i=1; i<Nd; ++i) {
399  QDPIO::cout << " x " << Layout::lattSize()[i];
400  }
401  QDPIO::cout << std::endl;
402 
403  proginfo(xml_out); // Print out basic program info
404 
405  // Write out the input
406  params.write(xml_out, "Input");
407 
408  // Write out the config info
409  write(xml_out, "Config_info", gauge_xml);
410 
411  push(xml_out, "Output_version");
412  write(xml_out, "out_version", 14);
413  pop(xml_out);
414 
415  // First calculate some gauge invariant observables just for info.
416  MesPlq(xml_out, "Observables", u);
417 
418  // Keep an array of all the xml output buffers
419  push(xml_out, "Wilson_hadron_measurements");
420 
421  // Now loop over the various fermion pairs
422  // Here we want to make the separate versions of the code.
423  // There are three: With two static, with one static, or with
424  // zero static heavy quarks.
425  for(int lpair=0; lpair < params.named_obj.sink_pairs.size(); ++lpair)
426  {
427  // Note that this named_obj should have the defs of the props...
430 
431  push(xml_out, "elem");
432 
433  AllSinkProps_t all_sinks;
434  readAllSinks(all_sinks, named_obj, param);
435 
436  // Derived from input prop
437  multi1d<int> t_src1
438  = all_sinks.sink_prop_1.prop_header.source_header.getTSrce();
439  multi1d<int> t_src2
440  = all_sinks.sink_prop_2.prop_header.source_header.getTSrce();
441  // Note the third prop must be here, but is ignored later if not doing four-point...
442  multi1d<int> t_src3
443  = all_sinks.sink_prop_3.prop_header.source_header.getTSrce();
444 
445  int j_decay = all_sinks.sink_prop_1.prop_header.source_header.j_decay;
446  int t01 = all_sinks.sink_prop_1.prop_header.source_header.t_source;
447  int t02 = all_sinks.sink_prop_2.prop_header.source_header.t_source;
448  int bc_spec = all_sinks.sink_prop_1.bc[j_decay] ;
449 
450  // Sanity checks
451  {
452  if (all_sinks.sink_prop_2.prop_header.source_header.j_decay != j_decay)
453  {
454  QDPIO::cerr << "Error!! j_decay must be the same for all propagators " << std::endl;
455  QDP_abort(1);
456  }
457  /**
458  if (named_obj.heavy_id1 != "Static"){
459  if ((all_sinks.heavy_prop_1.prop_header.source_header.t_source != t01)
460  || (all_sinks.heavy_prop_1.prop_header.source_header.t_source != t02))
461  {
462  QDPIO::cerr << "Error!! Heavy quark 1 must have same t_source as one of the light propagators " << std::endl;
463  QDP_abort(1);
464  }
465  if (all_sinks.heavy_prop_1.prop_header.source_header.j_decay != j_decay)
466  {
467  QDPIO::cerr << "Error!! j_decay must be the same for all propagators " << std::endl;
468  QDP_abort(1);
469  }
470  }
471  if (named_obj.heavy_id2 != "Static"){
472  if ((all_sinks.heavy_prop_2.prop_header.source_header.t_source != t01)
473  || (all_sinks.heavy_prop_2.prop_header.source_header.t_source != t02))
474  {
475  QDPIO::cerr << "Error!! Heavy quark 2 must have same t_source as one of the light propagators " << std::endl;
476  QDP_abort(1);
477  }
478  if (all_sinks.heavy_prop_2.prop_header.source_header.j_decay != j_decay)
479  {
480  QDPIO::cerr << "Error!! j_decay must be the same for all propagators " << std::endl;
481  QDP_abort(1);
482  }
483  }
484 
485  if (all_sinks.sink_prop_2.bc[j_decay] != bc_spec)
486  {
487  QDPIO::cerr << "Error!! bc must be the same for all propagators " << std::endl;
488  QDP_abort(1);
489  }
490  if (params.param.FourPt){
491  if (all_sinks.sink_prop_3.prop_header.source_header.j_decay != j_decay)
492  {
493  QDPIO::cerr << "Error!! j_decay must be the same for all propagators " << std::endl;
494  QDP_abort(1);
495  }
496  if (all_sinks.sink_prop_3.bc[j_decay] != bc_spec)
497  {
498  QDPIO::cerr << "Error!! bc must be the same for all propagators " << std::endl;
499  QDP_abort(1);
500  }
501  }
502  **/
503  }
504 
505  /**
506  Here we want to define the bc's for everything...in principle this
507  should be read in from everything, but whatever.
508  **/
509 
510  int HQBC = -1;
511 
512  if (named_obj.heavy_id1=="Static" && named_obj.heavy_id2=="Static"){
513 
514  // Masses
515  write(xml_out, "Mass_1", all_sinks.sink_prop_1.Mass);
516  write(xml_out, "Mass_2", all_sinks.sink_prop_2.Mass);
517  if (params.param.FourPt)
518  write(xml_out, "Mass_3", all_sinks.sink_prop_3.Mass);
519  write(xml_out, "t01", t01);
520  write(xml_out, "t02", t02);
521 
522  // Initialize the slow Fourier transform phases with NO momenta
523  SftMom phases(0, true, j_decay);
524 
525  // Save prop input
526  push(xml_out, "Forward_prop_headers");
527  write(xml_out, "First_forward_prop", all_sinks.sink_prop_1.prop_header);
528  write(xml_out, "Second_forward_prop", all_sinks.sink_prop_2.prop_header);
529  if (params.param.FourPt)
530  write(xml_out, "Third_forward_prop", all_sinks.sink_prop_3.prop_header);
531  pop(xml_out);
532 
533  // Sanity check - write out the norm2 of the forward prop in the j_decay direction
534  // Use this for any possible verification
535  push(xml_out, "Forward_prop_correlator");
536  {
537  const LatticePropagator& sink_prop_1 =
538  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.sink_prop_1.quark_propagator_id);
539  const LatticePropagator& sink_prop_2 =
540  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.sink_prop_2.quark_propagator_id);
541  const LatticePropagator& sink_prop_3 =
542  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.sink_prop_3.quark_propagator_id);
543 
544  write(xml_out, "forward_prop_corr_1", sumMulti(localNorm2(sink_prop_1), phases.getSet()));
545  write(xml_out, "forward_prop_corr_2", sumMulti(localNorm2(sink_prop_2), phases.getSet()));
546 
547  write(xml_out, "forward_prop_corr_3", sumMulti(localNorm2(sink_prop_3), phases.getSet()));
548  }
549  pop(xml_out);
550 
551 
552  push(xml_out, "SourceSinkType");
553  {
554  QDPIO::cout << "Source_type_1 = " << all_sinks.sink_prop_1.source_type << std::endl;
555  QDPIO::cout << "Sink_type_1 = " << all_sinks.sink_prop_1.sink_type << std::endl;
556  QDPIO::cout << "Source_type_2 = " << all_sinks.sink_prop_2.source_type << std::endl;
557  QDPIO::cout << "Sink_type_2 = " << all_sinks.sink_prop_2.sink_type << std::endl;
558  if (params.param.FourPt){
559  QDPIO::cout << "Source_type_3 = " << all_sinks.sink_prop_3.source_type << std::endl;
560  QDPIO::cout << "Sink_type_3 = " << all_sinks.sink_prop_3.sink_type << std::endl;
561  }
562  write(xml_out, "source_type_1", all_sinks.sink_prop_1.source_type);
563  write(xml_out, "source_disp_type_1", all_sinks.sink_prop_1.source_disp_type);
564  write(xml_out, "sink_type_1", all_sinks.sink_prop_1.sink_type);
565  write(xml_out, "sink_disp_type_1", all_sinks.sink_prop_1.sink_disp_type);
566 
567  write(xml_out, "source_type_2", all_sinks.sink_prop_2.source_type);
568  write(xml_out, "source_disp_type_2", all_sinks.sink_prop_2.source_disp_type);
569  write(xml_out, "sink_type_2", all_sinks.sink_prop_2.sink_type);
570  write(xml_out, "sink_disp_type_2", all_sinks.sink_prop_2.sink_disp_type);
571  if (params.param.FourPt){
572  write(xml_out, "source_type_3", all_sinks.sink_prop_3.source_type);
573  write(xml_out, "source_disp_type_3", all_sinks.sink_prop_3.source_disp_type);
574  write(xml_out, "sink_type_3", all_sinks.sink_prop_3.sink_type);
575  write(xml_out, "sink_disp_type_3", all_sinks.sink_prop_3.sink_disp_type);
576  }
577  }
578  pop(xml_out);
579 
580 
581  // References for use later
582  const LatticePropagator& sink_prop_1 =
583  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.sink_prop_1.quark_propagator_id);
584  const LatticePropagator& sink_prop_2 =
585  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.sink_prop_2.quark_propagator_id);
586  const LatticePropagator& sink_prop_3 =
587  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.sink_prop_3.quark_propagator_id);
588 
589  // Construct group name for output
590  std::string src_type;
591  if (all_sinks.sink_prop_1.source_type == "POINT_SOURCE")
592  src_type = "Point";
593  else if (all_sinks.sink_prop_1.source_type == "SHELL_SOURCE")
594  src_type = "Shell";
595  else if (all_sinks.sink_prop_1.source_type == "WALL_SOURCE")
596  src_type = "Wall";
597  else
598  {
599  QDPIO::cerr << "Unsupported source type = " << all_sinks.sink_prop_1.source_type << std::endl;
600  QDP_abort(1);
601  }
602 
603  std::string snk_type;
604  if (all_sinks.sink_prop_1.sink_type == "POINT_SINK")
605  snk_type = "Point";
606  else if (all_sinks.sink_prop_1.sink_type == "SHELL_SINK")
607  snk_type = "Shell";
608  else if (all_sinks.sink_prop_1.sink_type == "WALL_SINK")
609  snk_type = "Wall";
610  else
611  {
612  QDPIO::cerr << "Unsupported sink type = " << all_sinks.sink_prop_1.sink_type << std::endl;
613  QDP_abort(1);
614  }
615 
616  std::string source_sink_type = src_type + "_" + snk_type;
617  QDPIO::cout << "Source type = " << src_type << std::endl;
618  QDPIO::cout << "Sink type = " << snk_type << std::endl;
619 
620  if (params.param.MesonP)
621  {
622  Qlbar(u, sink_prop_1, t_src1, phases, xml_out, source_sink_type+"_Wilson_Qlmeson1",HQBC);
623  if(all_sinks.sink_prop_1.quark_propagator_id!=all_sinks.sink_prop_2.quark_propagator_id)
624  Qlbar(u, sink_prop_2, t_src2, phases, xml_out, source_sink_type+"_Wilson_Qlmeson2",HQBC);
625  if (params.param.FourPt && all_sinks.sink_prop_3.quark_propagator_id!=all_sinks.sink_prop_2.quark_propagator_id && all_sinks.sink_prop_1.quark_propagator_id!=all_sinks.sink_prop_3.quark_propagator_id)
626  Qlbar(u, sink_prop_3, t_src3, phases, xml_out, source_sink_type + "_Wilson_Qlmeson3",HQBC);
627  // For testing backwards prop, we will calculate the Qlbar for a backwards
628  // static quark
629  QlbarBACK(u, sink_prop_1, t_src1, phases, xml_out, source_sink_type+"_Wilson_Ql_back_meson1",HQBC);
630  if(all_sinks.sink_prop_1.quark_propagator_id!=all_sinks.sink_prop_2.quark_propagator_id)
631  QlbarBACK(u, sink_prop_2, t_src2, phases, xml_out, source_sink_type+"_Wilson_Ql_back_meson2",HQBC);
632  if (params.param.FourPt && all_sinks.sink_prop_3.quark_propagator_id!=all_sinks.sink_prop_2.quark_propagator_id && all_sinks.sink_prop_1.quark_propagator_id!=all_sinks.sink_prop_3.quark_propagator_id)
633  QlbarBACK(u, sink_prop_3, t_src3, phases, xml_out, source_sink_type + "_Wilson_Ql_back_meson3",HQBC);
634 
635 
636  } // end if (MesonP)
637 
638  //Now we actually will do the contractions...
639 
640  QlQl(u, sink_prop_1, sink_prop_2, t_src1, t_src2, HQBC, phases, xml_out, source_sink_type +"Wilson_Ql_Ql_3pt");
641 
642  pop(xml_out); // array element
643  }// End of if statement for both heavies being static.
644 
645  else if (named_obj.heavy_id1=="Static" && named_obj.heavy_id2!="Static"){
646  // Masses
647  write(xml_out, "Mass_1", all_sinks.sink_prop_1.Mass);
648  write(xml_out, "Mass_2", all_sinks.sink_prop_2.Mass);
649  if (params.param.FourPt)
650  write(xml_out, "Mass_3", all_sinks.sink_prop_3.Mass);
651  write(xml_out, "t01", t01);
652  write(xml_out, "t02", t02);
653 
654  // Initialize the slow Fourier transform phases with NO momenta
655  SftMom phases(0, true, j_decay);
656 
657  // Save prop input
658  push(xml_out, "Forward_prop_headers");
659  write(xml_out, "First_forward_prop", all_sinks.sink_prop_1.prop_header);
660  write(xml_out, "Second_forward_prop", all_sinks.sink_prop_2.prop_header);
661  if (params.param.FourPt)
662  write(xml_out, "Third_forward_prop", all_sinks.sink_prop_3.prop_header);
663  pop(xml_out);
664 
665  // Sanity check - write out the norm2 of the forward prop in the j_decay direction
666  // Use this for any possible verification
667  push(xml_out, "Forward_prop_correlator");
668  {
669  const LatticePropagator& sink_prop_1 =
670  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.sink_prop_1.quark_propagator_id);
671  const LatticePropagator& sink_prop_2 =
672  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.sink_prop_2.quark_propagator_id);
673  const LatticePropagator& sink_prop_3 =
674  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.sink_prop_3.quark_propagator_id);
675 
676  const LatticePropagator& heavy_prop_2 =
677  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.heavy_prop_2.quark_propagator_id);
678 
679  write(xml_out, "forward_prop_corr_1", sumMulti(localNorm2(sink_prop_1), phases.getSet()));
680  write(xml_out, "forward_prop_corr_2", sumMulti(localNorm2(sink_prop_2), phases.getSet()));
681 
682  write(xml_out, "forward_prop_corr_3", sumMulti(localNorm2(sink_prop_3), phases.getSet()));
683  write(xml_out, "forward_prop_corr_heavy2", sumMulti(localNorm2(heavy_prop_2), phases.getSet()));
684  }
685  pop(xml_out);
686 
687 
688  push(xml_out, "SourceSinkType");
689  {
690  QDPIO::cout << "Source_type_1 = " << all_sinks.sink_prop_1.source_type << std::endl;
691  QDPIO::cout << "Sink_type_1 = " << all_sinks.sink_prop_1.sink_type << std::endl;
692  QDPIO::cout << "Source_type_2 = " << all_sinks.sink_prop_2.source_type << std::endl;
693  QDPIO::cout << "Sink_type_2 = " << all_sinks.sink_prop_2.sink_type << std::endl;
694  if (params.param.FourPt){
695  QDPIO::cout << "Source_type_3 = " << all_sinks.sink_prop_3.source_type << std::endl;
696  QDPIO::cout << "Sink_type_3 = " << all_sinks.sink_prop_3.sink_type << std::endl;
697  }
698  write(xml_out, "source_type_1", all_sinks.sink_prop_1.source_type);
699  write(xml_out, "source_disp_type_1", all_sinks.sink_prop_1.source_disp_type);
700  write(xml_out, "sink_type_1", all_sinks.sink_prop_1.sink_type);
701  write(xml_out, "sink_disp_type_1", all_sinks.sink_prop_1.sink_disp_type);
702 
703  write(xml_out, "source_type_2", all_sinks.sink_prop_2.source_type);
704  write(xml_out, "source_disp_type_2", all_sinks.sink_prop_2.source_disp_type);
705  write(xml_out, "sink_type_2", all_sinks.sink_prop_2.sink_type);
706  write(xml_out, "sink_disp_type_2", all_sinks.sink_prop_2.sink_disp_type);
707  if (params.param.FourPt){
708  write(xml_out, "source_type_3", all_sinks.sink_prop_3.source_type);
709  write(xml_out, "source_disp_type_3", all_sinks.sink_prop_3.source_disp_type);
710  write(xml_out, "sink_type_3", all_sinks.sink_prop_3.sink_type);
711  write(xml_out, "sink_disp_type_3", all_sinks.sink_prop_3.sink_disp_type);
712  }
713  write(xml_out, "source_type_h2", all_sinks.heavy_prop_2.source_type);
714  write(xml_out, "source_disp_type_h2", all_sinks.heavy_prop_2.source_disp_type);
715  write(xml_out, "sink_type_h2", all_sinks.heavy_prop_2.sink_type);
716  write(xml_out, "sink_disp_type_h2", all_sinks.heavy_prop_2.sink_disp_type);
717  }
718  pop(xml_out);
719 
720 
721  // References for use later
722  const LatticePropagator& sink_prop_1 =
723  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.sink_prop_1.quark_propagator_id);
724  const LatticePropagator& sink_prop_2 =
725  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.sink_prop_2.quark_propagator_id);
726  const LatticePropagator& sink_prop_3 =
727  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.sink_prop_3.quark_propagator_id);
728  const LatticePropagator& heavy_prop_2 =
729  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.heavy_prop_2.quark_propagator_id);
730 
731  // Construct group name for output
732  std::string src_type;
733  if (all_sinks.sink_prop_1.source_type == "POINT_SOURCE")
734  src_type = "Point";
735  else if (all_sinks.sink_prop_1.source_type == "SHELL_SOURCE")
736  src_type = "Shell";
737  else if (all_sinks.sink_prop_1.source_type == "WALL_SOURCE")
738  src_type = "Wall";
739  else
740  {
741  QDPIO::cerr << "Unsupported source type = " << all_sinks.sink_prop_1.source_type << std::endl;
742  QDP_abort(1);
743  }
744 
745  std::string snk_type;
746  if (all_sinks.sink_prop_1.sink_type == "POINT_SINK")
747  snk_type = "Point";
748  else if (all_sinks.sink_prop_1.sink_type == "SHELL_SINK")
749  snk_type = "Shell";
750  else if (all_sinks.sink_prop_1.sink_type == "WALL_SINK")
751  snk_type = "Wall";
752  else
753  {
754  QDPIO::cerr << "Unsupported sink type = " << all_sinks.sink_prop_1.sink_type << std::endl;
755  QDP_abort(1);
756  }
757 
758  std::string source_sink_type = src_type + "_" + snk_type;
759  QDPIO::cout << "Source type = " << src_type << std::endl;
760  QDPIO::cout << "Sink type = " << snk_type << std::endl;
761 
762  if (params.param.MesonP)
763  {
764  Qlbar(u, sink_prop_1, t_src1, phases, xml_out, source_sink_type + "_Wilson_Qlmeson1");
765  if(all_sinks.sink_prop_1.quark_propagator_id!=all_sinks.sink_prop_2.quark_propagator_id)
766  Qlbar(u, sink_prop_2, t_src2, phases, xml_out, source_sink_type + "_Wilson_Qlmeson2");
767  if (params.param.FourPt && all_sinks.sink_prop_3.quark_propagator_id!=all_sinks.sink_prop_2.quark_propagator_id && all_sinks.sink_prop_1.quark_propagator_id!=all_sinks.sink_prop_3.quark_propagator_id)
768  Qlbar(u, sink_prop_3, t_src3, phases, xml_out, source_sink_type + "_Wilson_Qlmeson3");
769  } // end if (MesonP)
770 
771  //Now we actually will do the contractions...
772 
773  QlQl(u, sink_prop_1, sink_prop_2, heavy_prop_2, t_src1, t_src2, t_src2, HQBC, phases, xml_out, source_sink_type +"Wilson_Ql_Ql_3pt");
774 
775  pop(xml_out); // array element
776  }// End of if statement for first id being static.
777 
778  else if (named_obj.heavy_id1!="Static" && named_obj.heavy_id2=="Static"){
779  // Masses
780  write(xml_out, "Mass_1", all_sinks.sink_prop_1.Mass);
781  write(xml_out, "Mass_2", all_sinks.sink_prop_2.Mass);
782  if (params.param.FourPt)
783  write(xml_out, "Mass_3", all_sinks.sink_prop_3.Mass);
784  write(xml_out, "t01", t01);
785  write(xml_out, "t02", t02);
786 
787  // Initialize the slow Fourier transform phases with NO momenta
788  SftMom phases(0, true, j_decay);
789 
790  // Save prop input
791  push(xml_out, "Forward_prop_headers");
792  write(xml_out, "First_forward_prop", all_sinks.sink_prop_1.prop_header);
793  write(xml_out, "Second_forward_prop", all_sinks.sink_prop_2.prop_header);
794  if (params.param.FourPt)
795  write(xml_out, "Third_forward_prop", all_sinks.sink_prop_3.prop_header);
796  pop(xml_out);
797 
798  // Sanity check - write out the norm2 of the forward prop in the j_decay direction
799  // Use this for any possible verification
800  push(xml_out, "Forward_prop_correlator");
801  {
802  const LatticePropagator& sink_prop_1 =
803  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.sink_prop_1.quark_propagator_id);
804  const LatticePropagator& sink_prop_2 =
805  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.sink_prop_2.quark_propagator_id);
806  const LatticePropagator& sink_prop_3 =
807  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.sink_prop_3.quark_propagator_id);
808 
809  const LatticePropagator& heavy_prop_1 =
810  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.heavy_prop_1.quark_propagator_id);
811 
812  write(xml_out, "forward_prop_corr_1", sumMulti(localNorm2(sink_prop_1), phases.getSet()));
813  write(xml_out, "forward_prop_corr_2", sumMulti(localNorm2(sink_prop_2), phases.getSet()));
814 
815  write(xml_out, "forward_prop_corr_3", sumMulti(localNorm2(sink_prop_3), phases.getSet()));
816  write(xml_out, "forward_prop_corr_h1", sumMulti(localNorm2(heavy_prop_1), phases.getSet()));
817  }
818  pop(xml_out);
819 
820  push(xml_out, "SourceSinkType");
821  {
822  QDPIO::cout << "Source_type_1 = " << all_sinks.sink_prop_1.source_type << std::endl;
823  QDPIO::cout << "Sink_type_1 = " << all_sinks.sink_prop_1.sink_type << std::endl;
824  QDPIO::cout << "Source_type_2 = " << all_sinks.sink_prop_2.source_type << std::endl;
825  QDPIO::cout << "Sink_type_2 = " << all_sinks.sink_prop_2.sink_type << std::endl;
826  if (params.param.FourPt){
827  QDPIO::cout << "Source_type_3 = " << all_sinks.sink_prop_3.source_type << std::endl;
828  QDPIO::cout << "Sink_type_3 = " << all_sinks.sink_prop_3.sink_type << std::endl;
829  }
830  write(xml_out, "source_type_1", all_sinks.sink_prop_1.source_type);
831  write(xml_out, "source_disp_type_1", all_sinks.sink_prop_1.source_disp_type);
832  write(xml_out, "sink_type_1", all_sinks.sink_prop_1.sink_type);
833  write(xml_out, "sink_disp_type_1", all_sinks.sink_prop_1.sink_disp_type);
834 
835  write(xml_out, "source_type_2", all_sinks.sink_prop_2.source_type);
836  write(xml_out, "source_disp_type_2", all_sinks.sink_prop_2.source_disp_type);
837  write(xml_out, "sink_type_2", all_sinks.sink_prop_2.sink_type);
838  write(xml_out, "sink_disp_type_2", all_sinks.sink_prop_2.sink_disp_type);
839  if (params.param.FourPt){
840  write(xml_out, "source_type_3", all_sinks.sink_prop_3.source_type);
841  write(xml_out, "source_disp_type_3", all_sinks.sink_prop_3.source_disp_type);
842  write(xml_out, "sink_type_3", all_sinks.sink_prop_3.sink_type);
843  write(xml_out, "sink_disp_type_3", all_sinks.sink_prop_3.sink_disp_type);
844  }
845  write(xml_out, "source_type_h1", all_sinks.heavy_prop_1.source_type);
846  write(xml_out, "source_disp_type_h1", all_sinks.heavy_prop_1.source_disp_type);
847  write(xml_out, "sink_type_h1", all_sinks.heavy_prop_1.sink_type);
848  write(xml_out, "sink_disp_type_h1", all_sinks.heavy_prop_1.sink_disp_type);
849  }
850  pop(xml_out);
851 
852  // References for use later
853  const LatticePropagator& sink_prop_1 =
854  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.sink_prop_1.quark_propagator_id);
855  const LatticePropagator& sink_prop_2 =
856  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.sink_prop_2.quark_propagator_id);
857  const LatticePropagator& sink_prop_3 =
858  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.sink_prop_3.quark_propagator_id);
859 
860  const LatticePropagator& heavy_prop_1 =
861  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.heavy_prop_1.quark_propagator_id);
862 
863  // Construct group name for output
864  std::string src_type;
865  if (all_sinks.sink_prop_1.source_type == "POINT_SOURCE")
866  src_type = "Point";
867  else if (all_sinks.sink_prop_1.source_type == "SHELL_SOURCE")
868  src_type = "Shell";
869  else if (all_sinks.sink_prop_1.source_type == "WALL_SOURCE")
870  src_type = "Wall";
871  else
872  {
873  QDPIO::cerr << "Unsupported source type = " << all_sinks.sink_prop_1.source_type << std::endl;
874  QDP_abort(1);
875  }
876 
877  std::string snk_type;
878  if (all_sinks.sink_prop_1.sink_type == "POINT_SINK")
879  snk_type = "Point";
880  else if (all_sinks.sink_prop_1.sink_type == "SHELL_SINK")
881  snk_type = "Shell";
882  else if (all_sinks.sink_prop_1.sink_type == "WALL_SINK")
883  snk_type = "Wall";
884  else
885  {
886  QDPIO::cerr << "Unsupported sink type = " << all_sinks.sink_prop_1.sink_type << std::endl;
887  QDP_abort(1);
888  }
889 
890  std::string source_sink_type = src_type + "_" + snk_type;
891  QDPIO::cout << "Source type = " << src_type << std::endl;
892  QDPIO::cout << "Sink type = " << snk_type << std::endl;
893 
894  if (params.param.MesonP)
895  {
896  Qlbar(u, sink_prop_1, t_src1, phases, xml_out, source_sink_type + "_Wilson_Qlmeson1");
897  if(all_sinks.sink_prop_1.quark_propagator_id!=all_sinks.sink_prop_2.quark_propagator_id)
898  Qlbar(u, sink_prop_2, t_src2, phases, xml_out, source_sink_type + "_Wilson_Qlmeson2");
899  if (params.param.FourPt && all_sinks.sink_prop_3.quark_propagator_id!=all_sinks.sink_prop_2.quark_propagator_id && all_sinks.sink_prop_1.quark_propagator_id!=all_sinks.sink_prop_3.quark_propagator_id)
900  Qlbar(u, sink_prop_3, t_src3, phases, xml_out, source_sink_type + "_Wilson_Qlmeson3");
901  } // end if (MesonP)
902 
903  //Now we actually will do the contractions...
904 
905  QlQl(u, sink_prop_1, sink_prop_2, heavy_prop_1, t_src1, t_src2, t_src1, HQBC, phases, xml_out, source_sink_type +"Wilson_Ql_Ql_3pt");
906 
907  pop(xml_out); // array element
908  }// End of if statement for second id being static.
909 
910  else if (named_obj.heavy_id1!="Static" && named_obj.heavy_id2!="Static"){
911  // Masses
912  write(xml_out, "Mass_1", all_sinks.sink_prop_1.Mass);
913  write(xml_out, "Mass_2", all_sinks.sink_prop_2.Mass);
914  if (params.param.FourPt)
915  write(xml_out, "Mass_3", all_sinks.sink_prop_3.Mass);
916  write(xml_out, "t01", t01);
917  write(xml_out, "t02", t02);
918 
919  // Initialize the slow Fourier transform phases with NO momenta
920  SftMom phases(0, true, j_decay);
921 
922  // Save prop input
923  push(xml_out, "Forward_prop_headers");
924  write(xml_out, "First_forward_prop", all_sinks.sink_prop_1.prop_header);
925  write(xml_out, "Second_forward_prop", all_sinks.sink_prop_2.prop_header);
926  if (params.param.FourPt)
927  write(xml_out, "Third_forward_prop", all_sinks.sink_prop_3.prop_header);
928  pop(xml_out);
929 
930  // Sanity check - write out the norm2 of the forward prop in the j_decay direction
931  // Use this for any possible verification
932  push(xml_out, "Forward_prop_correlator");
933  {
934  const LatticePropagator& sink_prop_1 =
935  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.sink_prop_1.quark_propagator_id);
936  const LatticePropagator& sink_prop_2 =
937  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.sink_prop_2.quark_propagator_id);
938  const LatticePropagator& sink_prop_3 =
939  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.sink_prop_3.quark_propagator_id);
940 
941  const LatticePropagator& heavy_prop_1 =
942  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.heavy_prop_1.quark_propagator_id);
943  const LatticePropagator& heavy_prop_2 =
944  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.heavy_prop_2.quark_propagator_id);
945 
946  write(xml_out, "forward_prop_corr_1", sumMulti(localNorm2(sink_prop_1), phases.getSet()));
947  write(xml_out, "forward_prop_corr_2", sumMulti(localNorm2(sink_prop_2), phases.getSet()));
948 
949  write(xml_out, "forward_prop_corr_3", sumMulti(localNorm2(sink_prop_3), phases.getSet()));
950  write(xml_out, "forward_prop_corr_h1", sumMulti(localNorm2(heavy_prop_1), phases.getSet()));
951  write(xml_out, "forward_prop_corr_h2", sumMulti(localNorm2(heavy_prop_2), phases.getSet()));
952 
953  }
954  pop(xml_out);
955 
956 
957  push(xml_out, "SourceSinkType");
958  {
959  QDPIO::cout << "Source_type_1 = " << all_sinks.sink_prop_1.source_type << std::endl;
960  QDPIO::cout << "Sink_type_1 = " << all_sinks.sink_prop_1.sink_type << std::endl;
961  QDPIO::cout << "Source_type_2 = " << all_sinks.sink_prop_2.source_type << std::endl;
962  QDPIO::cout << "Sink_type_2 = " << all_sinks.sink_prop_2.sink_type << std::endl;
963  if (params.param.FourPt){
964  QDPIO::cout << "Source_type_3 = " << all_sinks.sink_prop_3.source_type << std::endl;
965  QDPIO::cout << "Sink_type_3 = " << all_sinks.sink_prop_3.sink_type << std::endl;
966  }
967  write(xml_out, "source_type_1", all_sinks.sink_prop_1.source_type);
968  write(xml_out, "source_disp_type_1", all_sinks.sink_prop_1.source_disp_type);
969  write(xml_out, "sink_type_1", all_sinks.sink_prop_1.sink_type);
970  write(xml_out, "sink_disp_type_1", all_sinks.sink_prop_1.sink_disp_type);
971 
972  write(xml_out, "source_type_2", all_sinks.sink_prop_2.source_type);
973  write(xml_out, "source_disp_type_2", all_sinks.sink_prop_2.source_disp_type);
974  write(xml_out, "sink_type_2", all_sinks.sink_prop_2.sink_type);
975  write(xml_out, "sink_disp_type_2", all_sinks.sink_prop_2.sink_disp_type);
976  if (params.param.FourPt){
977  write(xml_out, "source_type_3", all_sinks.sink_prop_3.source_type);
978  write(xml_out, "source_disp_type_3", all_sinks.sink_prop_3.source_disp_type);
979  write(xml_out, "sink_type_3", all_sinks.sink_prop_3.sink_type);
980  write(xml_out, "sink_disp_type_3", all_sinks.sink_prop_3.sink_disp_type);
981  }
982  write(xml_out, "source_type_h1", all_sinks.heavy_prop_1.source_type);
983  write(xml_out, "source_disp_type_h1", all_sinks.heavy_prop_1.source_disp_type);
984  write(xml_out, "sink_type_h1", all_sinks.heavy_prop_1.sink_type);
985  write(xml_out, "sink_disp_type_h1", all_sinks.heavy_prop_1.sink_disp_type);
986 
987  write(xml_out, "source_type_h2", all_sinks.heavy_prop_2.source_type);
988  write(xml_out, "source_disp_type_h2", all_sinks.heavy_prop_2.source_disp_type);
989  write(xml_out, "sink_type_h2", all_sinks.heavy_prop_2.sink_type);
990  write(xml_out, "sink_disp_type_h2", all_sinks.heavy_prop_2.sink_disp_type);
991 
992  }
993  pop(xml_out);
994 
995 
996  // References for use later
997  const LatticePropagator& sink_prop_1 =
998  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.sink_prop_1.quark_propagator_id);
999  const LatticePropagator& sink_prop_2 =
1000  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.sink_prop_2.quark_propagator_id);
1001  const LatticePropagator& sink_prop_3 =
1002  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.sink_prop_3.quark_propagator_id);
1003 
1004  const LatticePropagator& heavy_prop_1 =
1005  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.heavy_prop_1.quark_propagator_id);
1006  const LatticePropagator& heavy_prop_2 =
1007  TheNamedObjMap::Instance().getData<LatticePropagator>(all_sinks.heavy_prop_2.quark_propagator_id);
1008  // Construct group name for output
1009  std::string src_type;
1010  if (all_sinks.sink_prop_1.source_type == "POINT_SOURCE")
1011  src_type = "Point";
1012  else if (all_sinks.sink_prop_1.source_type == "SHELL_SOURCE")
1013  src_type = "Shell";
1014  else if (all_sinks.sink_prop_1.source_type == "WALL_SOURCE")
1015  src_type = "Wall";
1016  else
1017  {
1018  QDPIO::cerr << "Unsupported source type = " << all_sinks.sink_prop_1.source_type << std::endl;
1019  QDP_abort(1);
1020  }
1021 
1022  std::string snk_type;
1023  if (all_sinks.sink_prop_1.sink_type == "POINT_SINK")
1024  snk_type = "Point";
1025  else if (all_sinks.sink_prop_1.sink_type == "SHELL_SINK")
1026  snk_type = "Shell";
1027  else if (all_sinks.sink_prop_1.sink_type == "WALL_SINK")
1028  snk_type = "Wall";
1029  else
1030  {
1031  QDPIO::cerr << "Unsupported sink type = " << all_sinks.sink_prop_1.sink_type << std::endl;
1032  QDP_abort(1);
1033  }
1034 
1035  std::string source_sink_type = src_type + "_" + snk_type;
1036  QDPIO::cout << "Source type = " << src_type << std::endl;
1037  QDPIO::cout << "Sink type = " << snk_type << std::endl;
1038 
1039  QDPIO::cout << "Note that we are not calculating Heavy-Light Spectrum,"<<std::endl;
1040  QDPIO::cout << "because both heavy quarks are not static."<<std::endl;
1041 
1042  //Now we actually will do the contractions...
1043 
1044  QlQl(u, sink_prop_1, sink_prop_2, heavy_prop_1, heavy_prop_2, t_src1, t_src2, phases, xml_out, source_sink_type +"Wilson_Ql_Ql_3pt");
1045 
1046  pop(xml_out); // array element
1047  }// End of if statement for no statics.
1048 
1049  }// End of loop over pairs...
1050  pop(xml_out); // Wilson_spectroscopy
1051  pop(xml_out); // HeavyLightCont
1052 
1053  snoop.stop();
1054  QDPIO::cout << InlineHeavyLightContEnv::name << ": total time = "
1055  << snoop.getTimeInSeconds()
1056  << " secs" << std::endl;
1057 
1058  QDPIO::cout << InlineHeavyLightContEnv::name << ": ran successfully" << std::endl;
1059 
1060  END_CODE();
1061  }
1062 
1063 }
Static-Light 3pt function.
Inline measurement factory.
Inline measurement of heavy-light quark spectroscopy.
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.
InlineHeavyLightContParams params
Fourier transform phase factor support.
Definition: sftmom.h:35
const Set & getSet() const
The set to be used in sumMulti.
Definition: sftmom.h:57
static T & Instance()
Definition: singleton.h:432
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 QlQl(const multi1d< LatticeColorMatrix > &u, const LatticePropagator &quark_propagator1, const LatticePropagator &quark_propagator2, const multi1d< int > &src_coord, const multi1d< int > &snk_coord, const int &bc, const SftMom &phases, XMLWriter &xml, const std::string &xml_group)
Heavy-light meson 2-pt function.
Definition: Ql_3pt_w.cc:44
void QlbarBACK(const multi1d< LatticeColorMatrix > &u, const LatticePropagator &quark_propagator, const multi1d< int > &src_coord, const SftMom &phases, XMLWriter &xml, const std::string &xml_group, const int bc)
Heavy-light meson 2-pt function with backwards moving static quark.
Definition: mesQl_w.cc:111
void Qlbar(const multi1d< LatticeColorMatrix > &u, const LatticePropagator &quark_propagator, const multi1d< int > &src_coord, const SftMom &phases, XMLWriter &xml, const std::string &xml_group, const int bc)
Heavy-light meson 2-pt function.
Definition: mesQl_w.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.
int bc_spec
std::string source_disp_type
multi1d< int > bc
SinkPropContainer_t heavy_prop_2
std::string source_type
SinkPropContainer_t sink_prop_3
std::string quark_propagator_id
SinkPropContainer_t sink_prop_2
std::string sink_type
SinkPropContainer_t sink_prop_1
ForwardProp_t prop_header
std::string sink_disp_type
SinkPropContainer_t heavy_prop_1
Inline heavy light contractions for weak three and four point functions.
Params params
Make xml file writer.
Heavy light meson (Qlbar) 2-pt function : Orginos and Savage.
int j_decay
Definition: meslate.cc:22
Nd
Definition: meslate.cc:74
Named object function std::map.
static bool registered
Local registration flag.
bool registerAll()
Register all the factories.
std::string getName()
Return the name.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
Real getMass(const GroupXML_t &fermact)
Given a fermion action in std::string form, return the Mass.
Definition: qprop_io.cc:16
static multi1d< LatticeColorMatrix > u
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > const multi1d< Real > & Mass
Definition: pbg5p_w.cc:29
void write(XMLWriter &xml, const std::string &path, const InlineHeavyLightContParams::NamedObject_t &input)
Propagator output.
push(xml_out,"Condensates")
int i
Definition: pbg5p_w.cc:55
multi1d< int > getFermActBoundary(const GroupXML_t &fermact)
Given a fermion action in std::string form, return the boundary.
Definition: qprop_io.cc:61
pop(xml_out)
void MesPlq(const multi1d< LatticeColorMatrixF3 > &u, multi2d< Double > &plane_plaq, Double &link)
Definition: mesplq.cc:83
START_CODE()
multi1d< LatticeFermion > s(Ncb)
::std::string string
Definition: gtest.h:1979
No quark displacement.
Various parameter structs and reader/writers.
Print out basic info about this program.
Routines associated with Chroma propagator IO.
Fourier transform phase factor support.
struct Chroma::InlineHeavyLightContParams::NamedObject_t named_obj
struct Chroma::InlineHeavyLightContParams::Param_t param
void write(XMLWriter &xml_out, const std::string &path)