CHROMA
sunfill.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Fill an SU(Nc) matrix with an SU(2) submatrix
3  */
4 
5 #include "chromabase.h"
6 #include "util/gauge/sunfill.h"
7 
8 namespace Chroma
9 {
10 
11  //! Fill a dest(su2_index) <- r_0,r_1,r_2,r_3 under a subset
12  /*!
13  * \ingroup gauge
14  *
15  * Fill an SU(Nc) matrix V with the SU(2) submatrix su2_index
16  * paramtrized by b_k in the sigma matrix basis.
17  *
18  * Fill in B from B_SU(2) = b0 + i sum_k bk sigma_k
19  *
20  * There are Nc*(Nc-1)/2 unique SU(2) submatrices in an SU(Nc) matrix.
21  * The user does not need to know exactly which one is which, just that
22  * they are unique.
23  *
24  * Arguments:
25  *
26  * \param dest su(n) matrix
27  * \param r su2 matrix represented in the O(4) rep. - an array of LatticeReal
28  * \param su2_index int lying in [0, Nc*(Nc-1)/2)
29  * \param s subset for operations (Read)
30  */
31 
32  void
33  sunFill(LatticeColorMatrix& dest,
34  const multi1d<LatticeReal>& r,
35  int su2_index,
36  const Subset& s)
37  {
38  START_CODE();
39 
40  /* Determine the SU(N) indices corresponding to the SU(2) indices */
41  /* of the SU(2) subgroup $3 */
42  int i1, i2;
43  int found = 0;
44  int del_i = 0;
45  int index = -1;
46 
47  while ( del_i < (Nc-1) && found == 0 )
48  {
49  del_i++;
50  for ( i1 = 0; i1 < (Nc-del_i); i1++ )
51  {
52  index++;
53  if ( index == su2_index )
54  {
55  found = 1;
56  break;
57  }
58  }
59  }
60  i2 = i1 + del_i;
61 
62  if ( found == 0 )
63  {
64  QDPIO::cerr << __func__ << ": trouble with SU2 subgroup index" << std::endl;
65  QDP_abort(1);
66  }
67 
68  /*
69  * Insert the b(k) of A_SU(2) = b0 + i sum_k bk sigma_k
70  * back into the SU(N) matrix
71  */
72  dest[s] = 1.0;
73 
74  pokeColor(dest[s], cmplx( r[0], r[3]), i1, i1);
75  pokeColor(dest[s], cmplx( r[2], r[1]), i1, i2);
76  pokeColor(dest[s], cmplx(-r[2], r[1]), i2, i1);
77  pokeColor(dest[s], cmplx( r[0],-r[3]), i2, i2);
78 
79  END_CODE();
80  }
81 
82 } // end namespace Chroma
83 
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
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
START_CODE()
multi1d< LatticeFermion > s(Ncb)
Fill an SU(Nc) matrix with an SU(2) submatrix.
#define index(c)