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