CHROMA
vector_quark_smearing.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Vector Smearing: Use an outerproduct of vectors as the
4  * smearing scheme.
5  */
6 
7 #ifndef __vector_smearing_h__
8 #define __vector_smearing_h__
9 
13 
14 namespace Chroma
15 {
16 
17  //! Name and registration
18  namespace VectorQuarkSmearingEnv
19  {
20  bool registerAll();
21 
22  //! Return the name
24 
25  //! Params for Vector Smearing
26  /*! @ingroup smear */
27  struct Params
28  {
29  Params() {}
30  Params(XMLReader& in, const std::string& path);
31  void writeXML(XMLWriter& in, const std::string& path) const;
32 
34  Real sigma; /*!< exponential smearing wieght */
35  int no_smear_dir; /*!< don't allow smearing in this direction */
36  };
37 
38 
39  //! Vector smearing
40  /*! @ingroup smear
41  *
42  * std::vector quark smearing object
43  */
44  template<typename T>
45  class QuarkSmear : public QuarkSmearing<T>
46  {
47  public:
48  //! Full constructor
49  QuarkSmear(const Params& p) : params(p)
50  {
51  try{
53  }
54  catch(std::string & e)
55  {
56  QDPIO::cerr << " Caught Exception reading vecs: " << e << std::endl;
57  QDP_abort(1);
58  }
59  }
60 
61  //! Smear the quark
62  void operator()(T& quark, const multi1d<LatticeColorMatrix>& u) const;
63 
64  private:
65  //! Hide partial constructor
67 
68  private:
69  Params params; /*!< smearing params */
71  };
72 
73  } // end namespace
74 
75 
76  //! Reader
77  /*! @ingroup smear */
78  void read(XMLReader& xml, const std::string& path, VectorQuarkSmearingEnv::Params& param);
79 
80  //! Writer
81  /*! @ingroup smear */
82  void write(XMLWriter& xml, const std::string& path, const VectorQuarkSmearingEnv::Params& param);
83 
84 } // end namespace Chroma
85 
86 
87 #endif
Class for counted reference semantics.
Definition: handle.h:33
Base class for quark smearing.
static T & Instance()
Definition: singleton.h:432
QuarkSmear(const Params &p)
Full constructor.
void operator()(T &quark, const multi1d< LatticeColorMatrix > &u) const
Smear the quark.
Handle< MapObject< int, EVPair< LatticeColorVector > > > vecs
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams &param)
Read parameters.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
Named object function std::map.
bool registerAll()
Register all the factories.
std::string getName()
Return the name.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
static multi1d< LatticeColorMatrix > u
LinOpSysSolverMGProtoClover::T T
static QDP_ColorVector * in
::std::string string
Definition: gtest.h:1979
Quark smearing.
void writeXML(XMLWriter &in, const std::string &path) const
Parameters for running code.
Holds of vectors and weights.