CHROMA
simple_spin_insertion_w.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Gamma insertions
4  */
5 
6 #ifndef __simple_gamma_insertion_w_h__
7 #define __simple_gamma_insertion_w_h__
8 
10 
11 namespace Chroma
12 {
13  //! Name and registration
14  /*! @ingroup hadron */
15  namespace SimpleSpinInsertionEnv
16  {
17  extern const std::string name;
18  bool registerAll();
19 
20 
21  //! Params for simple spin insertion
22  /*! @ingroup hadron */
23  struct Params
24  {
25  Params() {}
26  Params(XMLReader& in, const std::string& path);
27  void writeXML(XMLWriter& in, const std::string& path) const;
28 
29  int gamma; /*!< gamma value of insertion */
30  };
31 
32 
33  //! Gamma insertion
34  /*! @ingroup hadron
35  *
36  * Simple gamma multiplication of an object
37  */
38  template<typename T>
39  class LeftSpinInsert : public SpinInsertion<T>
40  {
41  public:
42  //! Full constructor
43  LeftSpinInsert(const Params& p) : params(p) {}
44 
45  //! Spin insert
46  T operator()(const T& quark) const {return Gamma(params.gamma) * quark;}
47 
48  private:
49  //! Hide partial constructor
51 
52  private:
53  Params params; /*!< spin insertion params */
54  };
55 
56 
57  //! Gamma insertion
58  /*! @ingroup hadron
59  *
60  * Simple gamma multiplication of an object
61  */
62  template<typename T>
63  class RightSpinInsert : public SpinInsertion<T>
64  {
65  public:
66  //! Full constructor
68 
69  //! Spin insert
70  T operator()(const T& quark) const {return quark * Gamma(params.gamma);}
71 
72  private:
73  //! Hide partial constructor
75 
76  private:
77  Params params; /*!< spin insertion params */
78  };
79 
80  } // end namespace
81 
82  //! Reader
83  /*! @ingroup hadron */
84  void read(XMLReader& xml, const std::string& path, SimpleSpinInsertionEnv::Params& param);
85 
86  //! Writer
87  /*! @ingroup hadron */
88  void write(XMLWriter& xml, const std::string& path, const SimpleSpinInsertionEnv::Params& param);
89 
90 } // end namespace Chroma
91 
92 #endif
LeftSpinInsert(const Params &p)
Full constructor.
T operator()(const T &quark) const
Spin insert.
T operator()(const T &quark) const
Spin insert.
Base class for spin insertion.
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.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
LinOpSysSolverMGProtoClover::T T
static QDP_ColorVector * in
::std::string string
Definition: gtest.h:1979
Spin insertions.
Params for simple spin insertion.
void writeXML(XMLWriter &in, const std::string &path) const
Parameters for running code.