CHROMA
dilute_zN_eigvec_source_const.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Random Z(N) source construction using dilution in eigenstd::vector
4  * space
5  *
6  */
7 
8 #ifndef __dilute_zN_eigvec_source_const_h__
9 #define __dilute_zN_eigvec_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 DiluteZNEigVecQuarkSourceConstEnv
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 
35  Seed ran_seed; /*!< Set the seed to this value */
36  int N; /*!< Z(N) */
37 
38  std::string eigen_vec_id; /*! The ID of the eigenvectors in the named object std::map*/
39  multi1d<int> eigen_vectors; /*!< Eigenvectors which have support on this dilution projector */
40  multi1d<int> spin_mask; /*!< Spins which have support on this dilution projector */
41  int j_decay; /*!< decay direction */
42 
43  multi1d<int> t_sources; /*!< timeslices on which this source has non-zero support */
44  };
45 
46 
47 
49  {
50 
51  LatticeLAPHSubSpace_t(int nev, int nt)
52  {
53 
54  time_slices.resize(nt);
55  for (int t = 0 ; t < nt ; ++t)
56  {
57  time_slices[t].spins.resize(Ns);
58  for (int s = 0 ; s < Ns ; ++s)
59  {
60  time_slices[t].spins[s].lap_eigs.resize(nev);
61  }
62  }
63  }
64 
65 
66  struct Timeslice_t
67  {
68  struct Spin_t
69  {
70  struct LapEig_t
71  {
72  Complex val;
73  };
74 
75  multi1d<LapEig_t> lap_eigs;
76 
77  };
78 
79  multi1d<Spin_t> spins;
80 
81  };
82 
83  multi1d<Timeslice_t> time_slices;
84 
85  };
86 
87 
89  const Seed& rng_seed, const int& N);
90 
91 
92  //! Random complex Z(N) sources using dilution
93  /*! @ingroup sources
94  *
95  * Create a random Z(N) using dilution
96  */
97  template<typename T>
99  {
100  public:
101  //! Full constructor
102  SourceConst(const Params& p) : params(p) {}
103 
104  //! Construct the source
105  T operator()(const multi1d<LatticeColorMatrix>& u) const;
106 
107  private:
108  //! Hide partial constructor
110 
111  private:
112  Params params; /*!< source params */
113  };
114 
115  } // end namespace DiluteZNEigVecQuarkSourceConstEnv
116 
117 
118  //! Reader
119  /*! @ingroup sources */
120  void read(XMLReader& xml, const std::string& path, DiluteZNEigVecQuarkSourceConstEnv::Params& param);
121 
122  //! Writer
123  /*! @ingroup sources */
124  void write(XMLWriter& xml, const std::string& path, const DiluteZNEigVecQuarkSourceConstEnv::Params& param);
125 
126 } // end namespace Chroma
127 
128 
129 #endif
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.
int t
Definition: meslate.cc:37
void fill_laph_subspace_zN(LatticeLAPHSubSpace_t &laph_in, const Seed &rng_seed, const int &N)
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
static multi1d< LatticeColorMatrix > u
LinOpSysSolverMGProtoClover::T T
static QDP_ColorVector * in
multi1d< LatticeFermion > s(Ncb)
::std::string string
Definition: gtest.h:1979
Source construction.
void writeXML(XMLWriter &in, const std::string &path) const
Read an XML group as a std::string.