CHROMA
weak_field.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Construct a weak field
3  */
4 
5 #include "chromabase.h"
7 #include "util/gauge/sunfill.h"
8 
9 namespace Chroma
10 {
11 
12  //! Construct a weak field
13  /*!
14  * \ingroup gauge
15  *
16  * Make a gauge field close to free field - e.g., small fluctations
17  *
18  * Arguments:
19  *
20  * \param u Gauge field (Modify)
21  */
22  void weakField(multi1d<LatticeColorMatrix>& u)
23  {
24  START_CODE();
25 
26  u.resize(Nd);
27 
28  Real amp = 0.02 * twopi;
29  LatticeReal theta;
30  LatticeColorMatrix s1, s2;
31  multi1d<LatticeReal> a(4);
32  Real fact = 1.0 / sqrt(2.0);
33 
34  for(int mu = 0; mu < Nd; mu++)
35  {
36  u[mu] = 1.0;
37 
38  for(int su2_index = 0; su2_index < Nc*(Nc-1)/2; su2_index++)
39  {
40  // Embed a SU(2) within SU(N)
41  random(theta);
42  theta *= amp;
43  a[0] = fact*cos(theta);
44  a[1] = fact*sin(theta);
45 
46  random(theta);
47  theta *= amp;
48  a[2] = fact*cos(theta);
49  a[3] = fact*sin(theta);
50 
51  s1 = 1.0;
52  sunFill(s1, a, su2_index, all);
53 
54  // Mix up the indices by multiplying - still unitary
55  s2 = u[mu] * s1;
56  u[mu] = s2;
57  }
58  }
59 
60  END_CODE();
61  }
62 }
63 
64 
65 
66 
67 
68 
Primary include file for CHROMA library code.
int mu
Definition: cool.cc:24
int su2_index
Definition: cool.cc:27
void weakField(multi1d< LatticeColorMatrix > &u)
Construct a weak field.
Definition: weak_field.cc:22
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
Nd
Definition: meslate.cc:74
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
static multi1d< LatticeColorMatrix > u
const Real twopi
Definition: chromabase.h:55
Complex a
Definition: invbicg.cc:95
START_CODE()
Fill an SU(Nc) matrix with an SU(2) submatrix.
Construct a weak field.