Bridge++  Ver. 1.3.x
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 //====================================================================
19 double Staples_eo::plaquette(const Field_G *Ueo)
20 {
21  return (plaq_s(Ueo) + plaq_t(Ueo)) / 2;
22 }
23 
24 
25 //====================================================================
26 double Staples_eo::plaq_s(const Field_G *Ueo)
27 {
28  double plaq = 0.0;
29  static Field_G staple;
30 
31  upper(staple, Ueo, 0, 1);
32  for (int site = 0; site < Nvol; site++) {
33  plaq += ReTr(Ueo->mat(site, 0) * staple.mat_dag(site)); // P_xy
34  }
35 
36  upper(staple, Ueo, 1, 2);
37  for (int site = 0; site < Nvol; site++) {
38  plaq += ReTr(Ueo->mat(site, 1) * staple.mat_dag(site)); // P_yz
39  }
40 
41  upper(staple, Ueo, 2, 0);
42  for (int site = 0; site < Nvol; site++) {
43  plaq += ReTr(Ueo->mat(site, 2) * staple.mat_dag(site)); // P_zx
44  }
45 
46  plaq = comm->reduce_sum(plaq);
47 
48  return plaq / (Lvol * Nc * 3.0);
49 }
50 
51 
52 //====================================================================
53 double Staples_eo::plaq_t(const Field_G *Ueo)
54 {
55  double plaq = 0.0;
56  static Field_G staple;
57 
58  for (int nu = 0; nu < Ndim - 1; nu++) {
59  lower(staple, Ueo, 3, nu);
60  for (int site = 0; site < Nvol; site++) {
61  plaq += ReTr(Ueo->mat(site, 3) * staple.mat_dag(site)); // P_zx
62  }
63  }
64 
65  plaq = comm->reduce_sum(plaq);
66 
67  return plaq / (Lvol * Nc * 3.0);
68 }
69 
70 
71 //====================================================================
72 void Staples_eo::staple(Field_G& W, const Field_G *Ueo, const int mu)
73 {
74  W.set(0.0);
75  Field_G u_tmp(W.nvol(), 1);
76  for (int nu = 0; nu < Ndim; nu++) {
77  if (nu != mu) {
78  upper(u_tmp, Ueo, mu, nu);
79  axpy(W, 1.0, u_tmp);
80  lower(u_tmp, Ueo, mu, nu);
81  axpy(W, 1.0, u_tmp);
82  }
83  }
84 }
85 
86 
87 //====================================================================
88 void Staples_eo::upper(Field_G& c, const Field_G *Ueo, const int mu, const int nu)
89 {
90  // (1) mu (2)
91  // +-->--+
92  // nu | |
93  // i+ +
94 
95  Umu.setpart_ex(0, *Ueo, mu);
96  Unu.setpart_ex(0, *Ueo, nu);
97 
98  shift.backward(v, Unu, mu);
99  shift.backward(c, Umu, nu);
100 
101  mult_Field_Gnd(w, 0, c, 0, v, 0);
102  mult_Field_Gnn(c, 0, Unu, 0, w, 0);
103 }
104 
105 
106 //====================================================================
107 void Staples_eo::lower(Field_G& c, const Field_G *Ueo, const int mu, const int nu)
108 {
109  // + +
110  // nu | |
111  // i+-->--+
112  // (1) mu (2)
113 
114  Umu.setpart_ex(0, *Ueo, mu);
115  Unu.setpart_ex(0, *Ueo, nu);
116 
117  shift.backward(w, Unu, mu);
118  mult_Field_Gnn(v, 0, Umu, 0, w, 0);
119  mult_Field_Gdn(w, 0, Unu, 0, v, 0);
120  shift.forward(c, w, nu);
121 }
122 
123 
124 //====================================================================
125 //============================================================END=====
double plaq_t(const Field_G *)
Definition: staples_eo.cpp:53
void backward(Field &, const Field &, const int mu)
Communicator * comm
Definition: staples_eo.h:48
void set(const int jin, const int site, const int jex, double v)
Definition: field.h:155
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
int nvol() const
Definition: field.h:116
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:38
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 v
Definition: staples_eo.h:46
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
Definition: field.cpp:168
Field_G Umu
Definition: staples_eo.h:46
void staple(Field_G &, const Field_G *, const int)
Definition: staples_eo.cpp:72
void upper(Field_G &, const Field_G *, const int, const int)
Definition: staples_eo.cpp:88
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:126
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:177
void lower(Field_G &, const Field_G *, const int, const int)
Definition: staples_eo.cpp:107
Mat_SU_N mat(const int site, const int mn=0) const
Definition: field_G.h:113
double ReTr(const Mat_SU_N &m)
Definition: mat_SU_N.h:488