CHROMA
qqq_w.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief constructs 3 quark propagators contracted at the sink
4  */
5 
6 #include "chromabase.h"
7 #include "util/ft/sftmom.h"
8 
9 #ifndef __qqq_h__
10 #define __qqq_h__
11 
12 //! Baryon-Baryon 4-pt function building block
13 /* This routine is specific to Wilson fermions!
14  *
15  */
16 
17 namespace Chroma {
18 
19  class QuarkIndex{
20  public:
21  int s;
22  int c;
23  QuarkIndex():s(0),c(0){}
24  QuarkIndex(int s_,int c_):s(s_),c(c_){}
25 
26  void Zero(){s=0;c=0;}
27 
28  //this code may be slow and may need replacement
29  //with simple loops... For the momment it reduces
30  //typing so I keep it!
32  if(c<Nc-1)
33  c++;
34  else{
35  c=0;
36  s++;
37  }
38  return *this ;
39  }
40 
41  bool NotEnd(){
42  return(s<Ns);
43  }
44  //End of useless code!
45 
46  } ;
47 
48  class ThreeQuarks{
49  private:
50  multi1d <DComplex> data ;
51  int size ;
52 
53  public:
54 
56  size = (Nc*Ns)*(Nc*Ns)*(Nc*Ns)*Ns ;
57  data.resize(size) ;
58  };
59 
61 
62  // index speed in memory: c1 s1 c2 s2 c3 s3 s4
63  DComplex& operator()(int s1, int c1,
64  int s2, int c2,
65  int s3, int c3,
66  int s4 ){
67  return data[c1+Nc*(s1+Ns*(c2+Nc*(s2+Ns*(c3+Nc*(s3+Ns*s4)))))];
68  }
69 
70  DComplex& operator()(const QuarkIndex& q1,
71  const QuarkIndex& q2,
72  const QuarkIndex& q3,
73  int s4 ){
74  return data[q1.c+Nc*(q1.s+Ns*(q2.c+Nc*(q2.s+Ns*(q3.c+Nc*(q3.s+Ns*s4)))))];
75  }
76 
77  multi1d<DComplex>& handle(){
78  return data;
79  }
80 
81  DComplex& operator[](int i){
82  return data[i];
83  }
84 
85  int Size() const {return size;}
86 
87 };
88 
89  void compute_qqq(multi2d<ThreeQuarks>& qqq,
90  const LatticePropagator& q1,
91  const LatticePropagator& q2,
92  const LatticePropagator& q3,
93  const SftMom& phases,
94  int t0, int bc_spec
95  ) ;
96 
97  void compute_qqq(multi2d<ThreeQuarks>& qqq, const int k,
98  const LatticePropagator& q1,
99  const LatticePropagator& q2,
100  const LatticePropagator& q3,
101  const SftMom& phases,
102  int t0, int bc_spec
103  ) ;
104 
105  void write_qqq(QDPFileWriter& to,
106  multi2d<ThreeQuarks>& qqq,
107  const SftMom& phases,
108  std::string type,
109  std::string sink) ;
110 
111 }
112 #endif
Primary include file for CHROMA library code.
QuarkIndex & operator++()
Definition: qqq_w.h:31
void Zero()
Definition: qqq_w.h:26
QuarkIndex(int s_, int c_)
Definition: qqq_w.h:24
bool NotEnd()
Definition: qqq_w.h:41
DComplex & operator()(int s1, int c1, int s2, int c2, int s3, int c3, int s4)
Definition: qqq_w.h:63
DComplex & operator()(const QuarkIndex &q1, const QuarkIndex &q2, const QuarkIndex &q3, int s4)
Definition: qqq_w.h:70
multi1d< DComplex > data
Definition: qqq_w.h:50
DComplex & operator[](int i)
Definition: qqq_w.h:81
multi1d< DComplex > & handle()
Definition: qqq_w.h:77
int Size() const
Definition: qqq_w.h:85
void compute_qqq(multi2d< ThreeQuarks > &qqq, const LatticePropagator &q1, const LatticePropagator &q2, const LatticePropagator &q3, const SftMom &phases, int t0, int bc_spec)
Baryon-Baryon 2-pt functions (C\gamma_5 diquark)
Definition: qqq_w.cc:44
int bc_spec
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
int i
Definition: pbg5p_w.cc:55
void write_qqq(QDPFileWriter &to, multi2d< ThreeQuarks > &qqq, const SftMom &phases, std::string type, std::string sink)
Definition: qqq_w.cc:200
int k
Definition: invbicg.cc:119
::std::string string
Definition: gtest.h:1979
Fourier transform phase factor support.