00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "chromabase.h"
00010 #include "actions/gauge/gaugeacts/aniso_sym_spatial_gaugeact.h"
00011 #include "actions/gauge/gaugeacts/gaugeact_factory.h"
00012 #include "actions/gauge/gaugestates/gauge_createstate_aggregate.h"
00013 #include "actions/gauge/gaugeacts/aniso_sym_shared_functions.h"
00014
00015 #include <cstdio>
00016 using namespace std;
00017
00018 namespace Chroma
00019 {
00020
00021 namespace AnisoSymSpatialGaugeActEnv
00022 {
00023 GaugeAction< multi1d<LatticeColorMatrix>,
00024 multi1d<LatticeColorMatrix> >* createGaugeAct(XMLReader& xml,
00025 const std::string& path)
00026 {
00027 return new AnisoSymSpatialGaugeAct(CreateGaugeStateEnv::reader(xml, path),
00028 AnisoSymSpatialGaugeActParams(xml, path));
00029 }
00030
00031 const std::string name = "ANISO_SYM_SPATIAL_GAUGEACT";
00032
00033
00034 static bool registered = false;
00035
00036
00037 bool registerAll()
00038 {
00039 bool success = true;
00040 if (! registered)
00041 {
00042 success &= TheGaugeActFactory::Instance().registerObject(name, createGaugeAct);
00043 registered = true;
00044 }
00045 return success;
00046 }
00047
00048 }
00049
00050 Double AnisoSymSpatialGaugeAct::S(const Handle< GaugeState<P,Q> >& state) const
00051 {
00052 START_CODE();
00053
00054 LatticeReal lgimp=zero;
00055 const multi1d<LatticeColorMatrix>& u_bc = state->getLinks();
00056
00057
00058 for(int mu = 0; mu < Nd; mu++) {
00059 for(int nu = 0 ; nu < Nd; nu++) {
00060 if ( ( mu != nu ) && (mu != param.aniso.t_dir)
00061 && ( nu != param.aniso.t_dir ) ) {
00062
00063 AnisoSym::S_part(mu,
00064 nu,
00065 param.aniso.t_dir,
00066 plaq_c_s,
00067 rect_c_s,
00068 true,
00069 lgimp,
00070 u_bc);
00071
00072 }
00073 }
00074 }
00075
00076
00077 if( param.use_subtraction ) {
00078 LatticeReal ff;
00079 ff = param.sub_zero;
00080 lgimp -= ff;
00081 }
00082
00083
00084 Double ret_val = sum(lgimp);
00085 ret_val *= -Double(1)/Double(Nc);
00086
00087 END_CODE();
00088
00089 return ret_val;
00090 }
00091
00092
00093
00094 void AnisoSymSpatialGaugeAct::deriv(multi1d<LatticeColorMatrix>& result,
00095 const Handle< GaugeState<P,Q> >& state) const
00096 {
00097 START_CODE();
00098
00099 const multi1d<LatticeColorMatrix>& u_bc = state->getLinks();
00100 multi1d<LatticeColorMatrix> ds_tmp(Nd);
00101 result.resize(Nd);
00102 for(int mu =0; mu < Nd; mu++) {
00103 result[mu] = zero;
00104 ds_tmp[mu] = zero;
00105 }
00106
00107
00108
00109
00110 for(int mu = 0; mu < Nd; mu++) {
00111 for(int nu = 0 ; nu < Nd; nu++) {
00112
00113
00114
00115 if( ( mu != nu ) && (mu != param.aniso.t_dir)
00116 && (nu != param.aniso.t_dir ) ) {
00117
00118
00119 AnisoSym::deriv_part(mu,
00120 nu,
00121 param.aniso.t_dir,
00122 plaq_c_s,
00123 rect_c_s,
00124 true,
00125 ds_tmp,
00126 u_bc);
00127
00128
00129
00130 }
00131 }
00132 }
00133
00134
00135 for(int mu=0 ; mu < Nd; mu++) {
00136 result[mu] = u_bc[mu]*ds_tmp[mu];
00137 }
00138
00139
00140 getGaugeBC().zero(result);
00141 END_CODE();
00142
00143 }
00144
00145
00146 void
00147 AnisoSymSpatialGaugeAct::init(void)
00148 {
00149 START_CODE();
00150
00151
00152
00153
00154
00155
00156 Real u_s_2 = param.u_s * param.u_s;
00157 Real u_s_4 = u_s_2 * u_s_2;
00158 Real u_s_6 = u_s_4 * u_s_2;
00159
00160
00161 plaq_c_s = param.beta * Real(5)/( Real(3)* u_s_4 );
00162 rect_c_s = - param.beta / ( Real(12)*u_s_6 );
00163
00164
00165 if ( param.aniso.anisoP == true ) {
00166 plaq_c_s /= param.aniso.xi_0;
00167 rect_c_s /= param.aniso.xi_0;
00168 }
00169
00170 END_CODE();
00171 }
00172
00173 }
00174