CHROMA
taproj.cc
Go to the documentation of this file.
1 // TAPROJ
2 
3 /*! \file
4  * \brief Take the traceless antihermitian projection of a color matrix
5  */
6 
7 #include "chromabase.h"
8 #include "util/gauge/taproj.h"
9 
10 namespace Chroma
11 {
12 
13  namespace TaprojEnv {
14  static double time_spent =0;
15  double getTime() { return time_spent; }
16  }
17 
18  //! Take the traceless antihermitian projection of a color matrix
19  /*!
20  * \ingroup gauge
21  *
22  * a = (1/2)[a - a_dag] - Tr[(1/2)*(a - a_dag)]/Nc
23  *
24  * that is the anti-hermitian traceless part of a
25  *
26  * Arguments:
27  *
28  * \param a LatticeColorMatrix (Modify)
29  */
30 
31  void taproj(LatticeColorMatrix& a)
32  {
33  START_CODE();
34  QDP::StopWatch swatch;
35  swatch.reset();
36  swatch.start();
37 
38  // a = a - a_dagger --- a -> antihermitian matrix
39  LatticeColorMatrix aux_1 = a;
40  a -= adj(aux_1);
41 
42  if (Nc > 1) {
43  // tmp = Im Tr[ a ]
44  LatticeReal tmp = imag(trace(a));
45 
46  // a = a - (1/Nc) * Im Tr[ a] = a - (1/Nc)*tmp
47  tmp *= (Real(1)/Real(Nc));
48 
49  // Is this a fill or a UnitMatrix*I?
50  LatticeColorMatrix aux = cmplx(0, tmp);
51  a -= aux;
52  }
53 
54  // Normalisation to make taproj idempotent
55  a *= (Real(1)/Real(2));
56 
57  swatch.stop();
58  TaprojEnv::time_spent+=swatch.getTimeInSeconds();
59  END_CODE();
60  }
61 
62 } // end namespace Chroma
Primary include file for CHROMA library code.
void taproj(LatticeColorMatrix &a)
Take the traceless antihermitian projection of a color matrix.
Definition: taproj.cc:31
static double time_spent
Definition: taproj.cc:14
double getTime()
Definition: taproj.cc:15
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
LatticeStaggeredFermion aux
Definition: mespbp_s.cc:23
LatticeFermion tmp
Definition: mespbg5p_w.cc:36
Complex a
Definition: invbicg.cc:95
LatticeComplex aux_1
Definition: mespbg5p_w.cc:39
START_CODE()
Take the traceless antihermitian projection of a color matrix.