CHROMA
ischiral_w.cc
Go to the documentation of this file.
1 #include <chromabase.h>
2 #include "meas/eig/eig_w.h"
3 
4 namespace Chroma {
5 
6 Chirality isChiralVector(const LatticeFermion& chi)
7 {
8 
9  Chirality ret_val;
10 
11  Real chi_sq = Real(norm2(chi));
12 
13 
14  // LatticeFermion tmp = adj(chi)*Gamma(G5)*chi;
15  Real chirality = real(sum(innerProduct(chi,Gamma(Ns*Ns-1)*chi,all)));
16 
17  // If chi is chiral, then
18  //
19  // chirality = Sum Real Trace adj(chi)*Gamma_5*chi
20  //
21  // = +/- Sum Real Trace adj(chi) chi
22  // = +/- || chi ||^2 (+ for +ve chirality, - for -ve)
23  //
24  // So if || chi ||^2 - | chirality | = 0 then
25  // we have a definite chirality.
26  //
27  Real tmp1 = chi_sq - fabs(chirality);
28 
29  // To get a boolean out of < operator I have to apply
30  // toBool. Is this because otherwise it is some kind of selector
31  // for a mask?
32  if ( toBool(tmp1 > fabs(chirality)*fuzz) ) {
33  ret_val = CH_NONE;
34  }
35  else {
36 
37  // To get a boolean out of < operator I have to apply
38  // toBool. Is this because otherwise it is some kind of selector
39  // for a mask?
40  if( toBool( chirality > 0 ) ) {
41  ret_val = CH_PLUS;
42  }
43  else {
44  ret_val = CH_MINUS;
45  }
46  }
47 
48  return ret_val;
49 }
50 
51 } // end namespace Chroma
Primary include file for CHROMA library code.
Eigenvalue measurements.
BinaryReturn< C1, C2, FnInnerProduct >::Type_t innerProduct(const QDPSubType< T1, C1 > &s1, const QDPType< T2, C2 > &s2)
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
Chirality
Definition: ischiral_w.h:8
@ CH_NONE
Definition: ischiral_w.h:8
@ CH_PLUS
Definition: ischiral_w.h:8
@ CH_MINUS
Definition: ischiral_w.h:8
Chirality isChiralVector(const LatticeFermion &chi)
Definition: ischiral_w.cc:6
multi1d< LatticeFermion > chi(Ncb)
Double sum
Definition: qtopcor.cc:37