aniso_spectrum_gaugeact.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 // $Id: aniso_spectrum_gaugeact.h,v 1.6 2007/02/22 21:11:48 bjoo Exp $
00003 /*! \file
00004  *  \brief Anisotropic gaugeact useful for spectrum from hep-lat/9911003
00005  *
00006  *  Tree-level LW with tapole improvement, missing 1x2 in time, also including
00007  *  2-plaq term. Taken from Morningstar-Peardon, hep-lat/9911003
00008  */
00009 
00010 #ifndef __aniso_spectrum_gaugeact_h__
00011 #define __aniso_spectrum_gaugeact_h__
00012 
00013 #include "gaugeact.h"
00014 #include "gaugebc.h"
00015 // #include "actions/gauge/gaugeacts/plaq_gaugeact.h"
00016 #include "actions/gauge/gaugeacts/rect_gaugeact.h"
00017 #include "actions/gauge/gaugeacts/plaq_plus_spatial_two_plaq_gaugeact.h"
00018 
00019 
00020 namespace Chroma
00021 {
00022 
00023   /*! @ingroup gaugeacts */
00024   namespace AnisoSpectrumGaugeActEnv 
00025   {
00026     extern const string name;
00027     bool registerAll();
00028   }
00029 
00030   //! Parameter structure
00031   /*! @ingroup gaugeacts */
00032   struct AnisoSpectrumGaugeActParams 
00033   {
00034     // Base Constructor
00035     AnisoSpectrumGaugeActParams() {};
00036     
00037     // Read params from some root path
00038     AnisoSpectrumGaugeActParams(XMLReader& xml_in, const std::string& path);
00039 
00040     Real beta;  
00041     Real u_s;
00042     Real u_t;
00043     Real omega;
00044     AnisoParam_t aniso;
00045   };
00046   
00047   /*! @ingroup gaugeacts */
00048   void read(XMLReader& xml, const string& path, AnisoSpectrumGaugeActParams& param);
00049   
00050   /*! @ingroup gaugeacts */
00051   void write(XMLWriter& xml, const string& path, const AnisoSpectrumGaugeActParams& param);
00052   
00053 
00054   //! MP gauge action
00055   /*! \ingroup gaugeacts
00056    *
00057    *  Anisotropic gaugeact useful for spectrum from hep-lat/9911003
00058    *
00059    *  Tree-level LW with tapole improvement, missing 1x2 in time, also including
00060    *  2-plaq term. Taken from Morningstar-Peardon, hep-lat/9911003
00061    */
00062 
00063   class AnisoSpectrumGaugeAct : public LinearGaugeAction
00064   {
00065   public:
00066     // Typedefs to save typing
00067     typedef multi1d<LatticeColorMatrix>  P;
00068     typedef multi1d<LatticeColorMatrix>  Q;
00069 
00070     //! Read beta from a param struct
00071     AnisoSpectrumGaugeAct(Handle< CreateGaugeState<P,Q> > cgs_, 
00072                           const AnisoSpectrumGaugeActParams& p) :
00073       param(p) {init(cgs_);}
00074 
00075     //! Is anisotropy used?
00076     bool anisoP() const {return param.aniso.anisoP; }
00077 
00078     //! Anisotropy factor
00079     const Real anisoFactor() const {return param.aniso.xi_0;}
00080 
00081     //! Anisotropic direction
00082     int tDir() const {return param.aniso.t_dir;}
00083 
00084     //! Return the set on which the gauge action is defined
00085     /*! Defined on the even-off (red/black) set */
00086     const Set& getSet() const {return rb;}
00087 
00088     //! Compute staple
00089     /*! Default version. Derived class should override this if needed. */
00090     void staple(LatticeColorMatrix& result,
00091                 const Handle< GaugeState<P,Q> >& state,
00092                 int mu, int cb) const
00093       {
00094         // plaq->staple(result,state,mu,cb);
00095         plaq_plus_two_plaq->staple(result,state,mu,cb); // This will fail I think
00096         LatticeColorMatrix tmp;
00097         rect->staple(tmp,state,mu,cb);     // This may fail I think in aniso mode
00098         result += tmp;
00099       }
00100 
00101     //! Compute dS/dU
00102     void deriv(multi1d<LatticeColorMatrix>& result,
00103                const Handle< GaugeState<P,Q> >& state) const
00104       {
00105         // plaq->deriv(result,state);
00106         plaq_plus_two_plaq->deriv(result,state);
00107         
00108         multi1d<LatticeColorMatrix> tmp;
00109         rect->deriv(tmp,state);
00110         result += tmp;
00111 
00112         
00113 
00114       }
00115 
00116     //! Compute the actions
00117     Double S(const Handle< GaugeState<P,Q> >& state) const
00118       {
00119         //return plaq->S(state) + rect->S(state) + two_plaq->S(state);
00120         return plaq_plus_two_plaq->S(state) + rect->S(state);
00121 
00122       }
00123 
00124     //! Produce a gauge create state object
00125     const CreateGaugeState<P,Q>& getCreateState() const {return plaq_plus_two_plaq->getCreateState();}
00126 
00127     //! Destructor is automatic
00128     ~AnisoSpectrumGaugeAct() {}
00129 
00130     // Accessors -- non mutable members.
00131     const Real getBeta(void) const { return param.beta; }
00132     
00133     const Real getUS(void) const { return param.u_s; }
00134     
00135     const Real getUT(void) const { return param.u_t; }
00136 
00137     const Real getOmega(void) const { return param.omega; }
00138 
00139 
00140   protected:
00141     //! Private initializer
00142     void init(Handle< CreateGaugeState<P,Q> > cgs);
00143 
00144     //! Hide assignment
00145     void operator=(const AnisoSpectrumGaugeAct& a) {}
00146 
00147   private:
00148     AnisoSpectrumGaugeActParams    param;    /*!< The couplings and anisotropy*/
00149     //    Handle<PlaqGaugeAct>           plaq;     /*!< Hold a plaquette gaugeact */
00150     Handle<RectGaugeAct>           rect;     /*!< Hold a rectangle gaugeact */
00151     Handle<PlaqPlusSpatialTwoPlaqGaugeAct> plaq_plus_two_plaq; /*!< Hold spatial plaquettes separated in time type gaugeact */
00152   };
00153 
00154 };
00155 
00156 
00157 #endif

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