aniso_sym_temporal_gaugeact.cc

Go to the documentation of this file.
00001 // $Id: aniso_sym_temporal_gaugeact.cc,v 3.3 2008/05/21 17:07:50 bjoo Exp $
00002 /*! \file
00003  *  \brief  Temporal part of Anisotropic Tree leve LW gauge action
00004  */
00005 
00006 #include "chromabase.h"
00007 #include "actions/gauge/gaugeacts/aniso_sym_temporal_gaugeact.h"
00008 #include "actions/gauge/gaugeacts/gaugeact_factory.h"
00009 #include "actions/gauge/gaugestates/gauge_createstate_aggregate.h"
00010 
00011 #include  "actions/gauge/gaugeacts/aniso_sym_shared_functions.h"
00012 namespace Chroma
00013 {
00014  
00015   namespace AnisoSymTemporalGaugeActEnv 
00016   { 
00017     GaugeAction< multi1d<LatticeColorMatrix>, 
00018                  multi1d<LatticeColorMatrix> >* createGaugeAct(XMLReader& xml, 
00019                                                                const std::string& path) 
00020     {
00021       return new AnisoSymTemporalGaugeAct(CreateGaugeStateEnv::reader(xml, path), 
00022                                        AnisoSymGaugeActParams(xml, path));
00023     }
00024 
00025     const std::string name = "ANISO_SYM_TEMPORAL_GAUGEACT";
00026 
00027     //! Local registration flag
00028     static bool registered = false;
00029 
00030     //! Register all the factories
00031     bool registerAll() 
00032     {
00033       bool success = true; 
00034       if (! registered)
00035       {
00036         success &= TheGaugeActFactory::Instance().registerObject(name, createGaugeAct);
00037         registered = true;
00038       }
00039       return success;
00040     }
00041 
00042   }
00043 
00044 
00045   //! Compute action due to temporal \mu x 2\nu rectangles and plaquettes
00046   Double AnisoSymTemporalGaugeAct::S(const Handle< GaugeState<P,Q> >& state) const
00047   {
00048     START_CODE();
00049 
00050     const multi1d<LatticeColorMatrix>& u_bc = state->getLinks();
00051 
00052     LatticeReal lgimp = zero;
00053     
00054     int mu; 
00055     int nu;
00056 
00057     // length 1 in the t_dir (nu = t_dir) 
00058     nu = param.aniso.t_dir;
00059     for(mu=0; mu < Nd; mu++) { 
00060       if( mu != nu ) { 
00061         AnisoSym::S_part(mu, 
00062                          nu, 
00063                          param.aniso.t_dir,
00064                          plaq_c_t, 
00065                          rect_c_t_2, 
00066                          true,
00067                          lgimp,
00068                          u_bc);
00069       }
00070     }
00071 
00072     // length 2 in the t_dir (mu = t_dir) 
00073     // No rectangle contribution but still some plaquette
00074     // It is OK to conitnue to accumulate into lgimp
00075     // At this point the unwanted rectangles will be skipped
00076     mu = param.aniso.t_dir;
00077     for(int nu=0; nu < Nd; nu++) { 
00078       if( mu != nu ) { 
00079         AnisoSym::S_part(mu, 
00080                          nu, 
00081                          param.aniso.t_dir,
00082                          plaq_c_t, 
00083                          rect_c_t_2, 
00084                          true,
00085                          lgimp,
00086                          u_bc);
00087       }
00088     }
00089 
00090 
00091     // If user gave a zero point energy, subtract it off
00092     if( param.use_subtraction  ) { 
00093       LatticeReal ff;
00094       ff = param.sub_zero;
00095       lgimp -= ff;
00096     }
00097 
00098     Double ret_val = sum(lgimp);
00099     
00100     // Multiply in normalisation
00101     ret_val *= -Double(1)/Double(Nc);
00102     
00103     END_CODE();
00104 
00105     return ret_val;
00106   }
00107 
00108   //! Compute dS/dU
00109   void AnisoSymTemporalGaugeAct::deriv(multi1d<LatticeColorMatrix>& result,
00110                                        const Handle< GaugeState<P,Q> >& state) const
00111   {
00112     result.resize(Nd);
00113     int mu;
00114     int nu;
00115 
00116     multi1d<LatticeColorMatrix> ds_tmp(Nd);
00117 
00118 
00119     const multi1d<LatticeColorMatrix>& u_bc = state->getLinks();
00120     
00121     for(mu=0; mu < Nd; mu++) { 
00122       result[mu] =zero;
00123       ds_tmp[mu]= zero;
00124     }
00125 
00126     // length 1 in the t_dir (nu = t_dir) 
00127     // Accumulate into ds_tmp
00128     nu = param.aniso.t_dir;
00129     for(mu=0; mu < Nd; mu++) { 
00130       if( mu != nu ) { 
00131         AnisoSym::deriv_part(mu, 
00132                              nu, 
00133                              param.aniso.t_dir,
00134                              plaq_c_t, 
00135                              rect_c_t_2, 
00136                              true,
00137                              ds_tmp,
00138                              u_bc);
00139 
00140       }
00141     }
00142 
00143 
00144     // length 2 in the t_dir (mu = t_dir)
00145     // Accumulate into ds_tmp
00146 
00147     mu = param.aniso.t_dir;
00148     for(int nu=0; nu < Nd; nu++) { 
00149       if( mu != nu ) { 
00150         AnisoSym::deriv_part(mu, 
00151                              nu, 
00152                              param.aniso.t_dir,
00153                              plaq_c_t, 
00154                              rect_c_t_2, 
00155                              true,
00156                              ds_tmp,
00157                              u_bc);
00158 
00159       }
00160     }     
00161 
00162     // Close up the loops
00163     for(int mu=0; mu < Nd; mu++) { 
00164       result[mu] = u_bc[mu]*ds_tmp[mu];
00165     }
00166 
00167     // Apply BCs
00168     getGaugeBC().zero(result);
00169       
00170     END_CODE();
00171 
00172   }
00173 
00174   // Private initializer
00175   void
00176   AnisoSymTemporalGaugeAct::init(void)
00177   {
00178     START_CODE();
00179 
00180     // Do the plaquette first. Spatial and temporal coeffs
00181     // anisotropy multiplied in in the terms constructor
00182 
00183     // Various tadpole things
00184     // spatial powers
00185     Real u_s_2 = param.u_s * param.u_s;
00186     Real u_s_4 = u_s_2 * u_s_2;
00187 
00188     // temporal powers
00189     Real u_t_2 = param.u_t * param.u_t;
00190 
00191     // Parameter needed for gauge act, but should never be used
00192     plaq_c_t = param.beta * Real(4) / ( Real(3) * u_s_2 * u_t_2 );
00193    
00194     // Loops that are short in the time direction
00195     // Param needed for rect_gaugeact driver, but never used
00196     rect_c_t_2 = - param.beta / ( Real(12)*u_s_4*u_t_2);
00197 
00198     // Fold in aniso factors
00199     if( param.aniso.anisoP ) { 
00200       plaq_c_t *= param.aniso.xi_0;
00201       rect_c_t_2 *= param.aniso.xi_0;
00202     }
00203 
00204     QDPIO::cout << "Real(Nc)*(u_s_2*u_t_2+u_s_4*u_t_2)="<<Real(Nc)*( Real(3)*u_s_2*u_t_2/Real(4)-Real(12)*u_s_4*u_t_2)/param.beta << endl;
00205     END_CODE();
00206   } 
00207 
00208 }
00209 

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