00001
00002
00003
00004
00005
00006 #include "chromabase.h"
00007 #include "meas/smear/ape_smear.h"
00008 #include "util/gauge/reunit.h"
00009 #include "util/gauge/su3proj.h"
00010 #include "util/gauge/shift2.h"
00011
00012 namespace Chroma
00013 {
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 void APE_Smear(const multi1d<LatticeColorMatrix>& u,
00045 LatticeColorMatrix& u_smear,
00046 int mu, int bl_level,
00047 const Real& sm_fact, const Real& BlkAccu,
00048 int BlkMax, int j_decay)
00049 {
00050 START_CODE();
00051
00052
00053 u_smear = u[mu] * sm_fact;
00054
00055
00056 for(int nu = 0; nu < Nd; ++nu)
00057 {
00058 if( nu != mu && nu != j_decay )
00059 {
00060
00061
00062 u_smear += u[nu] * shift2(u[mu], FORWARD, nu, bl_level)
00063 * adj(shift2(u[nu], FORWARD, mu, bl_level));
00064
00065
00066
00067 LatticeColorMatrix tmp_1 = adj(u[nu]) * u[mu] * shift2(u[nu], FORWARD, mu, bl_level);
00068
00069
00070 u_smear += shift2(tmp_1, BACKWARD, nu, bl_level);
00071 }
00072 }
00073
00074
00075
00076
00077
00078 LatticeColorMatrix u_unproj = adj(u_smear);
00079
00080 #if 0
00081
00082 reunit(u_smear);
00083 #else
00084
00085 u_smear = u[mu];
00086 #endif
00087
00088
00089 #if 0
00090
00091 if (SchrFun > 0)
00092 {
00093
00094 copymask(u_smear, lSFmask[mu], LatticeReal(1));
00095 copymask(u_unproj, lSFmask[mu], LatticeReal(1));
00096 }
00097 #endif
00098
00099
00100 Double old_tr = sum(real(trace(u_smear * u_unproj))) / toDouble(Layout::vol()*Nc);
00101 Double new_tr;
00102
00103 int n_smr = 0;
00104 bool wrswitch = false;
00105 Double conver = 1;
00106
00107 while ( toBool(conver > BlkAccu) && n_smr < BlkMax )
00108 {
00109 ++n_smr;
00110
00111
00112 for(int su2_index = 0; su2_index < Nc*(Nc-1)/2; ++su2_index)
00113 su3proj(u_smear, u_unproj, su2_index);
00114
00115
00116 reunit(u_smear);
00117
00118
00119 new_tr = sum(real(trace(u_smear * u_unproj))) / toDouble(Layout::vol()*Nc);
00120
00121 if( wrswitch )
00122 QDPIO::cout << " BLOCK: " << n_smr << " old_tr= " << old_tr << " new_tr= " << new_tr;
00123
00124
00125 conver = fabs((new_tr - old_tr) / old_tr);
00126 old_tr = new_tr;
00127 }
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139 #if 0
00140
00141 if (SchrFun > 0)
00142 {
00143
00144 copymask(u_smear, lSFmask[mu], SFBndFld[mu]);
00145 }
00146 #endif
00147
00148 END_CODE();
00149 }
00150
00151 }