CHROMA
mespbp_w.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Calculates noise estimator for psi_bar_psi
3  */
4 
5 #include "chromabase.h"
6 #include "fermact.h"
7 #include "meas/pbp/mespbp_w.h"
8 
9 
10 namespace Chroma {
11 
12 //! Calculates noise estimator for psi_bar_psi
13 /*!
14  * This routine is specific to Wilson fermions!
15  *
16  * u -- gauge field ( Read )
17  * psi_bar_psi -- chiral condensate ( Write )
18  * n_congrd -- Number of CG iteration ( Write )
19  * ichiral -- chirality with no zero modes ( Read )
20  */
21 
22 void MesPbp(
24  Handle< FermState<LatticeFermion, multi1d<LatticeColorMatrix>,
25  multi1d<LatticeColorMatrix> > > state,
26  const multi1d<Real>& Mass,
27  const int ichiral,
28  XMLWriter& xml_out,
29  const std::string& xml_group,
30  const std::string& FermAct)
31 {
32 
33  START_CODE();
34 
35  const int numMass = Mass.size();
36 
37  // Grab the links from the state
38  const multi1d<LatticeColorMatrix>& u = state->getLinks();
39 
40  LatticeFermion eta;
41  LatticeFermion chi;
42  LatticeFermion psi;
43  LatticeReal trace_aux0;
44  LatticeReal trace_aux1;
46 
47  push(xml_out, xml_group);
48 
49 // I don't know what phfctr is...must be in that mysterious header file!
50 // phfctr (u, FORWARD); /* ON */
51 
52  if ((FermAct == "OVERLAP_POLE") || (FermAct == "ZOLOTAREV_4D"))
53  {
54  QDPIO::cerr << "mespbp_w.cc: Action " << FermAct << " unsupported." << std::endl;
55  QDP_abort(1);
56 
57  /* Use special overlap psi-bar-psi routine */
58 /* n_congrd = 0;
59  psi_bar_psi = 0;
60 
61  numMass = 1;
62  nhit = 1;
63  FILL(Mass, KappaMC);
64  FILL(RsdCG, RsdCGMC);
65  n_zero = - ichiral;
66  OvPbg5p (u, n_zero, Mass, numMass, nhit, RsdCG);
67  */
68  }
69  else
70  {
71  /* Use convenional psi-bar-psi measurement */
72 
73  /* fill with random gaussian noise such that < eta_dagger * eta > = 1 */
74  gaussian(eta);
75 
76  /* psi = W^(-1) * eta */
77  /* The inverse of the un-preconditioned matrix is needed here. This */
78  /* is given by Qprop! */
79  /* Note: Qprop trashes the source! Hence copy eta onto chi and use chi */
80  /* as the source. */
81  chi = eta;
82  psi = zero;
83  int n_congrd = 0;
84 // Qprop (u, chi, KappaMC, RsdCGMC, psi, n_congrd);
85  SystemSolverResults_t res = (*qprop)(psi, chi);
86  n_congrd = res.n_count;
87 
88  /* Chiral condensate = Tr [ eta_dag * psi ] */
89  trace_aux0 = real(trace(adj(eta) * psi));
90  psi_bar_psi = sum(trace_aux0);
91 
92  // Normalization
93  Real norm = 1.0 / Real(2 * QDP::Layout::vol());
94  norm /= (Ns * Nc);
95 
97 
98  // Write out results
99  push(xml_out, "elem");
100  write(xml_out, "pbp", psi_bar_psi);
101  pop(xml_out);
102 
103  }
104 
105 // phfctr (u, BACKWARD); /* OFF */
106 
107  END_CODE();
108 }
109 
110 } // end namespace Chroma
Primary include file for CHROMA library code.
Support class for fermion actions and linear operators.
Definition: state.h:94
Class for counted reference semantics.
Definition: handle.h:33
int FermAct
Class structure for fermion actions.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
Psibar-psi measurements.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
gaussian(aux)
Double psi_bar_psi
Definition: mespbp_s.cc:22
static multi1d< LatticeColorMatrix > u
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > const multi1d< Real > & Mass
Definition: pbg5p_w.cc:29
int n_congrd
Definition: mespbg5p_w.cc:24
int ichiral
Definition: mespbp_s.cc:21
push(xml_out,"Condensates")
multi1d< LatticeFermion > chi(Ncb)
LatticeFermion psi
Definition: mespbg5p_w.cc:35
pop(xml_out)
LatticeFermion eta
Definition: mespbg5p_w.cc:37
void MesPbp(Handle< SystemSolver< LatticeFermion > > qprop, Handle< FermState< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > state, const multi1d< Real > &Mass, const int ichiral, XMLWriter &xml_out, const std::string &xml_group, const std::string &FermAct)
Calculates noise estimator for psi_bar_psi.
Definition: mespbp_w.cc:22
START_CODE()
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
Definition: pbg5p_w.cc:28
Double zero
Definition: invbicg.cc:106
FloatingPoint< double > Double
Definition: gtest.h:7351
::std::string string
Definition: gtest.h:1979
Double sum
Definition: qtopcor.cc:37
int norm
Definition: qtopcor.cc:35
Holds return info from SystemSolver call.
Definition: syssolver.h:17