CHROMA
barcomp_diquark_w.cc
Go to the documentation of this file.
1 // $Id: barcomp_diquark_w.cc,v 1.2 2007-02-28 03:28:40 edwards Exp $
2 /*! \file
3  * \brief Construct all components of a baryon propagator using a diquark
4  */
5 
8 
9 namespace Chroma
10 {
11 
12  //! Construct all components of a baryon propagator
13  /*!
14  * \ingroup hadron
15  *
16  * This routine is specific to Wilson fermions!
17  *
18  * In all baryons the colour components are contracted with the totally
19  * antisymmetric 'tensor' eps(a,b,c) = antisym_tensor(a,b,c).
20  *
21  * \param barprop baryon correlation function (in real space) ( Write )
22  * \param diquark diquark ( Read )
23  * \param quark_propagator_3 quark propagator ( Read )
24  * \param spin_indices holds list of source/sink spin indices ( Read )
25  * \param phases object holds list of momenta ( Read )
26  * \param t0 coordinates of source in decay direction ( Read )
27  * \param bc_spec boundary condition for spectroscopy ( Read )
28  */
29 
31  const QQDiquarkContract_t& diquark,
32  const LatticePropagator& quark_propagator_3,
33  const multi1d<QQQSpinIndices_t> spin_indices,
34  const SftMom& phases,
35  int t0, int bc_spec)
36  {
37  START_CODE();
38 
39  // Length of lattice in decay direction
40  int length = phases.numSubsets();
41 
42  // This object is composed of the spin indices and the correlators
43  barprop.length = length;
44  barprop.corrs.resize(spin_indices.size());
45 
46  // We need this fast, so at the expense of a lot of memory we will
47  // expose all the color/spin indices of each propagator into a temporary
48  multi2d< multi2d<LatticeComplex> > qc_3(unpackQuark(quark_propagator_3));
49 
50  // Temporaries
51  multi1d<DComplex> hsum;
52  LatticeComplex b_prop;
53  multi1d<int> rnk(6);
54 
55  // Diquark-quark contract
56  // Loop over all source/sink spin indices
57  for(int i=0; i < spin_indices.size(); ++i)
58  {
59  const QQQSpinIndices_t& d = spin_indices[i];
60  barprop.corrs[i].source_sink = d;
61 
62  // Here is where the odd-ball transpose is being done.
63  // Note: source is first and sink is last. Don't blame RGE...
64  rnk[0] = d.source[0];
65  rnk[1] = d.source[1];
66  rnk[2] = d.sink[0];
67  rnk[3] = d.sink[1];
68 
69  // Contract over color indices - the final part of the antisym tensors
70  b_prop = zero;
71  for(rnk[4]=0; rnk[4] < Nc; ++rnk[4]) // color row
72  for(rnk[5]=0; rnk[5] < Nc; ++rnk[5]) // color col
73  {
74  b_prop += diquark.comp[rnk] * qc_3(d.source[2],d.sink[2])(rnk[4],rnk[5]);
75  }
76 
77  /* Project on zero momentum: Do a slice-wise sum. */
78  hsum = sumMulti(b_prop, phases.getSet());
79 
80  barprop.corrs[i].corr.resize(length);
81  for(int t=0; t < length; ++t) // t
82  {
83  int t_eff = (t - t0 + length) % length;
84  barprop.corrs[i].corr[t] = (bc_spec < 0 && (t_eff+t0) >= length) ? -hsum[t] : hsum[t];
85  }
86  }
87 
88  END_CODE();
89  }
90 
91 
92  //! Construct all components of a baryon propagator
93  /*!
94  * \ingroup hadron
95  *
96  * This routine is specific to Wilson fermions!
97  *
98  * In all baryons the colour components are contracted with the totally
99  * antisymmetric 'tensor' eps(a,b,c) = antisym_tensor(a,b,c).
100  *
101  * \param barprop baryon correlation function (in real space) ( Write )
102  * \param diquark diquark ( Read )
103  * \param quark_propagator_3 quark propagator ( Read )
104  * \param phases object holds list of momenta ( Read )
105  * \param t0 coordinates of source in decay direction ( Read )
106  * \param bc_spec boundary condition for spectroscopy ( Read )
107  */
108 
110  const QQDiquarkContract_t& diquark,
111  const LatticePropagator& quark_propagator_3,
112  const SftMom& phases,
113  int t0, int bc_spec)
114  {
115  START_CODE();
116 
117  // Length of lattice in decay direction
118  int length = phases.numSubsets();
119 
120  multi1d<int> ranks(7);
121  ranks = Ns;
122  ranks[6] = length;
123 
124  barprop.length = length;
125  barprop.corrs.resize(ranks);
126 
127  // We need this fast, so at the expense of a lot of memory we will
128  // expose all the color/spin indices of each propagator into a temporary
129  multi2d< multi2d<LatticeComplex> > qc_3(unpackQuark(quark_propagator_3));
130 
131  // Temporaries
132  multi1d<DComplex> hsum;
133  LatticeComplex b_prop;
134  multi1d<int> rnk(6);
135 
136  // Diquark-quark contract
137  for(ranks[0]=0; ranks[0] < Ns; ++ranks[0]) // sf_3
138  for(ranks[1]=0; ranks[1] < Ns; ++ranks[1]) // sf_2
139  for(ranks[2]=0; ranks[2] < Ns; ++ranks[2]) // sf_1
140  for(ranks[3]=0; ranks[3] < Ns; ++ranks[3]) // si_3
141  for(ranks[4]=0; ranks[4] < Ns; ++ranks[4]) // si_2
142  for(ranks[5]=0; ranks[5] < Ns; ++ranks[5]) // si_1
143  {
144  // Here we carry on the odd-ball transpose.
145  // Note: source is first and sink is last. This makes it
146  // compatible with barcomp_w.cc . Don't blame RGE...
147  rnk[0] = ranks[1];
148  rnk[1] = ranks[2];
149  rnk[2] = ranks[4];
150  rnk[3] = ranks[5];
151 
152  // Contract over color indices - the final part of the antisym tensors
153  b_prop = zero;
154  for(rnk[4]=0; rnk[4] < Nc; ++rnk[4]) // color row
155  for(rnk[5]=0; rnk[5] < Nc; ++rnk[5]) // color col
156  {
157  b_prop += diquark.comp[rnk] * qc_3(ranks[3],ranks[0])(rnk[4],rnk[5]);
158  }
159 
160  /* Project on zero momentum: Do a slice-wise sum. */
161  hsum = sumMulti(b_prop, phases.getSet());
162 
163  for(ranks[6] = 0; ranks[6] < length; ++ranks[6]) // t
164  {
165  int t_eff = (ranks[6] - t0 + length) % length;
166 
167  barprop.corrs[ranks] =
168  (bc_spec < 0 && (t_eff+t0) >= length) ? -hsum[ranks[6]] :
169  hsum[ranks[6]];
170  }
171  }
172 
173  END_CODE();
174  }
175 
176 
177 } // end namespace Chroma
Construct all components of a baryon propagator using a diquark.
Fourier transform phase factor support.
Definition: sftmom.h:35
int numSubsets() const
Number of subsets - length in decay direction.
Definition: sftmom.h:63
const Set & getSet() const
The set to be used in sumMulti.
Definition: sftmom.h:57
Construct a diquark object.
void barcompDiquarkDense(QQQDense_t &barprop, const QQDiquarkContract_t &diquark, const LatticePropagator &quark_propagator_3, const SftMom &phases, int t0, int bc_spec)
Construct all components of a baryon propagator.
void barcompDiquarkSparse(QQQSparse_t &barprop, const QQDiquarkContract_t &diquark, const LatticePropagator &quark_propagator_3, const multi1d< QQQSpinIndices_t > spin_indices, const SftMom &phases, int t0, int bc_spec)
Construct all components of a baryon propagator.
multi2d< multi2d< LatticeComplex > > unpackQuark(const LatticePropagator &quark_propagator)
Unpack a quark.
Definition: diquark_w.cc:18
int bc_spec
int t
Definition: meslate.cc:37
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
int i
Definition: pbg5p_w.cc:55
DComplex d
Definition: invbicg.cc:99
START_CODE()
Double zero
Definition: invbicg.cc:106
Dense QQDiquark object.
Definition: diquark_w.h:18
multiNd< LatticeComplex > comp
Definition: diquark_w.h:19
Dense QQQ object.
Definition: barcomp_w.h:36
multiNd< Complex > corrs
Definition: barcomp_w.h:41
Sparse QQQ object.
Definition: barcomp_w.h:18
multi1d< QQQElem_t > corrs
Definition: barcomp_w.h:30
Hold source and sink spin indices for a sparse QQQ file.
Definition: qprop_io.h:163