CHROMA
simple_hadron_operator_w.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Construct simple baryon operators
3  */
4 
5 #include "qdp_config.h"
6 #if QDP_NS == 4
7 #if QDP_ND == 4
8 #if QDP_NC == 3
9 
10 
11 
15 
18 
21 
22 namespace Chroma
23 {
24 
25  //! Hadron sequential sources
26  /*! \ingroup hadron */
27  namespace SimpleHadronOperatorEnv
28  {
29  std::map<std::string, HadronOperator<LatticeFermion>* (*)(const GroupXML_t&)> Ops ;
30 
31  Baryon::Baryon(const GroupXML_t& p):HadronOperator<LatticeFermion>(p){
32 
33  std::istringstream xml_l(p.xml);
34  XMLReader xmltop(xml_l);
35  QDPIO::cout << "Baryon state is = " <<p.id ;
36  QDPIO::cout << std::endl;
37  std::string DiqGammaStr ;
38  read(xmltop,"DiqGamma",DiqGammaStr);
39  if(DiqGammaStr == "CG5"){
40  DiqGamma = BaryonSpinMats::Cg5();
41  }
42  else if(DiqGammaStr == "CGmu"){
43  int mu ;
44  read(xmltop,"mu",mu);
45  DiqGamma = BaryonSpinMats::Cgmu(mu); // mu = 1 2 3 4 . 4 is time
46  }
47  else{
48  throw "Unknown diquark operator "+DiqGammaStr ;
49  }
50  }
51 
52 
53  //! Compute the operator
54  multi1d<LatticeComplex>
55  Baryon::operator()(const multi1d<LatticeFermion>& q,
56  enum PlusMinus isign) const
57  {
58  START_CODE();
59 
60  // The return
61  multi1d<LatticeComplex> d(Ns);
62  d = zero;
63 
64  for(int k=0; k < Ns; ++k)
65  {
66  LatticeSpinMatrix di_quark = zero;
67 
68  for(int j=0; j < Ns; ++j)
69  {
70  for(int i=0; i < Ns; ++i)
71  {
72  // Contract over color indices with antisym tensors
73  LatticeComplex b_oper = colorContract(peekSpin(q[0], i),
74  peekSpin(q[1], j),
75  peekSpin(q[2], k));
76 
77  pokeSpin(di_quark, b_oper, j, i);
78  }
79  }
80 
81  d[k] += traceSpin(DiqGamma * di_quark);
82  }
83 
84  END_CODE();
85 
86  return d;
87  }
88 
89 
90  //! Anonymous namespace
91  namespace
92  {
93 
94 
95  //-------------------- callback functions ------------------------------
96 
97  //! Baryon operator
98  /*!
99  * \ingroup hadron
100  *
101  * simple baryon operator
102  */
103  HadronOperator<LatticeFermion>* baryon(const GroupXML_t& gxml){
104  return new Baryon(gxml);
105  }
106 
107 
108  //! Local registration flag
109  bool registered = false;
110 
111  } // end anonymous namespace
112 
113 
114  //! Register all the factories
115  bool registerAll()
116  {
117  bool success = true;
118  if (! registered)
119  {
120  Ops["BARYON"] = &baryon ;
121 
122  registered = true;
123  }
124  return success;
125  }
126 
127  } // namespace HadronOperatorEnv
128 
129 
130 } // end namespace Chroma
131 
132 #endif
133 #endif
134 #endif
Baryon spin and projector matrices.
Factory for producing baryon operators.
#define END_CODE()
Definition: chromabase.h:65
#define START_CODE()
Definition: chromabase.h:64
int mu
Definition: cool.cc:24
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams &param)
Read parameters.
void baryon(const LatticePropagator &quark_propagator, const SftMom &phases, int t0, int bc_spec, bool time_rev, XMLWriter &xml, const std::string &xml_group)
Baryon 2-pt functions.
Definition: baryon_w.cc:38
unsigned j
Definition: ldumul_w.cc:35
unsigned i
Definition: ldumul_w.cc:34
Double q
Definition: mesq.cc:17
bool registerAll()
Register all the factories.
static bool registered
Local registration flag.
SpinMatrix Cgmu(int k)
C g_\mu = \gamma_4 \gamma_2 \gamma_\mu.
Definition: barspinmat_w.cc:79
SpinMatrix Cg5()
C g_5 = C gamma_5 = Gamma(5)
multi1d< Hadron2PtContraction_t > operator()(const multi1d< LatticeColorMatrix > &u)
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
DComplex d
Definition: invbicg.cc:99
Double zero
Definition: invbicg.cc:106
int k
Definition: invbicg.cc:119
::std::string string
Definition: gtest.h:1979
All quark smearing constructors.
Factory for producing quark smearing objects.
Construct simple hadron operators.