30 const LatticeColorMatrix& w,
47 multi1d<LatticeReal>
r(4);
54 r_l[sub] = sqrt(
r[0]*
r[0] +
r[1]*
r[1] +
r[2]*
r[2] +
r[3]*
r[3]);
58 lbtmp[sub] = r_l > fuzz;
60 lftmp[sub] = 1.0 / where(lbtmp, r_l, LatticeReal(1));
64 multi1d<LatticeReal>
a(4);
65 a[0][sub] = where(lbtmp,
r[0] * lftmp, LatticeReal(1));
66 a[1][sub] = where(lbtmp, -(
r[1] * lftmp), LatticeReal(0));
67 a[2][sub] = where(lbtmp, -(
r[2] * lftmp), LatticeReal(0));
68 a[3][sub] = where(lbtmp, -(
r[3] * lftmp), LatticeReal(0));
76 QDPIO::cerr <<
"FIX Beta" << std::endl;
81 int num_sites = sub.numSiteTable();
82 int itrials = num_sites;
86 LatticeBoolean lupdate;
89 LatticeBoolean lbtmp2;
104 while ( nhb < nheat && n_done < num_sites )
109 r[1][sub] = log(
r[1]);
112 r[2][sub] = log(
r[2]);
115 r[3][sub] = pow(cos(Real(
twopi)*lftmp),2);
117 r[1][sub] +=
r[2] *
r[3];
118 r[2][sub] =
r[1] / r_l;
123 r[1][sub] = lftmp*lftmp;
125 lbtmp[sub] =
r[1] <= (1 + 0.5*
r[2]);
126 lbtmp2[sub] = lbtmp & lupdate;
127 r[0][sub] = where(lbtmp2, 1+
r[2],
r[0]);
129 int itmp = toInt(
sum(where(lbtmp2, LatticeInteger(1), LatticeInteger(0)),sub));
149 lftmp2 = exp(2 * r_l) - 1;
154 while ( nhb < nheat && n_done < num_sites )
159 r[2][sub] = log(1 +
r[1] * lftmp2) / r_l - 1;
164 r[1][sub] = lftmp1 * lftmp1;
166 lbtmp =
r[1] <= (1 -
r[2] *
r[2]);
167 lbtmp2 = lbtmp & lupdate;
169 r[0][sub] = where(lbtmp2,
r[2],
r[0]);
171 int itmp = toInt(
sum(where(lbtmp2, LatticeInteger(1), LatticeInteger(0)),sub));
184 QDPIO::cerr << __func__ <<
": unknown algorithm type" << std::endl;
192 r[2][sub] = 1 - 2*lftmp1;
194 lftmp1[sub] = fabs(1 -
r[0]*
r[0]);
195 r[3][sub] = -(sqrt(lftmp1) *
r[2]);
198 r_l[sub] = sqrt(fabs(lftmp1 -
r[3]*
r[3]));
201 lftmp1[sub] *=
twopi;
202 r[1][sub] = r_l * cos(lftmp1);
203 r[2][sub] = r_l * sin(lftmp1);
207 multi1d<LatticeReal>
b(4);
208 b[0][sub] =
r[0]*
a[0] -
r[1]*
a[1] -
r[2]*
a[2] -
r[3]*
a[3];
209 b[1][sub] =
r[0]*
a[1] +
r[1]*
a[0] -
r[2]*
a[3] +
r[3]*
a[2];
210 b[2][sub] =
r[0]*
a[2] +
r[2]*
a[0] -
r[3]*
a[1] +
r[1]*
a[3];
211 b[3][sub] =
r[0]*
a[3] +
r[3]*
a[0] -
r[1]*
a[2] +
r[2]*
a[1];
220 LatticeColorMatrix
tmp;
Primary include file for CHROMA library code.
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.
void su2Extract(multi1d< LatticeReal > &r, const LatticeColorMatrix &source, int su2_index, const Subset &s)
Su2_extract: r_0,r_1,r_2,r_3 <- source(su2_index) [SU(N) field] under a subset.
void su3hb(LatticeColorMatrix &u, const LatticeColorMatrix &w, int su2_index, int nheat, int &ntrials, int &nfails, HeatbathType algorithm, const Subset &sub)
Do one SU(2) subgroup heatbath update of SU(Nc) matrix U with action.
Asqtad Staggered-Dirac operator.
static multi1d< LatticeColorMatrix > u
HeatbathType
Algorithm type.
Do one SU(2) subgroup heatbath update of SU(Nc) matrix U with action.
Fill an SU(Nc) matrix with an SU(2) submatrix.