CHROMA
BuildingBlocks_w.cc
Go to the documentation of this file.
1 //###################################################################################//
2 //###################################################################################//
3 // //
4 // BuildingBlocks.cc //
5 // //
6 //###################################################################################//
7 //###################################################################################//
8 // //
9 // description: //
10 // //
11 // Read BuildingBlocks.hh. //
12 // //
13 // history: //
14 // //
15 // There were at least four versions of "MIT" code. Andrew Pochinsky has a c //
16 // version. Dmitri Dolgov has a c++ version. Dru B. Renner has c and c++ versions. //
17 // All were independent and checked against one another. Of course, all were //
18 // developed under the guidance of John W. Negele. The code here is just the //
19 // "Building Blocks" portion of the MIT code. //
20 // //
21 // authors: //
22 // //
23 // Dru B. Renner, dru@mit.edu, 2002 - port of Building Blocks (MIT) code to qdp++ //
24 // //
25 // There are others who have contributed since the code has been migrated to qdp++. //
26 // The cvs log entries indicate these other authors. //
27 // //
28 //###################################################################################//
29 //###################################################################################//
30 
31 #include "chromabase.h"
32 #include "util/ft/sftmom.h"
34 
35 #include <iostream>
36 
37 namespace Chroma {
38 
39 //###################################################################################//
40 // debug flag //
41 //###################################################################################//
42 
43 #define _DEBUG_BB_C_ 0
44 
45 //###################################################################################//
46 // cvs header //
47 //###################################################################################//
48 
49 static const char* const CVSBuildingBlocks_cc =
50  "$Header: /home/bjoo/fromJLAB/cvsroot/chroma_base/lib/meas/hadron/BuildingBlocks_w.cc,v 3.7 2007-06-10 14:40:23 edwards Exp $";
51 
52 //###################################################################################//
53 // record the CVS info //
54 //###################################################################################//
55 
56 void CVSBuildingBlocks( TextWriter & Out )
57 {
58  Out << "CVSBuildingBlocks_hh = " << CVSBuildingBlocks_hh << "\n";
59  Out << "CVSBuildingBlocks_cc = " << CVSBuildingBlocks_cc << "\n";
60 }
61 
62 //###################################################################################//
63 // backward forward trace //
64 //###################################################################################//
65 
66 void BkwdFrwdTr( const LatticePropagator & B,
67  const LatticePropagator & F,
68  int GammaInsertion,
69  const SftMom & Phases,
70  const SftMom & PhasesCanonical,
71  multi2d< BinaryFileWriter > & BinaryWriters,
72  multi1d< int > & GBB_NLinkPatterns,
73  multi2d< int > & GBB_NMomPerms,
74  const int f,
75  const multi1d< unsigned short int > & LinkDirs,
76  const signed short int T1,
77  const signed short int T2,
78  const signed short int Tsrc,
79  const signed short int Tsnk,
80  const bool TimeReverse,
81  const bool ShiftFlag )
82 {
83  StopWatch TotalTime;
84  TotalTime.reset();
85  TotalTime.start();
86 
87  StopWatch Timer;
88 
89  int TRCalls = 0;
90  int FTCalls = 0;
91  int GFGCalls = 0;
92  int IPCalls = 0;
93  double TRTime = 0.0;
94  double FTTime = 0.0;
95  double GFGTime = 0.0;
96  double IPTime = 0.0;
97  double IOTime = 0.0;
98 
99  const unsigned short int NLinks = LinkDirs.size();
100  unsigned short int Link;
101  const int NumQ = Phases.numMom();
102  const int NumO = BinaryWriters.size1();
103  const int NT = Phases.numSubsets(); // Length of lattice in decay direction
104 
105  //#################################################################################//
106  // add a tag to identify the link pattern //
107  //#################################################################################//
108 
109  Timer.reset();
110  Timer.start();
111 
112  for( int o = 0; o < NumO; o ++ )
113  {
114  BinaryWriters(f,o).write( NLinks );
115 
116  #if _DEBUG_BB_C_ == 1
117  {
118  QDPIO::cout << "DEBUG: " << __FILE__ << " " << __LINE__ << "\n";
119  QDPIO::cout << "q = " << o << "\n";
120  QDPIO::cout << "f = " << f << "\n";
121  QDPIO::cout << "NLinks = " << NLinks << "\n";
122  }
123  #endif
124 
125  for( Link = 0; Link < NLinks; Link ++ )
126  {
127  // This interchanges the +t direction (3) and -t direction (7): (3+4)%8=7 and (7+4)%8=3.
128  if( ( TimeReverse == true ) & ( ( LinkDirs[ Link ] == 3 ) || ( LinkDirs[ Link ] == 7 ) ) )
129  {
130  BinaryWriters(f,o).write( (unsigned short int)(( LinkDirs[ Link ] + 4 ) % 8) );
131  }
132  else
133  {
134  BinaryWriters(f,o).write( LinkDirs[ Link ] );
135  }
136 
137  #if _DEBUG_BB_C_ == 1
138  {
139  QDPIO::cout << "Link = " << Link << "\n";
140  QDPIO::cout << "LinkDirs[ Link ] = " << LinkDirs[ Link ] << "\n";
141  }
142  #endif
143  }
144 
145  // counts number of link patterns per flavor
146  GBB_NLinkPatterns[f] ++;
147  }
148 
149  Timer.stop();
150  IOTime += Timer.getTimeInSeconds();
151 
152  for( int i = 0; i < Ns * Ns; i ++ )
153  {
154  Timer.reset();
155  Timer.start();
156 
157  // assumes any Gamma5 matrices have already been absorbed
158  LatticePropagator GFG = Gamma(i) * F * Gamma( GammaInsertion );
159 
160  // There is an overall minus sign from interchanging the initial and final states for baryons. This
161  // might not be present for mesons, so we should think about this carefully.
162  // It seems there should be another sign for conjugating the operator, but it appears to be absent.
163  // There is a minus sign for all Dirac structures with a gamma_t. In the current scheme this is all
164  // gamma_i with i = 8, ..., 15. If the gamma basis changes, then this must change.
165  if( ( TimeReverse == true ) & ( i < 8 ) ) GFG *= -1;
166 
167  Timer.stop();
168  GFGCalls += 1;
169  GFGTime += Timer.getTimeInSeconds();
170  Timer.reset();
171  Timer.start();
172 
173  LatticeComplex Trace = localInnerProduct( B, GFG );
174 
175  Timer.stop();
176  IPCalls += 1;
177  IPTime += Timer.getTimeInSeconds();
178  Timer.reset();
179  Timer.start();
180 
181  multi2d< DComplex > Projections = Phases.sft( Trace );
182 
183  Timer.stop();
184  FTTime += Timer.getTimeInSeconds();
185  FTCalls += 1;
186 
187  Timer.reset();
188  Timer.start();
189 
190  for( int q = 0; q < NumQ; q ++ )
191  {
192  multi1d< DComplex > Projection = Projections[ q ];
193  multi1d< int > Q = Phases.numToMom( q );
194 
195  int o = PhasesCanonical.momToNum( Q );
196  if (o == -1)
197  {
198  QDPIO::cerr << __func__ << ": internal error: failed to find index of ordered momentum" << std::endl;
199  QDP_abort(1);
200  }
201 
202  const signed short int QX = Q[0];
203  const signed short int QY = Q[1];
204  const signed short int QZ = Q[2];
205  BinaryWriters(f,o).write( QX );
206  BinaryWriters(f,o).write( QY );
207  BinaryWriters(f,o).write( QZ );
208 
209  // counts number of momenta permutations per canonical ordering
210  GBB_NMomPerms(f,o) ++;
211 
212  float real_part[ T2 - T1 + 1 ];
213  float imag_part[ T2 - T1 + 1 ];
214 
215  // Fill correlator
216  for( int t = T1; t <= T2; t ++ )
217  {
218  float r = toFloat( real( Projection[ t ] ) );
219  float i = toFloat( imag( Projection[ t ] ) );
220 
221  int t_prime = t;
222 
223  if( TimeReverse == true ){
224  //QDPIO::cout<<"TimeReversing: " ;
225  //shift the time origin to the source
226  int t_shifted = (t - Tsrc + NT )%NT ;
227  //time reverse around the source
228  int t_reversed = (NT - t_shifted)%NT;
229  //undo the shift to put time back where it was.
230  //we may not want to do this. it may be better to just shift
231  //the time origin to Tsrc as we do in the spectrum
232  if(ShiftFlag==false)
233  t_prime = (t_reversed + Tsrc)%NT ;
234  else
235  t_prime = t_reversed ;
236 
237  //QDPIO::cout<<t<<" "<<t_prime<<" [Tsrc="<<Tsrc<<",NT="<<NT<<",tsh="<<t_shifted<<"]"<<std::endl ;
238  }
239 
240  //when TimeReverse is on shifting is done differently
241  if((ShiftFlag==true)&&(TimeReverse==false))
242  t_prime = (t - Tsrc + NT )%NT ;
243 
244  //if(TimeReverse==false)
245  // QDPIO::cout<<t<<" "<<t_prime<<" [Tsrc="<<Tsrc<<",NT="<<NT<<"]"<<std::endl;
246 
247  real_part[ t_prime ] = r;
248  imag_part[ t_prime ] = i;
249 
250  #if _DEBUG_BB_C_ == 1
251  {
252  QDPIO::cout << "DEBUG: " << __FILE__ << " " << __LINE__ << "\n";
253  QDPIO::cout << "q = " << q << "\n";
254  QDPIO::cout << "o = " << o << "\n";
255  QDPIO::cout << "f = " << f << "\n";
256  QDPIO::cout << "t = " << t << "\n";
257  QDPIO::cout << "r = " << r << "\n";
258  QDPIO::cout << "i = " << i << "\n";
259  }
260  #endif
261  }
262 
263  // Write correlator
264  for( int t = 0; t < (T2-T1+1); t ++ )
265  {
266  BinaryWriters(f,o).write( real_part[t] );
267  BinaryWriters(f,o).write( imag_part[t] );
268  }
269  }
270 
271  Timer.stop();
272  IOTime += Timer.getTimeInSeconds();
273  }
274 
275  QDPIO::cout << __func__ << ": io time = " << IOTime << " seconds" << std::endl;
276  QDPIO::cout << __func__ << ": gfg time = " << GFGTime / (double) GFGCalls << " seconds" << std::endl;
277  QDPIO::cout << __func__ << ": ip time = " << IPTime / (double) IPCalls << " seconds" << std::endl;
278  QDPIO::cout << __func__ << ": ft time = " << FTTime / (double) FTCalls << " seconds" << std::endl;
279  TotalTime.stop();
280  QDPIO::cout << __func__ << ": total time = " << TotalTime.getTimeInSeconds() << " seconds" << std::endl;
281 
282  return;
283 }
284 
285 //###################################################################################//
286 // accumulate link operators //
287 //###################################################################################//
288 
289 void AddLinks( const multi1d< LatticePropagator > & B,
290  const LatticePropagator & F,
291  const multi1d< LatticeColorMatrix > & U,
292  const multi1d< int > & GammaInsertions,
293  const SftMom & Phases,
294  const SftMom & PhasesCanonical,
295  multi1d< unsigned short int > & LinkDirs,
296  const unsigned short int MaxNLinks,
297  BBLinkPattern LinkPattern,
298  const short int PreviousDir,
299  const short int PreviousMu,
300  multi2d< BinaryFileWriter > & BinaryWriters,
301  multi1d< int > & GBB_NLinkPatterns,
302  multi2d< int > & GBB_NMomPerms,
303  const signed short int T1,
304  const signed short int T2,
305  const signed short int Tsrc,
306  const signed short int Tsnk,
307  const bool TimeReverse,
308  const bool ShiftFlag )
309 {
310  StopWatch Timer;
311  int ShiftCalls = 0;
312  double ShiftTime = 0.0;
313 
314  const unsigned short int NLinks = LinkDirs.size();
315 
316  if( NLinks == MaxNLinks )
317  {
318  return;
319  }
320 
321  LatticePropagator F_mu;
322  const int NF = B.size();
323  multi1d< unsigned short int > NextLinkDirs( NLinks + 1 );
324  int Link;
325 
326  for( Link = 0; Link < NLinks; Link ++ )
327  {
328  NextLinkDirs[ Link ] = LinkDirs[ Link ];
329  }
330 
331  // add link in forward mu direction
332  for( int mu = 0; mu < Nd; mu ++ )
333  {
334  // skip the double back
335  if( ( PreviousDir != -1 ) || ( PreviousMu != mu ) )
336  {
337  bool DoThisPattern = true;
338  bool DoFurtherPatterns = true;
339 
340  NextLinkDirs[ NLinks ] = mu;
341 
342  LinkPattern( DoThisPattern, DoFurtherPatterns, NextLinkDirs );
343 
344  if( DoFurtherPatterns == true )
345  {
346  Timer.reset();
347  Timer.start();
348 
349  // accumulate product of link fields
350  F_mu = shift( adj( U[ mu ] ) * F, BACKWARD, mu );
351 
352  Timer.stop();
353  ShiftTime += Timer.getTimeInSeconds();
354  ShiftCalls += 1;
355  }
356 
357  if( DoThisPattern == true )
358  {
359  // form correlation functions
360  for( int f = 0; f < NF; f ++ )
361  {
362  BkwdFrwdTr( B[ f ], F_mu, GammaInsertions[ f ], Phases, PhasesCanonical,
363  BinaryWriters, GBB_NLinkPatterns, GBB_NMomPerms,
364  f, NextLinkDirs, T1, T2, Tsrc, Tsnk, TimeReverse, ShiftFlag );
365  }
366  }
367 
368  if( DoFurtherPatterns == true )
369  {
370  // add another link
371  AddLinks( B, F_mu, U, GammaInsertions,
372  Phases, PhasesCanonical,
373  NextLinkDirs, MaxNLinks, LinkPattern, 1, mu,
374  BinaryWriters, GBB_NLinkPatterns, GBB_NMomPerms,
375  T1, T2, Tsrc, Tsnk, TimeReverse, ShiftFlag );
376  }
377  }
378  }
379 
380  // add link in backward mu direction
381  for( int mu = 0; mu < Nd; mu ++ )
382  {
383  // skip the double back
384  if( ( PreviousDir != 1 ) || ( PreviousMu != mu ) )
385  {
386  bool DoThisPattern = true;
387  bool DoFurtherPatterns = true;
388 
389  NextLinkDirs[ NLinks ] = mu + Nd;
390 
391  LinkPattern( DoThisPattern, DoFurtherPatterns, NextLinkDirs );
392 
393  if( DoFurtherPatterns == true )
394  {
395  Timer.reset();
396  Timer.start();
397 
398  // accumulate product of link fields
399  F_mu = U[ mu ] * shift( F, FORWARD, mu );
400 
401  Timer.stop();
402  ShiftTime += Timer.getTimeInSeconds();
403  ShiftCalls += 1;
404  }
405 
406  if( DoThisPattern == true )
407  {
408  // form correlation functions
409  for( int f = 0; f < NF; f ++ )
410  {
411  BkwdFrwdTr( B[ f ], F_mu, GammaInsertions[ f ], Phases, PhasesCanonical,
412  BinaryWriters, GBB_NLinkPatterns, GBB_NMomPerms,
413  f, NextLinkDirs, T1, T2, Tsrc, Tsnk, TimeReverse, ShiftFlag );
414  }
415  }
416 
417  if( DoFurtherPatterns == true )
418  {
419  // add another link
420  AddLinks( B, F_mu, U, GammaInsertions, Phases, PhasesCanonical,
421  NextLinkDirs, MaxNLinks, LinkPattern, -1, mu, BinaryWriters,
422  GBB_NLinkPatterns, GBB_NMomPerms,
423  T1, T2, Tsrc, Tsnk, TimeReverse, ShiftFlag );
424  }
425  }
426  }
427 
428  QDPIO::cout << __func__ << ": shift time = "
429  << ShiftTime
430  << " seconds with shift calls = "
431  << ShiftCalls
432  << std::endl;
433 
434  return;
435 }
436 
437 //###################################################################################//
438 // construct building blocks //
439 //###################################################################################//
440 
441 void BuildingBlocks( const multi1d< LatticePropagator > & B,
442  const LatticePropagator & F,
443  const multi1d< LatticeColorMatrix > & U,
444  const multi1d< int > & GammaInsertions,
445  const multi1d< int > & Flavors,
446  const unsigned short int MaxNLinks,
447  const BBLinkPattern LinkPattern,
448  const SftMom & Phases,
449  const SftMom & PhasesCanonical,
450  const multi2d< std::string > & BinaryDataFileNames,
451  const signed short int T1,
452  const signed short int T2,
453  const signed short int Tsrc,
454  const signed short int Tsnk,
455  const std::string& SeqSourceType,
456  const multi1d< int >& SnkMom,
457  const signed short int DecayDir,
458  const bool TimeReverse,
459  const bool ShiftFlag )
460 {
461  StopWatch TotalTime;
462  TotalTime.reset();
463  TotalTime.start();
464 
465  StopWatch Timer;
466 
467  //#################################################################################//
468  // open building blocks data files //
469  //#################################################################################//
470 
471  Timer.reset();
472  Timer.start();
473 
474  if ( BinaryDataFileNames.size1() != PhasesCanonical.numMom() )
475  {
476  QDPIO::cerr << __func__ << ": number of datafile names incompatible with number of momenta"
477  << std::endl;
478  QDP_abort(1);
479  }
480 
481  const int NumF = B.size();
482  const int NumO = BinaryDataFileNames.size1();
483  multi2d< BinaryFileWriter > BinaryWriters( NumF, NumO );
484  multi1d< int > GBB_NLinkPatterns( NumF );
485  multi2d< int > GBB_NMomPerms( NumF, NumO );
486 
487  for( int f = 0; f < NumF; f ++ )
488  {
489  GBB_NLinkPatterns[f] = 0;
490  for( int o = 0; o < NumO; o ++ )
491  {
492  BinaryWriters(f,o).open( BinaryDataFileNames(f,o) );
493  GBB_NMomPerms(f,o) = 0;
494  }
495  }
496 
497  Timer.stop();
498  QDPIO::cout << __func__ << ": time to open files = "
499  << Timer.getTimeInSeconds()
500  << " seconds" << std::endl;
501 
502  //#################################################################################//
503  // calculate building blocks //
504  //#################################################################################//
505 
506  Timer.reset();
507  Timer.start();
508 
509  QDPIO::cout << __func__ << ": start BkwdFrwdTr" << std::endl;
510 
511  const unsigned short int NLinks = 0;
512  multi1d< unsigned short int > LinkDirs( 0 );
513 
514  for( int f = 0; f < NumF; f ++ )
515  {
516  BkwdFrwdTr( B[ f ], F, GammaInsertions[ f ], Phases, PhasesCanonical,
517  BinaryWriters, GBB_NLinkPatterns, GBB_NMomPerms, f, LinkDirs,
518  T1, T2, Tsrc, Tsnk,
519  TimeReverse, ShiftFlag );
520  }
521 
522  Timer.stop();
523  QDPIO::cout << __func__ << ": total time for 0 links (single BkwdFrwdTr call) = "
524  << Timer.getTimeInSeconds()
525  << " seconds" << std::endl;
526 
527  Timer.reset();
528  Timer.start();
529 
530  QDPIO::cout << __func__ << ": start AddLinks" << std::endl;
531 
532  AddLinks( B, F, U, GammaInsertions,
533  Phases, PhasesCanonical,
534  LinkDirs, MaxNLinks, LinkPattern, 0, -1,
535  BinaryWriters, GBB_NLinkPatterns, GBB_NMomPerms,
536  T1, T2, Tsrc, Tsnk, TimeReverse, ShiftFlag );
537 
538  Timer.stop();
539  QDPIO::cout << __func__ << ": total time for remaining links (outermost AddLinks call) = "
540  << Timer.getTimeInSeconds()
541  << " seconds" << std::endl;
542 
543  //#################################################################################//
544  // add footer and close files //
545  //#################################################################################//
546 
547  Timer.reset();
548  Timer.start();
549 
550  const unsigned short int Id = 0; // indicates building blocks
551  const unsigned short int Version = 3; // building blocks version
552  const unsigned short int Contraction = 0; // 0 indicates connected diagram
553  const unsigned short int NX = Layout::lattSize()[0];
554  const unsigned short int NY = Layout::lattSize()[1];
555  const unsigned short int NZ = Layout::lattSize()[2];
556  const unsigned short int NT = Layout::lattSize()[3];
557  const signed short int PX = SnkMom[0];
558  const signed short int PY = SnkMom[1];
559  const signed short int PZ = SnkMom[2];
560  const signed short int SeqSourceLen = 64;
561  std::string SeqSource = SeqSourceType;
562  SeqSource.resize(SeqSourceLen, 0);
563 
564  for( int f = 0; f < NumF; f ++ )
565  {
566  const signed short int Flavor = Flavors[f]; // currently assumes u and d are given as f=0 and f=1
567  const signed short int GammaInsertion = GammaInsertions[f];
568  const unsigned short int NLinkPatterns = GBB_NLinkPatterns[f] / NumO;
569 
570  for( int o = 0; o < NumO; o ++ )
571  {
572  const unsigned short int NMomPerms = GBB_NMomPerms(f,o) / (Ns * Ns * NLinkPatterns);
573 
574 #if _DEBUG_BB_C_ == 1
575  {
576  multi1d< int > Q = PhasesCanonical.numToMom( o );
577  const signed short int QX = Q[0];
578  const signed short int QY = Q[1];
579  const signed short int QZ = Q[2];
580 
581  QDPIO::cout << "DEBUG: " << __FILE__ << " " << __LINE__ << "\n";
582 
583  QDPIO::cout << "Id = " << Id << "\n";
584  QDPIO::cout << "Version = " << Version << "\n";
585  QDPIO::cout << "Flavor = " << Flavor << "\n";
586  QDPIO::cout << "Contraction = " << Contraction << "\n";
587  QDPIO::cout << "SeqSource = " << SeqSource << "\n";
588  QDPIO::cout << "GammaInsertion = " << GammaInsertion<< "\n";
589  QDPIO::cout << "NX = " << NX << "\n";
590  QDPIO::cout << "NY = " << NY << "\n";
591  QDPIO::cout << "NZ = " << NZ << "\n";
592  QDPIO::cout << "NT = " << NT << "\n";
593  QDPIO::cout << "T1 = " << T1 << "\n";
594  QDPIO::cout << "T2 = " << T2 << "\n";
595  QDPIO::cout << "MaxNLinks = " << MaxNLinks << "\n";
596  QDPIO::cout << "NLinkPatterns = " << NLinkPatterns << "\n";
597  QDPIO::cout << "NMomPerms = " << NMomPerms << "\n";
598  QDPIO::cout << "Canonical Index = " << o << "\n";
599  QDPIO::cout << "QX = " << QX << "\n";
600  QDPIO::cout << "QY = " << QY << "\n";
601  QDPIO::cout << "QZ = " << QZ << "\n";
602  QDPIO::cout << "PX = " << PX << "\n";
603  QDPIO::cout << "PY = " << PY << "\n";
604  QDPIO::cout << "PZ = " << PZ << "\n";
605  }
606 #endif
607 
608  // possibly specific to this version
609  BinaryWriters(f,o).write( Flavor );
610  BinaryWriters(f,o).write( Contraction );
611  BinaryWriters(f,o).writeArray( SeqSource.data(), 1, SeqSourceLen );
612  BinaryWriters(f,o).write( GammaInsertion );
613  BinaryWriters(f,o).write( NX );
614  BinaryWriters(f,o).write( NY );
615  BinaryWriters(f,o).write( NZ );
616  BinaryWriters(f,o).write( NT );
617  BinaryWriters(f,o).write( DecayDir );
618  BinaryWriters(f,o).write( T1 );
619  BinaryWriters(f,o).write( T2 );
620  BinaryWriters(f,o).write( MaxNLinks );
621  BinaryWriters(f,o).write( NLinkPatterns );
622  BinaryWriters(f,o).write( NMomPerms );
623  BinaryWriters(f,o).write( PX );
624  BinaryWriters(f,o).write( PY );
625  BinaryWriters(f,o).write( PZ );
626  BinaryWriters(f,o).write( BinaryWriters(f,o).getChecksum() );
627  // generic to any building blocks file
628  BinaryWriters(f,o).write( Id );
629  BinaryWriters(f,o).write( Version );
630  // close file
631  BinaryWriters(f,o).close();
632  }
633  }
634 
635  Timer.stop();
636  QDPIO::cout << __func__ << ": time to write footer = "
637  << Timer.getTimeInSeconds()
638  << " seconds" << std::endl;
639 
640  TotalTime.stop();
641  QDPIO::cout << __func__ << ": total time = "
642  << TotalTime.getTimeInSeconds()
643  << " seconds" << std::endl;
644 
645  return;
646 }
647 
648 //###################################################################################//
649 //###################################################################################//
650 
651 #undef _DEBUG_BB_C_
652 
653 //###################################################################################//
654 //###################################################################################//
655 
656 } // end namespace Chroma
Primary include file for CHROMA library code.
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 momToNum(const multi1d< int > &mom_in) const
Convert array of momenta to momenta id.
Definition: sftmom.cc:496
multi2d< DComplex > sft(const LatticeComplex &cf) const
Do a sumMulti(cf*phases,getSet())
Definition: sftmom.cc:524
int numMom() const
Number of momenta.
Definition: sftmom.h:60
int mu
Definition: cool.cc:24
void(* BBLinkPattern)(bool &DoThisPattern, bool &DoFurtherPatterns, multi1d< unsigned short int > &LinkPattern)
Used to Set Requested Link Patterns.
int t
Definition: meslate.cc:37
Nd
Definition: meslate.cc:74
Double q
Definition: mesq.cc:17
QDPSubTypeTrait< typename BinaryReturn< C1, C2, FnLocalInnerProduct >::Type_t >::Type_t localInnerProduct(const QDPSubType< T1, C1 > &l, const QDPType< T2, C2 > &r)
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
LinOpSysSolverMGProtoClover::Q Q
int i
Definition: pbg5p_w.cc:55
static const char *const CVSBuildingBlocks_hh
void BuildingBlocks(const multi1d< LatticePropagator > &B, const LatticePropagator &F, const multi1d< LatticeColorMatrix > &U, const multi1d< int > &GammaInsertions, const multi1d< int > &Flavors, const unsigned short int MaxNLinks, const BBLinkPattern LinkPattern, const SftMom &Phases, const SftMom &PhasesCanonical, const multi2d< std::string > &BinaryDataFileNames, const signed short int T1, const signed short int T2, const signed short int Tsrc, const signed short int Tsnk, const std::string &SeqSourceType, const multi1d< int > &SnkMom, const signed short int DecayDir, const bool TimeReverse, const bool ShiftFlag)
void AddLinks(const multi1d< LatticePropagator > &B, const LatticePropagator &F, const multi1d< LatticeColorMatrix > &U, const multi1d< int > &GammaInsertions, const SftMom &Phases, const SftMom &PhasesCanonical, multi1d< unsigned short int > &LinkDirs, const unsigned short int MaxNLinks, BBLinkPattern LinkPattern, const short int PreviousDir, const short int PreviousMu, multi2d< BinaryFileWriter > &BinaryWriters, multi1d< int > &GBB_NLinkPatterns, multi2d< int > &GBB_NMomPerms, const signed short int T1, const signed short int T2, const signed short int Tsrc, const signed short int Tsnk, const bool TimeReverse, const bool ShiftFlag)
void BkwdFrwdTr(const LatticePropagator &B, const LatticePropagator &F, int GammaInsertion, const SftMom &Phases, const SftMom &PhasesCanonical, multi2d< BinaryFileWriter > &BinaryWriters, multi1d< int > &GBB_NLinkPatterns, multi2d< int > &GBB_NMomPerms, const int f, const multi1d< unsigned short int > &LinkDirs, const signed short int T1, const signed short int T2, const signed short int Tsrc, const signed short int Tsnk, const bool TimeReverse, const bool ShiftFlag)
static const char *const CVSBuildingBlocks_cc
void CVSBuildingBlocks(TextWriter &Out)
::std::string string
Definition: gtest.h:1979
#define FORWARD
Definition: primitives.h:82
#define BACKWARD
Definition: primitives.h:83
Fourier transform phase factor support.
multi1d< LatticeColorMatrix > U
static INTERNAL_PRECISION F