aniso_sym_shared_functions.cc

Go to the documentation of this file.
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           // |               U^+(x+nu, mu) U^+(x,nu)
00035           // V           
00036           // |
00037           // x
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           //       V
00052           //       |
00053           //  --<--
00054           LatticeColorMatrix right_staple = adj(t_3)*adj(u[mu]);
00055 
00056           if( nu > mu ) {
00057             //  --<--
00058             // |      |
00059             // V      ^
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           // V
00070           // | 
00071           //  -->--          U^+(x+nu, mu) U^+(x,nu) U(x,mu)
00072           // x
00073           t_2 = t_1 * u[mu];
00074 
00075           //  --<--
00076           // |
00077           // V              U^+(x-mu+nu, mu) U^+(x-mu,nu) U(x-mu,mu)
00078           // |              
00079           //  -->--
00080           //      x
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             //  ^     V
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           // ------------- Plaquette done here, now rectangle ----
00109           
00110           // If mu is temporal then we are computing contributions from 
00111           // rectangles with time extent = 2,  both to ds_u[mu] and ds_u[nu].
00112           // 
00113           // If contribs from such rectangles are unrequired, then set 
00114           // the appropriate coefficient to zero, and/or set noTemporal2Link
00115           // or do both
00116           bool skip = ( mu == t_dir && noTemporal2Link );
00117 
00118           if( !skip) { 
00119 
00120 
00121           //        --<--
00122           //        |          
00123           //        V            U^+(x-mu+nu, mu) U^+(x-mu,nu) U(x-mu,mu) U(x,mu)
00124           //        |               
00125           //        -->-- -->--
00126           //             x
00127           t_1 = left_staple * u[mu];
00128         
00129           //        --<-- --<--
00130           //        |            
00131           //        V           U^+(x+nu, mu) U^+(x-mu+nu, mu) U^+(x-mu,nu) U(x-mu,mu) U(x,mu)
00132           //        |
00133           //        -->-- -->--
00134           //             x
00135 
00136           t_2= adj(u_mu_xplusnu)*t_1;
00137 
00138           //        --<-- --<--
00139           //        |             
00140           //        V           U^+(x-mu+nu, mu) U^+(x-2mu+nu, mu) U^+(x-2mu,nu) U(x-2mu,mu) U(x-mu,mu)
00141           //        |
00142           //        -->-- -->--
00143           //                    x
00144 
00145 
00146           //=U^dag(x+-mu+nu, mu)*U^dag(x-2mu+nu, mu)*U^dag(x-2mu, nu)*U(x-2mu,mu)*U(x-mu,mu)      
00147 
00148           ds_rect_nu = shift(t_2, BACKWARD, mu);          
00149           
00150 
00151 
00152 
00153           
00154 
00155 
00156           
00157           //        -->--  
00158           //             |
00159           //             V   U(x+mu+nu, mu) U^+(x+2mu, nu) U^+(x+mu,mu)
00160           //             |
00161           // x      --<--
00162           LatticeColorMatrix shift_right_staple = shift(right_staple, FORWARD, mu);
00163 
00164           
00165 
00166           // -->--  -->--  
00167           //             |
00168           //             V   U(x+nu, mu)U(x+mu+nu, mu) U^+(x+2mu, nu) U^+(x+mu,mu)
00169           //             |
00170           // x      --<--
00171           t_2 = u_mu_xplusnu*shift_right_staple;
00172 
00173           // -->--  -->--  
00174           //             |
00175           //             V   U(x+nu, mu)U(x+mu+nu, mu) U^+(x+2mu, nu) U^+(x+mu,mu) U^(x,mu)
00176           //             |
00177           // --<--  --<--
00178           // x
00179           
00180           // = u(x+nu, mu)*u(x+mu+nu, mu)*u^dag(x+2mu, nu)*u^dag(x+mu, mu)*u^dag(x,mu)
00181           
00182           ds_rect_nu += t_2*adj(u[mu]);
00183           
00184 
00185           
00186           
00187           
00188 
00189 
00190             //     --<-- --<--
00191             //    |           |
00192             //    V           ^
00193             //    |           |
00194             //           -->--
00195             //    x 
00196   
00197 
00198             ds_rect_mu = adj(t_2)*adj(u[nu]);
00199 
00200           
00201           
00202             //     --<-- --<--
00203             //    |           |
00204             //    V           ^
00205             //    |           |
00206             //     -->--     
00207             //         x 
00208             
00209             ds_rect_mu += t_3*left_staple;
00210 
00211             //
00212             //           -->--
00213             //    |           |
00214             //    ^           V
00215             //    |           |
00216             //    --<--  --<--
00217             //    x 
00218             
00219             t_2 = shift_right_staple*l_left_corner;
00220 
00221 
00222             //    
00223             //         |
00224             //         V
00225             //         |
00226             //    --<-- 
00227             //    x 
00228             
00229             t_1 = adj(u_nu_xplusmu)*adj(u[mu]);
00230 
00231          
00232             //    -->--
00233             //    |          |
00234             //    ^          V
00235             //    |          |
00236             //    --<--  --<-- 
00237             //         x 
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     // S_part
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       // lr_corner =         |   = u(x, mu) * u(x + mu, nu)
00278       //                     |
00279       //                ----->
00280       //
00281       LatticeColorMatrix lr_corner = u[mu]*u_nu_xplus_mu;
00282       
00283       //              <----
00284       //                   ^
00285       // right_staple =    | = u(x, mu) * u(x + mu, nu) * u^{+}(x+nu,mu)
00286       //                   |
00287       //              ----->
00288       //
00289       
00290       LatticeColorMatrix right_staple = lr_corner*adj(u_mu_xplus_nu);
00291       
00292       {
00293         //              <----
00294         //            |      ^
00295         // plaq     = |      | = u(x, mu) * u(x + mu, nu) * u^{+}(x+nu,mu)
00296         //            V      |    *u^{+}(x,nu)
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       // End of Plaquette bit...
00307       bool skip = ( noTemporal2Link && (t_dir == mu) );
00308       if( ! skip ) {
00309         //            <----  <----^
00310         // Make:                  |
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         //   Loop 
00328         //        =  u(x, mu) u(x + mu, mu) * u(x + 2mu, nu)
00329         //         * u^dag(x + mu + nu, mu) * u^dag(x + nu, mu) * u^dag(nu)
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 }

Generated on Sun Nov 22 04:28:48 2009 for CHROMA by  doxygen 1.4.7