CHROMA
gamma_displacement_w.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Gamma insertions
4  */
5 
6 #ifndef __gamma_displacement_w_h__
7 #define __gamma_displacement_w_h__
8 
10 
11 namespace Chroma
12 {
13  //! Name and registration
14  /*! @ingroup smear */
15  namespace GammaDisplacementEnv
16  {
17  bool registerAll();
18 
19  //! Return the name
21 
22  //! Params for simple quark displacement
23  /*! @ingroup smear */
24  struct Params
25  {
26  Params() {}
27  Params(XMLReader& in, const std::string& path);
28  void writeXML(XMLWriter& in, const std::string& path) const;
29 
30  int gamma; /*!< gamma value of insertion */
31  };
32 
33 
34  //! Gamma insertion/displacement
35  /*! @ingroup smear
36  *
37  * Simple gamma multiplication of an object
38  */
39  template<typename T>
40  class QuarkDisplace : public QuarkDisplacement<T>
41  {
42  public:
43  //! Full constructor
44  QuarkDisplace(const Params& p) : params(p) {}
45 
46  //! Displace the quark
47  void operator()(T& quark,
48  const multi1d<LatticeColorMatrix>& u,
49  enum PlusMinus isign) const
50  {
51  T tmp = Gamma(params.gamma) * quark;
52  quark = tmp;
53  }
54 
55  private:
56  //! Hide partial constructor
58 
59  private:
60  Params params; /*!< displacement params */
61  };
62 
63  } // end namespace
64 
65  //! Reader
66  /*! @ingroup smear */
67  void read(XMLReader& xml, const std::string& path, GammaDisplacementEnv::Params& param);
68 
69  //! Writer
70  /*! @ingroup smear */
71  void write(XMLWriter& xml, const std::string& path, const GammaDisplacementEnv::Params& param);
72 
73 } // end namespace Chroma
74 
75 #endif
void operator()(T &quark, const multi1d< LatticeColorMatrix > &u, enum PlusMinus isign) const
Displace the quark.
QuarkDisplace(const Params &p)
Full constructor.
Base class for quark displacement.
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.
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
LatticeFermion tmp
Definition: mespbg5p_w.cc:36
LinOpSysSolverMGProtoClover::T T
static QDP_ColorVector * in
::std::string string
Definition: gtest.h:1979
Quark displacement.
Params for simple quark displacement.
void writeXML(XMLWriter &in, const std::string &path) const
Parameters for running code.