13 typedef LatticeFermion
T;
14 typedef multi1d<LatticeColorMatrix>
P;
15 typedef multi1d<LatticeColorMatrix>
Q;
17 int main(
int argc,
char *argv[])
23 const int foo[] = {4,4,4,4};
24 multi1d<int> nrow(
Nd);
32 Layout::setLattSize(nrow);
36 push(xml,
"t_stout_state");
41 write(xml,
"nrow", nrow);
46 multi1d<LatticeColorMatrix>
u(
Nd);
49 XMLReader file_xml, record_xml;
57 QDPIO::cout <<
"w_plaq = " <<
w_plaq << std::endl;
58 QDPIO::cout <<
"link = " <<
link << std::endl;
61 push(xml,
"Observables");
68 QDPIO::cout << std::endl <<
"Stout Smearing Checks " << std::endl;
71 push(xml,
"SmearingParams");
72 write(xml,
"rho", rho);
73 write(xml,
"n_smear", n_smear);
74 write(xml,
"orthog_dir", orthog_dir);
78 multi1d<LatticeColorMatrix> u_smear(
Nd);
79 multi1d<LatticeColorMatrix> u_tmp(
Nd);
102 for(
int i=0;
i < n_smear;
i++) {
104 if(
mu != orthog_dir) {
108 u_smear[
mu] = u_tmp[
mu];
116 QDPIO::cout <<
"w_plaq ("<< n_smear <<
" levels of old stout smearing) = " <<
w_plaq << std::endl;
118 push(xml,
"CheckStoutStateSmear");
127 multi1d<LatticeColorMatrix> u_rg(
Nd);
128 LatticeColorMatrix g;
136 typedef LatticeFermion
T;
137 typedef multi1d<LatticeColorMatrix>
P;
138 typedef multi1d<LatticeColorMatrix>
Q;
150 QDPIO::cout <<
"w_plaq ("<< n_smear <<
" levels of new stout smearing) = " <<
w_plaq << std::endl;
155 QDPIO::cout <<
"w_plaq (After gauge transf and " << n_smear <<
" levels new stout smearing) = " <<
w_plaq << std::endl << std::endl;
157 write(xml,
"new_smearing_from_state_gtrans",
w_plaq);
160 QDPIO::cout <<
"mu: " <<
mu << std::endl;
161 LatticeColorMatrix Q1, Q2;
162 LatticeColorMatrix QQ1,QQ2;
164 LatticeColorMatrix C_tmp;
165 LatticeDouble c0,c1,c0_rg,c1_rg;
170 QDPIO::cout <<
"Gauge invatiance check for Q: " << norm2( Q2-g*Q1*adj(g) )
172 QDPIO::cout <<
"Gauge invariance check for Q^2: "
173 << norm2( QQ2 - g*QQ1*adj(g)) << std::endl;
177 multi1d<LatticeComplex> f(3), f_rg(3);
178 multi1d<LatticeComplex> b_1,b_2;
182 LatticeColorMatrix expiQ = (f[0]+f[1]*Q1+f[2]*QQ1);
183 LatticeColorMatrix rg_expiQ = (f_rg[0]+f_rg[1]*Q2+f_rg[2]*QQ2);
184 QDPIO::cout <<
"Gauge invariance check for e(iQ): "
185 << norm2( rg_expiQ - g*expiQ*adj(g)) << std::endl;
188 LatticeColorMatrix stout_link = expiQ*
u[
mu];
189 LatticeColorMatrix rg_stout_link = rg_expiQ*u_rg[
mu];
190 QDPIO::cout <<
"Gauge invariance check for stout_link: "
191 << norm2( rg_stout_link - g*stout_link*shift(adj(g),
FORWARD,
mu) )
194 QDPIO::cout <<
"Diff getLink(): " << norm2(stout_link-s_state->getLinks()[
mu])
197 QDPIO::cout <<
"Diff getLink() gtrans ["<<
mu<<
"] = "
198 << norm2(rg_stout_link- s_state2->getLinks()[
mu]) << std::endl;
200 LatticeColorMatrix stout_smeared;
202 LatticeColorMatrix rg_stout_smeared;
205 QDPIO::cout <<
"NonStateStoutSmear - StateStoutSmear: " << norm2(stout_smeared - s_state->getLinks()[
mu]) << std::endl;
206 QDPIO::cout <<
"RG: NOnStateStoutSmeared -StateStoutSmeared: " <<norm2( rg_stout_smeared - s_state2->getLinks()[
mu]) << std::endl;
216 multi1d<LatticeColorMatrix> X(
Nd);
223 multi1d<LatticeColorMatrix> F1(
Nd),F2(
Nd);
233 QDPIO::cout <<
"tr(RG F - F) = "<< norm2(trace(F2[
mu]-F1[
mu])) << std::endl;
237 QDPIO::cout <<
"RG F - gtrans(F) = "<< norm2(F2[
mu]-g*F1[
mu]*adj(g)) << std::endl;
243 multi1d<LatticeColorMatrix> fat_force1(
Nd);
244 multi1d<LatticeColorMatrix> fat_force2(
Nd);
257 Real
RsdCG=Real(1.0e-7);
271 LatticeFermion phi2 = g*
phi;
280 multi1d<LatticeColorMatrix>&
l = fat_force;
281 multi1d<LatticeColorMatrix>& l2 = fat_force2;
283 LatticeColorMatrix tmp_m = s_state2->getLinks()[
mu]*l2[
mu];
284 LatticeColorMatrix tmp_m2 = s_state->getLinks()[
mu]*
l[
mu];
289 LatticeColorMatrix diff_mat = adj(g)*tmp_m2*shift(g,
FORWARD,
mu) - tmp_m;
291 QDPIO::cout <<
"Diff ["<<
mu<<
"] = " << norm2(diff_mat) << std::endl;
297 QDPIO::cout <<
"Force norms before derivative with respect to thin links" << std::endl;
298 QDPIO::cout <<
"========================================================" << std::endl << std::endl;
303 push(xml,
"ForcesCheck");
305 F_norm = norm2(fat_force1);
306 QDPIO::cout <<
"F_norm for fat force is " << F_norm << std::endl;
307 write(xml,
"forceNormPreGaugeDeriv", F_norm);
309 F_norm = norm2(fat_force2);
310 QDPIO::cout <<
"F_norm for RG transformed fat_force is " << F_norm << std::endl;
311 write(xml,
"forceNormPreGaugeDerivGt", F_norm);
315 (*s_state).deriv(fat_force);
316 (*s_state2).deriv(fat_force2);
318 QDPIO::cout << std::endl << std::endl;
319 QDPIO::cout <<
"Force norms after derivative with respect to thin links" << std::endl;
320 QDPIO::cout <<
"========================================================" << std::endl << std::endl;
323 F_norm = norm2(fat_force1);
324 QDPIO::cout <<
"F_norm for fat force is " << F_norm << std::endl;
325 write(xml,
"ForceNormPostGaugeDeriv", F_norm);
327 F_norm = norm2(fat_force2);
328 QDPIO::cout <<
"F_norm for RG transformed fat_force is " << F_norm << std::endl;
329 write(xml,
"ForceNormPostGaugeDerivGt", F_norm);
331 multi1d<LatticeColorMatrix> force_diff(
Nd);
335 force_diff[
mu] = fat_force1[
mu] - adj(g)*fat_force2[
mu]*g;
336 F_norm = sqrt(norm2(force_diff[
mu]));
337 QDPIO::cout <<
"|| force - RG force in dir "<<
mu <<
" ||= "<< F_norm << std::endl;
338 std::ostringstream tagname;
339 tagname <<
"force_diff_norm_" <<
mu;
340 write(xml, tagname.str(), F_norm);
344 F_norm = sqrt(norm2(force_diff));
345 QDPIO::cout <<
"Total difference between original and gauge transformed force: " << F_norm << std::endl;
346 push(xml,
"ForceDiffNorm");
347 write(xml,
"totalForceDiffNorm", F_norm);
Primary include file for CHROMA in application codes.
Class for counted reference semantics.
Concrete class for all fermionic actions with trivial boundary conditions.
Unpreconditioned Wilson-Dirac operator.
void deriv(multi1d< LatticeColorMatrix > &ds_u, const LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Derivative of unpreconditioned Wilson dM/dU.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams ¶m)
Writer parameters.
void rgauge(multi1d< LatticeColorMatrix > &u, LatticeColorMatrix &g)
Do a random gauge transformation on the u fields.
void getFsAndBs(const LatticeColorMatrix &Q, const LatticeColorMatrix &QQ, multi1d< LatticeComplex > &f, multi1d< LatticeComplex > &b1, multi1d< LatticeComplex > &b2, bool dobs)
Given c0 and c1 compute the f-s and b-s.
void getQsandCs(const multi1d< LatticeColorMatrix > &u, LatticeColorMatrix &Q, LatticeColorMatrix &QQ, LatticeColorMatrix &C, int mu, const multi1d< bool > &smear_in_this_dirP, const multi2d< Real > &rho)
Given field U, construct the staples into C, form Q and Q^2 and compute c0 and c1.
void stout_smear(LatticeColorMatrix &next, const multi1d< LatticeColorMatrix > ¤t, int mu, const multi1d< bool > &smear_in_this_dirP, const multi2d< Real > &rho)
Stout smear in a specific link direction.
void gaugeStartup(XMLReader &gauge_file_xml, XMLReader &gauge_xml, multi1d< LatticeColorMatrix > &u, Cfg_t &cfg)
Initialize the gauge fields.
Conjugate-Gradient algorithm for a generic Linear Operator.
Asqtad Staggered-Dirac operator.
std::string getXMLOutputFileName()
Get output file name.
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > const multi1d< Real > enum InvType invType const multi1d< Real > & RsdCG
static multi1d< LatticeColorMatrix > u
LinOpSysSolverMGProtoClover::Q Q
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > const multi1d< Real > & Mass
push(xml_out,"Condensates")
LinOpSysSolverMGProtoClover::T T
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > const multi1d< Real > enum InvType invType const multi1d< Real > int MaxCG
void initialize(int *argc, char ***argv)
Chroma initialisation routine.
void finalize(void)
Chroma finalization routine.
void reunit(LatticeColorMatrixF3 &xa)
void MesPlq(const multi1d< LatticeColorMatrixF3 > &u, multi2d< Double > &plane_plaq, Double &link)
FloatingPoint< double > Double
Stout field state for stout links and a creator.
Gauge configuration structure.
multi1d< bool > smear_in_this_dirP
int main(int argc, char *argv[])
multi1d< LatticeColorMatrix > P