CHROMA
util_baryon_s.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Wrappers to compute staggered baryon correlators
3  *
4  */
5 
6 #include "meas/hadron/baryon_s.h"
8 
9 //
10 // wrapper routine for baryon operators
11 //
12 
13 namespace Chroma
14 {
15 
16 
18  LatticeStaggeredPropagator & quark_propagator,
19  XMLWriter & xml_out,
20  int j_decay, int tlength)
21 {
22  int bc_spec = 0 ;
23  multi1d<int> coord(Nd);
24  coord[0]=0; coord[1] = 0; coord[2] = 0; coord[3] = 0;
25 
26  multi1d<Complex> barprop(tlength) ;
27 
28  baryon_s(quark_propagator,barprop,
30 
31 
32  write(xml_out, name, barprop);
33 
34 
35 
36 }
37 
38 
39 
40 //
41 // wrapper routine for baryon operators
42 //
43 
45  LatticeStaggeredPropagator & quark_propagator_a,
46  LatticeStaggeredPropagator & quark_propagator_b,
47  LatticeStaggeredPropagator & quark_propagator_c,
48  XMLWriter & xml_out,
49  int j_decay, int tlength,
50  bool binary_baryon_dump, std::string filename)
51 {
52  int bc_spec = 0 ;
53  multi1d<int> coord(Nd);
54 
55 
56  coord[0]=0; coord[1] = 0; coord[2] = 0; coord[3] = 0;
57 
58  multi1d<Complex> barprop(tlength) ;
59 
60  baryon_s(quark_propagator_a,quark_propagator_b,quark_propagator_c,
61  barprop,coord,j_decay, bc_spec) ;
62 
63 
64  if(binary_baryon_dump){
65  const int magic_number = 66618 ;
66  BinaryFileWriter speedy ;
67  speedy.open(filename);
68  write(speedy,magic_number) ;
69  write(speedy,tlength) ;
70  write(speedy, barprop);;
71  }else{
72  write(xml_out, name, barprop);
73  }
74 }
75 
76 
77 
79  XMLWriter &xml_out, int fuzz_width )
80 {
81 
82 
83  push(xml_out, "smearing_basis");
84  write(xml_out, "element_tag", name);
85 
86  if( type_of_src == LOCAL_SRC )
87  { write(xml_out, "source_type", "LOCAL_SRC"); }
88  else if( type_of_src == GAUGE_INVAR_LOCAL_SOURCE )
89  { write(xml_out, "source_type", "GAUGE_INVAR_LOCAL_SOURCE"); }
90  else if( type_of_src == FUZZED_SRC )
91  {
92  write(xml_out, "source_type", "FUZZED_SRC");
93  write(xml_out, "fuzzed_width", fuzz_width);
94  }
95 
96  pop(xml_out);
97 
98 }
99 
100 
101 void compute_vary_baryon_s(XMLWriter &xml_out, int t_source, int fuzz_width,
102  int j_decay, int t_len,
103  LatticeStaggeredPropagator & quark_propagator_Lsink_Lsrc,
104  LatticeStaggeredPropagator & quark_propagator_Fsink_Lsrc,
105  LatticeStaggeredPropagator & quark_propagator_Lsink_Fsrc,
106  LatticeStaggeredPropagator & quark_propagator_Fsink_Fsrc,
107  bool binary_baryon_dump, std::string binary_name)
108 
109 {
110 
111 
112  std::string filename_base;
113 
114 
115  //
116  // compute some simple baryon correlators
117  //
118 
119  push(xml_out, "baryon_correlators");
120 
121  // describe the source
122  std::string NN ;
123  write(xml_out, "source_time", t_source);
124  push(xml_out, "smearing_info");
125  NN = "L" ;
126  write_smearing_info(NN, LOCAL_SRC,xml_out,fuzz_width) ;
127 
128  NN = "F" ;
129  write_smearing_info(NN,FUZZED_SRC,xml_out,fuzz_width) ;
130 
131  pop(xml_out);
132 
133  // write out the baryon correlators
134  std::string b_tag("srcLLL_sinkLLL_nucleon") ;
135 
136 
137  filename_base=binary_name+b_tag;
138  ks_compute_baryon(b_tag,quark_propagator_Lsink_Lsrc,
139  quark_propagator_Lsink_Lsrc,
140  quark_propagator_Lsink_Lsrc,
141  xml_out, j_decay,
142  t_len,
143  binary_baryon_dump,filename_base) ;
144 
145  // single quark fuzzed
146 
147  b_tag = "srcLLL_sinkFLL_nucleon" ;
148  filename_base=binary_name+b_tag;
149  ks_compute_baryon(b_tag,
150  quark_propagator_Fsink_Lsrc,
151  quark_propagator_Lsink_Lsrc,
152  quark_propagator_Lsink_Lsrc,
153  xml_out, j_decay,
154  t_len,
155  binary_baryon_dump,filename_base) ;
156 
157  b_tag = "srcFLL_sinkLLL_nucleon" ;
158  filename_base=binary_name+b_tag;
159  ks_compute_baryon(b_tag,
160  quark_propagator_Lsink_Fsrc,
161  quark_propagator_Lsink_Lsrc,
162  quark_propagator_Lsink_Lsrc,
163  xml_out, j_decay,
164  t_len,
165  binary_baryon_dump,filename_base) ;
166 
167  b_tag = "srcFLL_sinkFLL_nucleon" ;
168  filename_base=binary_name+b_tag;
169  ks_compute_baryon(b_tag,
170  quark_propagator_Fsink_Fsrc,
171  quark_propagator_Lsink_Lsrc,
172  quark_propagator_Lsink_Lsrc,
173  xml_out, j_decay,
174  t_len,
175  binary_baryon_dump,filename_base) ;
176 
177 
178 
179  // double quark fuzzed
180 
181  b_tag = "srcLLL_sinkFFL_nucleon" ;
182  filename_base=binary_name+b_tag;
183  ks_compute_baryon(b_tag,
184  quark_propagator_Fsink_Lsrc,
185  quark_propagator_Fsink_Lsrc,
186  quark_propagator_Lsink_Lsrc,
187  xml_out, j_decay,
188  t_len,
189  binary_baryon_dump,filename_base) ;
190 
191  b_tag = "srcFFL_sinkLLL_nucleon" ;
192  filename_base=binary_name+b_tag;
193  ks_compute_baryon(b_tag,
194  quark_propagator_Lsink_Fsrc,
195  quark_propagator_Lsink_Fsrc,
196  quark_propagator_Lsink_Lsrc,
197  xml_out, j_decay,
198  t_len,
199  binary_baryon_dump,filename_base) ;
200 
201  b_tag = "srcFFL_sinkFFL_nucleon" ;
202  filename_base=binary_name+b_tag;
203  ks_compute_baryon(b_tag,
204  quark_propagator_Fsink_Fsrc,
205  quark_propagator_Fsink_Fsrc,
206  quark_propagator_Lsink_Lsrc,
207  xml_out, j_decay,
208  t_len,
209  binary_baryon_dump,filename_base) ;
210 
211 
212  // treble quark fuzzed
213 
214  b_tag = "srcLLL_sinkFFF_nucleon" ;
215  filename_base=binary_name+b_tag;
216  ks_compute_baryon(b_tag,
217  quark_propagator_Fsink_Lsrc,
218  quark_propagator_Fsink_Lsrc,
219  quark_propagator_Fsink_Lsrc,
220  xml_out, j_decay,
221  t_len,
222  binary_baryon_dump,filename_base) ;
223 
224  b_tag = "srcFFF_sinkLLL_nucleon" ;
225  filename_base=binary_name+b_tag;
226  ks_compute_baryon(b_tag,
227  quark_propagator_Lsink_Fsrc,
228  quark_propagator_Lsink_Fsrc,
229  quark_propagator_Lsink_Fsrc,
230  xml_out, j_decay,
231  t_len,
232  binary_baryon_dump,filename_base) ;
233 
234  b_tag = "srcFFF_sinkFFF_nucleon" ;
235  filename_base=binary_name+b_tag;
236  ks_compute_baryon(b_tag,
237  quark_propagator_Fsink_Fsrc,
238  quark_propagator_Fsink_Fsrc,
239  quark_propagator_Fsink_Fsrc,
240  xml_out, j_decay,
241  t_len,
242  binary_baryon_dump,filename_base) ;
243 
244 
245 
246  pop(xml_out); // baryon correlators
247 
248 
249 
250 }
251 
252 
253 
254 
255 } // end of chroma namespace
256 
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
int bc_spec
multi1d< int > coord(Nd)
int j_decay
Definition: meslate.cc:22
Nd
Definition: meslate.cc:74
const std::string name
Name to be used.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
void compute_vary_baryon_s(XMLWriter &xml_out, int t_source, int fuzz_width, int j_decay, int t_len, LatticeStaggeredPropagator &quark_propagator_Lsink_Lsrc, LatticeStaggeredPropagator &quark_propagator_Fsink_Lsrc, LatticeStaggeredPropagator &quark_propagator_Lsink_Fsrc, LatticeStaggeredPropagator &quark_propagator_Fsink_Fsrc)
void write_smearing_info(std::string name, stag_src_type type_of_src, XMLWriter &xml_out, int fuzz_width)
push(xml_out,"Condensates")
void ks_compute_baryon(std::string name, LatticeStaggeredPropagator &quark_propagator, XMLWriter &xml_out, int j_decay, int tlength)
void baryon_s(LatticeStaggeredPropagator &quark_propagator_in, multi1d< Complex > &barprop, multi1d< int > &t_source, int j_decay, int bc_spec)
Definition: baryon_s.cc:51
pop(xml_out)
::std::string string
Definition: gtest.h:1979
Compute staggered quark propagator.
@ GAUGE_INVAR_LOCAL_SOURCE