CHROMA
formfac_w.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Form-factors
3  *
4  * Form factors constructed from a quark and a sequential quark propagator
5  */
6 
7 #include "chromabase.h"
8 #include "util/ft/sftmom.h"
10 
11 namespace Chroma
12 {
13 
14  /*!
15  * Structures for hadron parts
16  *
17  * \ingroup hadron
18  *
19  * @{
20  */
21 
22  // Read a momenta struct
23  void read(BinaryReader& bin, FormFac_momenta_t& mom)
24  {
25  read(bin, mom.magic);
26  if (mom.magic != 20301)
27  {
28  QDPIO::cerr << "read(FormFac_momenta_t): magic number invalid" << std::endl;
29  QDP_abort(1);
30  }
31  read(bin, mom.inser_mom);
32  read(bin, mom.local_current);
33  read(bin, mom.nonlocal_current);
34  }
35 
36  //
37  void read(BinaryReader& bin, FormFac_insertion_t& mes)
38  {
39  read(bin, mes.gamma_value);
40  read(bin, mes.momenta);
41  }
42 
43  //
44  void read(BinaryReader& bin, FormFac_insertions_t& form)
45  {
46  read(bin, form.output_version);
47  read(bin, form.formFac);
48  }
49 
50  // Write a momenta struct
51  void write(BinaryWriter& bin, const FormFac_momenta_t& mom)
52  {
53  int magic = 20301;
54  write(bin, magic);
55  write(bin, mom.inser_mom);
56  write(bin, mom.local_current);
57  write(bin, mom.nonlocal_current);
58  }
59 
60  //
61  void write(BinaryWriter& bin, const FormFac_insertion_t& mes)
62  {
63  write(bin, mes.gamma_value);
64  write(bin, mes.momenta);
65  }
66 
67  //
68  void write(BinaryWriter& bin, const FormFac_insertions_t& form)
69  {
70  write(bin, form.output_version);
71  write(bin, form.formFac);
72  }
73 
74  /*! @} */ // end of group hadron
75 
76 
77  //! Compute contractions for current insertion 3-point functions.
78  /*!
79  * \ingroup hadron
80  *
81  * This routine is specific to Wilson fermions!
82  *
83  * \param form structures holding formfactors ( Write )
84  * \param u gauge fields (used for non-local currents) ( Read )
85  * \param quark_propagator quark propagator ( Read )
86  * \param seq_quark_prop sequential quark propagator ( Read )
87  * \param gamma_insertion extra gamma insertion at source ( Read )
88  * \param phases fourier transform phase factors ( Read )
89  * \param t0 cartesian coordinates of the source ( Read )
90  */
91 
93  const multi1d<LatticeColorMatrix>& u,
94  const LatticePropagator& quark_propagator,
95  const LatticePropagator& seq_quark_prop,
96  int gamma_insertion,
97  const SftMom& phases,
98  int t0)
99  {
100  START_CODE();
101 
102  // Length of lattice in j_decay direction and 3pt correlations fcns
103  int length = phases.numSubsets();
104 
105  int G5 = Ns*Ns-1;
106 
107  // Construct the anti-quark propagator from the seq. quark prop.
108  LatticePropagator anti_quark_prop = Gamma(G5) * seq_quark_prop * Gamma(G5);
109 
110  // Rough timings (arbitrary units):
111  // Variant 1: 120
112  // Variant 2: 140
113  // See previous cvs versions (before 1.10) for Variant 2 - only keeping Variant 1
114 
115  form.formFac.resize(Nd*Nd);
116 
117  // Loop over gamma matrices of the insertion current of insertion current
118  for(int gamma_value = 0; gamma_value < Nd*Nd; ++gamma_value)
119  {
120  // For the case where the gamma value indicates we are evaluating either
121  // the std::vector or axial std::vector currents, we will also evaluate
122  // the non-local currents. The non-local std::vector current is the conserved
123  // current. The non-local axial std::vector current would be partially
124  // conserved but for the Wilson term. In these cases we will set
125  // mu = corresponding direction. In all other cases, we will set mu = -1.
126 
127  bool compute_nonlocal;
128  int mu;
129 
130  switch(gamma_value){
131  case 1:
132  case 14:
133  mu = 0;
134  compute_nonlocal = true;
135  break;
136  case 2:
137  case 13:
138  mu = 1;
139  compute_nonlocal = true;
140  break;
141  case 4:
142  case 11:
143  mu = 2;
144  compute_nonlocal = true;
145  break;
146  case 8:
147  case 7:
148  mu = 3;
149  compute_nonlocal = true;
150  break;
151  default:
152  mu = -1;
153  compute_nonlocal = false;
154  }
155 
156  // The local non-conserved std::vector-current matrix element
157  LatticeComplex corr_local_fn =
158  trace(adj(anti_quark_prop) * Gamma(gamma_value) * quark_propagator * Gamma(gamma_insertion));
159 
160  multi2d<DComplex> hsum, hsum_nonlocal;
161  hsum = phases.sft(corr_local_fn);
162 
163  // Construct the non-local current matrix element
164  //
165  // The form of J_mu = (1/2)*[psibar(x+mu)*U^dag_mu*(1+gamma_mu)*psi(x) -
166  // psibar(x)*U_mu*(1-gamma_mu)*psi(x+mu)]
167  // NOTE: the 1/2 is included down below in the sumMulti stuff
168  LatticeComplex corr_nonlocal_fn;
169  if(compute_nonlocal){
170  corr_nonlocal_fn =
171  trace(adj(u[mu] * shift(anti_quark_prop, FORWARD, mu)) *
172  (quark_propagator + Gamma(gamma_value) * quark_propagator) * Gamma(gamma_insertion));
173  LatticePropagator tmp_prop1 = u[mu] *
174  shift(quark_propagator, FORWARD, mu);
175  corr_nonlocal_fn -= trace(adj(anti_quark_prop) *
176  (tmp_prop1 - Gamma(gamma_value) * tmp_prop1) * Gamma(gamma_insertion));
177 
178  hsum_nonlocal = phases.sft(corr_nonlocal_fn);
179  }
180 
181 
182  form.formFac[gamma_value].gamma_value = gamma_value;
183  form.formFac[gamma_value].momenta.resize(phases.numMom()); // hold momenta output
184 
185  // Loop over insertion momenta and print out results
186  for(int inser_mom_num=0; inser_mom_num<phases.numMom(); ++inser_mom_num)
187  {
188  form.formFac[gamma_value].momenta[inser_mom_num].inser_mom = phases.numToMom(inser_mom_num);
189 
190  multi1d<ComplexF> local_cur3ptfn(length); // always compute
191  multi1d<ComplexF> nonlocal_cur3ptfn;
192  if (compute_nonlocal)
193  nonlocal_cur3ptfn.resize(length); // possibly compute
194 
195  for (int t=0; t < length; ++t)
196  {
197  int t_eff = (t - t0 + length) % length;
198 
199  local_cur3ptfn[t_eff] = Complex(hsum[inser_mom_num][t]);
200  if (compute_nonlocal)
201  nonlocal_cur3ptfn[t_eff] = 0.5 * Complex(hsum_nonlocal[inser_mom_num][t]);
202 
203  } // end for(t)
204 
205  form.formFac[gamma_value].momenta[inser_mom_num].local_current = local_cur3ptfn;
206  form.formFac[gamma_value].momenta[inser_mom_num].nonlocal_current = nonlocal_cur3ptfn;
207 
208  } // end for(inser_mom_num)
209  } // end for(gamma_value)
210 
211  END_CODE();
212  }
213 
214 } // 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
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
Form-factors.
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 FormFac(FormFac_insertions_t &form, const multi1d< LatticeColorMatrix > &u, const LatticePropagator &quark_propagator, const LatticePropagator &seq_quark_prop, int gamma_insertion, const SftMom &phases, int t0)
Compute contractions for current insertion 3-point functions.
Definition: formfac_w.cc:92
int t
Definition: meslate.cc:37
Nd
Definition: meslate.cc:74
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
int G5
Definition: pbg5p_w.cc:57
static multi1d< LatticeColorMatrix > u
START_CODE()
#define FORWARD
Definition: primitives.h:82
Fourier transform phase factor support.
multi1d< FormFac_momenta_t > momenta
Definition: formfac_w.h:34
multi1d< FormFac_insertion_t > formFac
Definition: formfac_w.h:40
multi1d< int > inser_mom
Definition: formfac_w.h:26
multi1d< ComplexF > local_current
Definition: formfac_w.h:27
multi1d< ComplexF > nonlocal_current
Definition: formfac_w.h:28