CHROMA
dilutezN_source_const.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Random Z(N) source construction using dilution
4  *
5  * Uses the Dublin "dilution" stochastic source strategy of hep-lat/0505023
6  */
7 
8 #ifndef __dilutezN_source_const_h__
9 #define __dilutezN_source_const_h__
10 
12 #include "io/xml_group_reader.h"
13 
14 namespace Chroma
15 {
16 
17  //! Dilute Z(N) quark source namespace, parameters, and classes
18  /*! @ingroup sources */
19  namespace DiluteZNQuarkSourceConstEnv
20  {
21  bool registerAll();
22 
23  //! Return the name
25 
26  //! Random complex Z(N) sources using dilution
27  /*! @ingroup sources */
28  struct Params
29  {
30  Params();
31  Params(XMLReader& in, const std::string& path);
32  void writeXML(XMLWriter& in, const std::string& path) const;
33 
34  GroupXML_t smr; /*!< xml holding smearing params */
35  GroupXML_t displace; /*!< xml holding displacement params */
36  GroupXML_t link_smear; /*!< link smearing xml */
37 
38  bool smear ; // a flag that tells me to smear or not to smear
39 
40  Seed ran_seed; /*!< Set the seed to this value */
41  int N; /*!< Z(N) */
42 
43  multi1d<int> spatial_mask_size; /*!< Spatial size of periodic mask */
44  multi1d< multi1d<int> > spatial_mask; /*!< Sites included in site mask */
45  multi1d<int> color_mask; /*!< Color size of periodic mask */
46  multi1d<int> spin_mask; /*!< Spin size of periodic mask */
47 
48  int j_decay; /*!< decay direction */
49  int t_source; /*!< source time slice location */
50  };
51 
52 
53  //! Random complex Z(N) sources using dilution
54  /*! @ingroup sources
55  *
56  * Create a random Z(N) using dilution
57  */
58  template<typename T>
60  {
61  public:
62  //! Full constructor
63  SourceConst(const Params& p) : params(p) {}
64 
65  //! Construct the source
66  T operator()(const multi1d<LatticeColorMatrix>& u) const;
67 
68  private:
69  //! Hide partial constructor
71 
72  private:
73  Params params; /*!< source params */
74  };
75 
76  } // end namespace DiluteZNQuarkSourceConstEnv
77 
78 
79  //! Reader
80  /*! @ingroup sources */
81  void read(XMLReader& xml, const std::string& path, DiluteZNQuarkSourceConstEnv::Params& param);
82 
83  //! Writer
84  /*! @ingroup sources */
85  void write(XMLWriter& xml, const std::string& path, const DiluteZNQuarkSourceConstEnv::Params& param);
86 
87 } // end namespace Chroma
88 
89 
90 #endif
Random complex Z(N) sources using dilution.
T operator()(const multi1d< LatticeColorMatrix > &u) const
Construct the source.
Base class for quark source construction.
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.
std::string getName()
Return the name.
bool registerAll()
Register all the factories.
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
Source construction.
Random complex Z(N) sources using dilution.
void writeXML(XMLWriter &in, const std::string &path) const
Hold group xml and type id.
Read an XML group as a std::string.