CHROMA
su3proj.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 // $Id: su3proj.cc,v 3.1 2007-02-22 21:11:50 bjoo Exp $
3 /*! \file
4  * \ingroup gauge
5  * \author Subsetting added by A. Hart
6  * \param[in,out] u the projected SU(3) Matrix (Modify)
7  * \param[in] w matrix against which to maximize (Read)
8  * \param[in] su2_index SU(2) subgroup index (Read)
9  * \param[in] mstag An (un)ordered subset of sites (Read)
10  * \brief Project a GL(3,C) color matrix onto SU(3)
11  *
12  * Project a complex Nc x Nc matrix W onto SU(Nc) by maximizing Tr(VW)
13  */
14 
15 #include "chromabase.h"
16 #include "util/gauge/su2extract.h"
17 #include "util/gauge/sunfill.h"
18 #include "util/gauge/su3proj.h"
19 
20 namespace Chroma
21 {
22 
23  template<typename S>
24  void su3proj_t(LatticeColorMatrix& u,
25  const LatticeColorMatrix& w,
26  int su2_index,
27  const S& mstag)
28  {
29  START_CODE();
30 
31  // V = U*W
32  LatticeColorMatrix v;
33  v[mstag] = u * w;
34 
35  /*
36  * Extract components r_k proportional to SU(2) submatrix su2_index
37  * from the "SU(3)" matrix V. The SU(2) matrix is parameterized in the
38  * sigma matrix basis.
39  */
40  multi1d<LatticeReal> r(4);
41  su2Extract(r, v, su2_index, mstag);
42 
43  /*
44  * Now project onto SU(2)
45  */
46  LatticeReal r_l = 0;
47  r_l[mstag] = sqrt(r[0]*r[0] + r[1]*r[1] + r[2]*r[2] + r[3]*r[3]);
48 
49  // Normalize
50  LatticeBoolean lbtmp = false;
51  lbtmp[mstag] = r_l > fuzz;
52  LatticeReal lftmp = 1.0 / where(lbtmp, r_l, LatticeReal(1));
53 
54  // Fill (r[0]/r_l, -r[1]/r_l, -r[2]/r_l, -r[3]/r_l) for r_l > fuzz
55  // and (1,0,0,0) for sites with r_l < fuzz
56  multi1d<LatticeReal> a(4);
57  a[0] = where(lbtmp, r[0] * lftmp, LatticeReal(1));
58  a[1] = where(lbtmp, -(r[1] * lftmp), LatticeReal(0));
59  a[2] = where(lbtmp, -(r[2] * lftmp), LatticeReal(0));
60  a[3] = where(lbtmp, -(r[3] * lftmp), LatticeReal(0));
61 
62  /*
63  * Now fill an SU(3) matrix V with the SU(2) submatrix su2_index
64  * paramtrized by a_k in the sigma matrix basis.
65  */
66  sunFill(v, a, su2_index, mstag);
67 
68  // U = V*U
69  LatticeColorMatrix tmp;
70  tmp[mstag] = v * u;
71  u[mstag] = tmp;
72 
73  END_CODE();
74  }
75 
76  void su3proj(LatticeColorMatrix& u,
77  const LatticeColorMatrix& w,
78  int su2_index)
79  {
80  su3proj_t(u, w, su2_index, all);
81  }
82 
83  void su3proj(LatticeColorMatrix& u,
84  const LatticeColorMatrix& w,
85  int su2_index,
86  const Subset& mstag)
87  {
88  su3proj_t(u, w, su2_index, mstag);
89  }
90 
91 
92 } // end namespace Chroma
93 
Primary include file for CHROMA library code.
int su2_index
Definition: cool.cc:27
void sunFill(LatticeColorMatrix &dest, const multi1d< LatticeReal > &r, int su2_index, const Subset &s)
Fill a dest(su2_index) <- r_0,r_1,r_2,r_3 under a subset.
Definition: sunfill.cc:33
void su2Extract(multi1d< LatticeReal > &r, const LatticeColorMatrix &source, int su2_index, const Subset &s)
Su2_extract: r_0,r_1,r_2,r_3 <- source(su2_index) [SU(N) field] under a subset.
Definition: su2extract.cc:86
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
void su3proj_t(LatticeColorMatrix &u, const LatticeColorMatrix &w, int su2_index, const S &mstag)
Definition: su3proj.cc:24
static multi1d< LatticeColorMatrix > u
LatticeFermion tmp
Definition: mespbg5p_w.cc:36
void su3proj(LatticeColorMatrix &u, const LatticeColorMatrix &w, int su2_index)
Definition: su3proj.cc:76
Complex a
Definition: invbicg.cc:95
START_CODE()
Extract an unnormalized SU(2) matrix from a GL(3,C) matrix.
Project a GL(3,C) color matrix onto SU(3)
Fill an SU(Nc) matrix with an SU(2) submatrix.