Bridge++  Ver. 1.2.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
staples_eo.cpp
Go to the documentation of this file.
1 
14 #include "staples_eo.h"
15 
16 const std::string Staples_eo::class_name = "Staples_eo";
17 
18 //====================================================================
20 {
21  return (plaq_s(U) + plaq_t(U)) / 2;
22 }
23 
24 
25 //====================================================================
26 double Staples_eo::plaq_s(const Field_G *U)
27 {
28  double plaq = 0.0;
29  static Field_G staple;
30 
31  staple = upper(U, 0, 1);
32  // staple = lower(U,0,1);
33  for (int site = 0; site < Nvol; site++) {
34  plaq += ReTr(U->mat(site, 0) * staple.mat_dag(site)); // P_xy
35  }
36 
37  staple = upper(U, 1, 2);
38  // staple = lower(U,1,2);
39  for (int site = 0; site < Nvol; site++) {
40  plaq += ReTr(U->mat(site, 1) * staple.mat_dag(site)); // P_yz
41  }
42 
43  staple = upper(U, 2, 0);
44  // staple = lower(U,2,0);
45  for (int site = 0; site < Nvol; site++) {
46  plaq += ReTr(U->mat(site, 2) * staple.mat_dag(site)); // P_zx
47  }
48 
49  plaq = comm->reduce_sum(plaq);
50 
51  return plaq / (Lvol * Nc * 3.0);
52 }
53 
54 
55 //====================================================================
56 double Staples_eo::plaq_t(const Field_G *U)
57 {
58  double plaq = 0.0;
59  static Field_G staple;
60 
61  for (int nu = 0; nu < Ndim - 1; nu++) {
62  staple = lower(U, 3, nu);
63  // staple = upper(U,3,nu);
64  for (int site = 0; site < Nvol; site++) {
65  plaq += ReTr(U->mat(site, 3) * staple.mat_dag(site)); // P_zx
66  }
67  }
68 
69  plaq = comm->reduce_sum(plaq);
70 
71  return plaq / (Lvol * Nc * 3.0);
72 }
73 
74 
75 //====================================================================
76 void Staples_eo::staple(Field_G& W, const Field_G *U, const int mu)
77 {
78  W = 0.0;
79  for (int nu = 0; nu < Ndim; nu++) {
80  if (nu != mu) {
81  W += upper(U, mu, nu);
82  W += lower(U, mu, nu);
83  }
84  }
85 }
86 
87 
88 //====================================================================
89 Field_G Staples_eo::upper(const Field_G *U, const int mu, const int nu)
90 {
91  // (1) mu (2)
92  // +-->--+
93  // nu | |
94  // i+ +
95 
96  Field_G c;
97 
98  Umu.setpart_ex(0, *U, mu);
99  Unu.setpart_ex(0, *U, nu);
100 
101  shift.backward(v, Unu, mu);
102  shift.backward(c, Umu, nu);
103 
104  mult_Field_Gnd(w, 0, c, 0, v, 0);
105  mult_Field_Gnn(c, 0, Unu, 0, w, 0);
106 
107  return c;
108 }
109 
110 
111 //====================================================================
112 Field_G Staples_eo::lower(const Field_G *U, const int mu, const int nu)
113 {
114  // + +
115  // nu | |
116  // i+-->--+
117  // (1) mu (2)
118 
119  Field_G c;
120 
121  Umu.setpart_ex(0, *U, mu);
122  Unu.setpart_ex(0, *U, nu);
123 
124  shift.backward(w, Unu, mu);
125  mult_Field_Gnn(v, 0, Umu, 0, w, 0);
126  //mult_Field_Gnn(v, 0,*U,mu,w,0);
127  mult_Field_Gdn(w, 0, Unu, 0, v, 0);
128  shift.forward(c, w, nu);
129 
130  return c;
131 }
132 
133 
134 //====================================================================
135 //============================================================END=====
double plaq_t(const Field_G *)
Definition: staples_eo.cpp:56
void backward(Field &, const Field &, const int mu)
Communicator * comm
Definition: staples_eo.h:48
void mult_Field_Gdn(Field_G &w, const int ex, const Field_G &u1, const int ex1, const Field_G &u2, const int ex2)
static const std::string class_name
Definition: staples_eo.h:36
double plaq_s(const Field_G *)
Definition: staples_eo.cpp:26
Field_G Unu
Definition: staples_eo.h:46
double plaquette(const Field_G *)
Definition: staples_eo.cpp:19
ShiftField_eo shift
Definition: staples_eo.h:47
SU(N) gauge field.
Definition: field_G.h:36
Field_G w
Definition: staples_eo.h:46
void mult_Field_Gnd(Field_G &w, const int ex, const Field_G &u1, const int ex1, const Field_G &u2, const int ex2)
void mult_Field_Gnn(Field_G &w, const int ex, const Field_G &u1, const int ex1, const Field_G &u2, const int ex2)
Field_G upper(const Field_G *, const int, const int)
Definition: staples_eo.cpp:89
Field_G v
Definition: staples_eo.h:46
Field_G Umu
Definition: staples_eo.h:46
void staple(Field_G &, const Field_G *, const int)
Definition: staples_eo.cpp:76
void forward(Field &, const Field &, const int mu)
Mat_SU_N mat_dag(const int site, const int mn=0) const
Definition: field_G.h:123
Field_G lower(const Field_G *, const int, const int)
Definition: staples_eo.cpp:112
static int reduce_sum(int count, double *recv_buf, double *send_buf, int pattern=0)
make a global sum of an array of double over the communicator. pattern specifies the dimensions to be...
void setpart_ex(int ex, const Field &w, int exw)
Definition: field.h:150
Mat_SU_N mat(const int site, const int mn=0) const
Definition: field_G.h:110
double ReTr(const Mat_SU_N &m)
Definition: mat_SU_N.h:488