ischiral_w.cc

Go to the documentation of this file.
00001 // $Id: ischiral_w.cc,v 3.0 2006/04/03 04:58:57 edwards Exp $
00002 #include <chromabase.h>
00003 #include "meas/eig/eig_w.h"
00004 
00005 namespace Chroma {
00006 
00007 Chirality isChiralVector(const LatticeFermion& chi)
00008 {
00009 
00010   Chirality ret_val;
00011 
00012   Real chi_sq = Real(norm2(chi));
00013 
00014  
00015   //  LatticeFermion tmp = adj(chi)*Gamma(G5)*chi;
00016   Real chirality = real(sum(innerProduct(chi,Gamma(Ns*Ns-1)*chi,all)));
00017 
00018   // If chi is chiral, then 
00019   //
00020   //  chirality =  Sum Real Trace adj(chi)*Gamma_5*chi
00021   //   
00022   //            =  +/- Sum Real Trace adj(chi) chi
00023   //            =  +/- || chi ||^2   (+ for +ve chirality, - for -ve)
00024   //
00025   // So if  || chi ||^2 - | chirality | = 0 then 
00026   // we have a definite chirality.
00027   // 
00028   Real tmp1 = chi_sq - fabs(chirality);
00029 
00030   // To get a boolean out of < operator I have to apply
00031   // toBool. Is this because otherwise it is some kind of selector
00032   // for a mask?
00033   if ( toBool(tmp1 > fabs(chirality)*fuzz) ) {
00034     ret_val = CH_NONE;
00035   }
00036   else { 
00037 
00038     // To get a boolean out of < operator I have to apply
00039     // toBool. Is this because otherwise it is some kind of selector
00040     // for a mask?
00041     if( toBool( chirality > 0 ) ) { 
00042       ret_val = CH_PLUS;
00043     }
00044     else {
00045       ret_val = CH_MINUS;
00046     }
00047   }
00048 
00049   return ret_val;
00050 }
00051 
00052 }  // end namespace Chroma

Generated on Sun Mar 14 04:33:26 2010 for CHROMA by  doxygen 1.4.7