CHROMA
mespbg5p_w.cc
Go to the documentation of this file.
1 
2 namespace Chroma {
3 
4 
5 include(types.mh)
6 
7 /* + */
8 /* $Id: mespbg5p_w.cc,v 3.0 2006-04-03 04:59:04 edwards Exp $ ($Date: 2006-04-03 04:59:04 $) */
9 
10 /* MESPBG5P - Calculates noise estimator for psi_bar_psi, psi_bar gamma_5 psi, */
11 /* <psi_bar gamma_5 psi psi_bar gamma_5 psi>, */
12 /* <psi_bar gamma_5 psi (psi_bar gamma_5 psi)^dag> */
13 
14 /* This routine is specific to Wilson fermions! */
15 
16 /* u -- gauge field ( Read ) */
17 /* n_hit -- number of Gaussian hits ( Read ) */
18 /* pbp_st -- estimator of psi_bar_psi from first hit ( Write ) */
19 /* n_congrd -- Number of CG iteration ( Write ) */
20 /* - */
21 SUBROUTINE(MesPbg5p, u, nhit, pbp_st, n_congrd)
22 
23 multi1d<LatticeColorMatrix> u(Nd);
26 int nhit;
27 
28 { /* Local variables */
29  include(COMMON_DECLARATIONS)
30 
32  DComplex pbg5p_st;
33  DComplex pbg5p_sq_st;
34  DComplex pbg5p_mdsq_st;
35  LatticeFermion psi;
36  LatticeFermion tmp;
37  LatticeFermion eta;
38  LatticeComplex aux_0;
39  LatticeComplex aux_1;
40  LatticeReal lrtrace_aux;
41  LatticeReal lrtrace_tmp;
42  LatticeComplex lctrace_aux;
43 
46  int ihit;
47 
48  START_CODE();
49 
50  phfctr (u, FORWARD); /* ON */
51 
52 
53  pbp_st_m = 0;
54  pbg5p_st = 0;
55  pbg5p_sq_st = 0;
56  pbg5p_mdsq_st = 0;
57  n_congrd = 0;
58 
59 
60  for(ihit = 1; ihit <= nhit; ++ihit)
61  {
62  /* Fill with random gaussian noise such that < eta_dagger * eta > = 1 */
63  gaussian(eta);
64 
65  /* If using Schroedinger functional, zero out the boundaries */
66  if ( SchrFun > 0 )
67  {
68  FILLMASK(eta(0), lSFmaskF(0), ZERO);
69  FILLMASK(eta(1), lSFmaskF(1), ZERO);
70  }
71 
72  /* First source */
73  /* aux_0 = W^(-1) * eta */
74  /* The inverse of the un-preconditioned matrix is needed here. This */
75  /* is given by Qprop! */
76  psi = 0;
77  tmp = eta;
78  Qprop (u, tmp, KappaMC, RsdCGMC, psi, n_congrd);
79 
80  /* Chiral condensate = Tr [ eta_dag * psi ] */
81 
82  lrtrace_aux = real(trace(adj[eta[0]] * psi[0]));
83  lrtrace_tmp = real(trace(adj[eta[1]] * psi[1]));
84 
86  if ( ihit == 1 )
87  {
89  pbp_st_m += pbp_st;
90  }
91  else
93 
94 
95  /* Scalar condensate = Tr [ eta_dag * gamma_5 * psi ] */
96 
97  SPIN_PRODUCT(psi(0),15,tmp(0));
98  SPIN_PRODUCT(psi(1),15,tmp(1));
99  aux_0 = trace(adj[eta] * tmp);
100 
101  lctrace_aux = aux_0[0];
102  lctrace_aux += aux_0[1];
104 
105 
106 
107  /* Fill with random gaussian noise such that < eta_dagger * eta > = 1 */
108  gaussian(eta);
109 
110  /* Second source */
111  /* psi = W^(-1) * eta */
112  /* The inverse of the un-preconditioned matrix is needed here. This */
113  /* is given by Qprop! */
114  psi = 0;
115  tmp = eta;
116  Qprop (u, tmp, KappaMC, RsdCGMC, psi, n_congrd);
117 
118  /* Chiral condensate = Tr [ eta_dag * psi ] */
119 
120  lrtrace_aux = real(trace(adj[eta[0]] * psi[0]));
121  lrtrace_tmp = real(trace(adj[eta[1]] * psi[1]));
122 
125 
126 
127  /* Scalar condensate = Tr [ eta_dag * gamma_5 * psi ] */
128 
129  SPIN_PRODUCT(psi(0),15,tmp(0));
130  SPIN_PRODUCT(psi(1),15,tmp(1));
131  aux_1 = trace(adj[eta] * tmp);
132 
133  lctrace_aux = aux_1[0];
134  lctrace_aux += aux_1[1];
136 
137 
138 
139  /* Construct <psi_bar gamma_5 psi psi_bar gamma_5 psi > */
140  /* this is equivalent to < tr( eta2^dag * psi2 * eta1^dag * psi1 )> */
141  /* Also construct <psi_bar gamma_5 psi (psi_bar gamma_5 psi)^dag > */
142  /* which is equivalent to < tr( eta2^dag * psi2 * (eta1^dag * psi1^dag) ) > */
143 
144  lctrace_aux = aux_1[0] * aux_0[0];
145  lctrace_aux += aux_1[1] * aux_0[1];
147 
148  lctrace_aux = aux_1[0] * adj(aux_0[0]);
149  lctrace_aux += aux_1[1] * adj(aux_0[1]);
151 
152  }
153 
154 
155  phfctr (u, BACKWARD); /* OFF */
156 
157  pbp_st = pbp_st / TO_DOUBLE(vol_cb*2*Nc*Ns);
158  ddummy1 = TO_DOUBLE(1) / TO_DOUBLE(nhit * 2*vol*Nc*Ns);
159  ddummy2 = TO_DOUBLE(1) / TO_DOUBLE(nhit * vol*Nc*Nc*Ns*Ns);
164 
165  push(xml_out,"Condensates");
166 write(xml_out, "nhit", nhit);
167 write(xml_out, "pbp_st_m", pbp_st_m);
168 write(xml_out, "pbg5p_st", pbg5p_st);
169 write(xml_out, "pbg5p_sq_st", pbg5p_sq_st);
170 write(xml_out, "pbg5p_mdsq_st", pbg5p_mdsq_st);
171 pop(xml_out);
172 
173 
174  END_CODE();
175 }
176 
177 } // end namespace Chroma
EXTERN Real KappaMC
EXTERN Real RsdCGMC
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
Nd
Definition: meslate.cc:74
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
gaussian(aux)
phfctr(u, FORWARD)
static multi1d< LatticeColorMatrix > u
LatticeFermion tmp
Definition: mespbg5p_w.cc:36
int n_congrd
Definition: mespbg5p_w.cc:24
push(xml_out,"Condensates")
Double ddummy1
Definition: mespbg5p_w.cc:44
int ihit
Definition: mespbg5p_w.cc:46
DComplex pbg5p_mdsq_st
Definition: mespbg5p_w.cc:34
LatticeComplex lctrace_aux
Definition: mespbg5p_w.cc:42
LatticeReal lrtrace_aux
Definition: mespbg5p_w.cc:40
LatticeFermion psi
Definition: mespbg5p_w.cc:35
pop(xml_out)
Double pbp_st
Definition: mespbg5p_w.cc:25
LatticeFermion eta
Definition: mespbg5p_w.cc:37
LatticeComplex aux_0
Definition: mespbg5p_w.cc:38
LatticeComplex aux_1
Definition: mespbg5p_w.cc:39
LatticeReal lrtrace_tmp
Definition: mespbg5p_w.cc:41
DComplex pbg5p_st
Definition: mespbg5p_w.cc:28
START_CODE()
DComplex pbg5p_sq_st
Definition: mespbg5p_w.cc:33
int nhit
Definition: mespbg5p_w.cc:26
include(types.mh) LINEAR_OPERATOR(A)
Double ddummy2
Definition: mespbg5p_w.cc:45
FloatingPoint< double > Double
Definition: gtest.h:7351
#define FORWARD
Definition: primitives.h:82
#define BACKWARD
Definition: primitives.h:83
Double sum
Definition: qtopcor.cc:37
#define ZERO