00001 #include "actions/gauge/gaugeacts/aniso_sym_shared_functions.h"
00002
00003 namespace Chroma {
00004
00005 namespace AnisoSym {
00006
00007
00008 void deriv_part(const int mu,
00009 const int nu,
00010 const int t_dir,
00011 const Real& c_plaq_munu,
00012 const Real& c_rect_munu,
00013 const bool noTemporal2Link,
00014 multi1d<LatticeColorMatrix>& ds_u,
00015 const multi1d<LatticeColorMatrix>& u)
00016 {
00017
00018 START_CODE();
00019
00020
00021 LatticeColorMatrix ds_plaq_mu;
00022 LatticeColorMatrix ds_plaq_nu;
00023 LatticeColorMatrix ds_rect_mu;
00024 LatticeColorMatrix ds_rect_nu;
00025
00026
00027 LatticeColorMatrix u_mu_xplusnu = shift(u[mu], FORWARD, nu);
00028 LatticeColorMatrix u_nu_xplusmu = shift(u[nu], FORWARD, mu);
00029 LatticeColorMatrix t_1, t_2, t_3;
00030
00031
00032
00033
00034
00035
00036
00037
00038 t_1 = adj(u_mu_xplusnu)*adj(u[nu]);
00039
00040
00041
00042
00043
00044
00045 t_3 = u_nu_xplusmu*adj(u_mu_xplusnu);
00046
00047
00048
00049
00050
00051
00052
00053
00054 LatticeColorMatrix right_staple = adj(t_3)*adj(u[mu]);
00055
00056 if( nu > mu ) {
00057
00058
00059
00060
00061
00062 LatticeColorMatrix up_staple = u_nu_xplusmu*t_1;
00063
00064 ds_plaq_mu = up_staple;
00065 ds_plaq_nu = right_staple;
00066 }
00067
00068
00069
00070
00071
00072
00073 t_2 = t_1 * u[mu];
00074
00075
00076
00077
00078
00079
00080
00081 LatticeColorMatrix left_staple = shift(t_2, BACKWARD, mu);
00082 if( nu > mu ) {
00083 ds_plaq_nu += left_staple;
00084 }
00085
00086
00087
00088
00089
00090
00091 LatticeColorMatrix l_left_corner = adj(u[mu])*u[nu];
00092
00093 if( nu > mu ) {
00094
00095
00096
00097
00098
00099 t_2 = adj(u_nu_xplusmu)*l_left_corner;
00100 t_1 = shift(t_2, BACKWARD, nu);
00101 ds_plaq_mu += t_1;
00102
00103 Real c = c_plaq_munu/Real(-2*Nc);
00104 ds_u[mu] += c*ds_plaq_mu;
00105
00106 ds_u[nu] += c*ds_plaq_nu;
00107 }
00108
00109
00110
00111
00112
00113
00114
00115
00116 bool skip = ( mu == t_dir && noTemporal2Link );
00117
00118 if( !skip) {
00119
00120
00121
00122
00123
00124
00125
00126
00127 t_1 = left_staple * u[mu];
00128
00129
00130
00131
00132
00133
00134
00135
00136 t_2= adj(u_mu_xplusnu)*t_1;
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148 ds_rect_nu = shift(t_2, BACKWARD, mu);
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162 LatticeColorMatrix shift_right_staple = shift(right_staple, FORWARD, mu);
00163
00164
00165
00166
00167
00168
00169
00170
00171 t_2 = u_mu_xplusnu*shift_right_staple;
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182 ds_rect_nu += t_2*adj(u[mu]);
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198 ds_rect_mu = adj(t_2)*adj(u[nu]);
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209 ds_rect_mu += t_3*left_staple;
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219 t_2 = shift_right_staple*l_left_corner;
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229 t_1 = adj(u_nu_xplusmu)*adj(u[mu]);
00230
00231
00232
00233
00234
00235
00236
00237
00238 t_3 = t_1*adj(left_staple);
00239 t_2 += t_3;
00240
00241 ds_rect_mu += shift(t_2, BACKWARD, nu);
00242 Real c = c_rect_munu/Real(-2*Nc);
00243
00244 ds_u[mu] += c * ds_rect_mu;
00245 ds_u[nu] += c * ds_rect_nu;
00246 }
00247
00248
00249
00250 END_CODE();
00251
00252 return;
00253
00254 }
00255
00256
00257
00258 void S_part(int mu, int nu, int t_dir,
00259 Real c_plaq_munu,
00260 Real c_rect_munu,
00261 bool noTemporal2Link,
00262 LatticeReal& lgimp,
00263 const multi1d<LatticeColorMatrix>& u)
00264 {
00265 START_CODE();
00266
00267 LatticeColorMatrix tmp1;
00268 LatticeColorMatrix tmp2;
00269
00270 LatticeColorMatrix rectangle_2munu;
00271 LatticeColorMatrix rectangle_mu2nu;
00272
00273 LatticeColorMatrix u_nu_xplus_mu = shift(u[nu], FORWARD, mu);
00274 LatticeColorMatrix u_mu_xplus_nu = shift(u[mu], FORWARD, nu);
00275
00276
00277
00278
00279
00280
00281 LatticeColorMatrix lr_corner = u[mu]*u_nu_xplus_mu;
00282
00283
00284
00285
00286
00287
00288
00289
00290 LatticeColorMatrix right_staple = lr_corner*adj(u_mu_xplus_nu);
00291
00292 {
00293
00294
00295
00296
00297
00298
00299 if( nu > mu) {
00300 tmp1 = right_staple*adj(u[nu]);
00301 lgimp += c_plaq_munu*real(trace(tmp1));
00302 }
00303
00304 }
00305
00306
00307 bool skip = ( noTemporal2Link && (t_dir == mu) );
00308 if( ! skip ) {
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318 tmp1 = shift(right_staple, FORWARD, mu);
00319 tmp2 = u[mu]*tmp1;
00320
00321
00322
00323
00324
00325 right_staple = tmp2*adj(u_mu_xplus_nu);
00326
00327
00328
00329
00330 rectangle_2munu = right_staple*adj(u[nu]);
00331
00332
00333 lgimp += c_rect_munu * real(trace(rectangle_2munu));
00334 }
00335
00336 END_CODE();
00337 }
00338
00339
00340 }
00341
00342 }