00001
00002
00003
00004
00005
00006
00007 #ifndef __sftmom_h__
00008 #define __sftmom_h__
00009
00010 #include "chromabase.h"
00011
00012 namespace Chroma
00013 {
00014
00015
00016
00017
00018
00019 struct SftMomParams_t
00020 {
00021 SftMomParams_t();
00022 int mom2_max;
00023 multi1d<int> mom_offset;
00024 bool avg_equiv_mom;
00025 multi1d<int> origin_offset;
00026 int decay_dir;
00027 };
00028
00029
00030
00031
00032
00033
00034 class SftMom
00035 {
00036 public:
00037
00038 SftMom(int mom2_max, bool avg_equiv_mom_=false, int j_decay=-1);
00039
00040
00041 SftMom(const multi2d<int> & moms , int j_decay=-1);
00042
00043
00044 SftMom(int mom2_max, multi1d<int> origin_offset_,
00045 bool avg_equiv_mom_=false, int j_decay=-1) ;
00046
00047
00048 SftMom(int mom2_max, multi1d<int> origin_offset_, multi1d<int> mom_offset_,
00049 bool avg_equiv_mom_=false, int j_decay=-1)
00050 { init(mom2_max, origin_offset_, mom_offset_, avg_equiv_mom_, j_decay); }
00051
00052
00053 SftMom(const SftMomParams_t& p)
00054 { init(p.mom2_max, p.origin_offset, p.mom_offset, p.avg_equiv_mom, p.decay_dir); }
00055
00056
00057 const Set& getSet() const { return sft_set; }
00058
00059
00060 int numMom() const { return num_mom; }
00061
00062
00063 int numSubsets() const { return sft_set.numSubsets(); }
00064
00065
00066 int numSites() const;
00067
00068
00069 int getDir() const { return decay_dir; }
00070
00071
00072 bool getAvg() const { return avg_equiv_mom; }
00073
00074
00075 multi1d<int> getMomOffset() const { return mom_offset; }
00076
00077
00078 multi1d<int> numToMom(int mom_num) const { return mom_list[mom_num]; }
00079
00080
00081
00082 int momToNum(const multi1d<int>& mom_in) const;
00083
00084
00085
00086 multi1d<int> canonicalOrder(const multi1d<int>& mom) const;
00087
00088
00089 const LatticeComplex& operator[](int mom_num) const
00090 { return phases[mom_num]; }
00091
00092
00093
00094 int multiplicity(int mom_num) const
00095 { return mom_degen[mom_num]; }
00096
00097
00098 multi2d<DComplex> sft(const LatticeComplex& cf) const;
00099
00100
00101 multi2d<DComplex> sft(const LatticeComplex& cf, int subset_color) const;
00102
00103
00104 multi2d<DComplex> sft(const LatticeReal& cf) const;
00105
00106
00107 multi2d<DComplex> sft(const LatticeReal& cf, int subset_color) const;
00108
00109 private:
00110 SftMom() {}
00111
00112 void init(int mom2_max, multi1d<int> origin_offset, multi1d<int> mom_offset,
00113 bool avg_mom_=false, int j_decay=-1);
00114
00115 multi2d<int> mom_list;
00116 bool avg_equiv_mom;
00117 int decay_dir;
00118 int num_mom;
00119 multi1d<int> origin_offset;
00120 multi1d<int> mom_offset;
00121 multi1d<LatticeComplex> phases;
00122 multi1d<int> mom_degen;
00123 Set sft_set;
00124 };
00125
00126 }
00127
00128 #endif