8 #ifndef __inline_barspec_h__
9 #define __inline_barspec_h__
23 namespace InlineBarSpecEnv
58 multi1d<Operators_t>
ops ;
101 std::vector<int>
permutation(
int k,
const std::vector<int>&
s) ;
109 for(
int i(1);
i<=
n;
i++)
117 std::vector<Params::SpinTerms_t>
terms ;
132 std::map<std::string,std::vector<int> > f_pos;
136 std::vector<std::string> labels;
137 for(
int f(0);f<flavor.size();f++){
138 if(f_pos.find(flavor[f]) == f_pos.end()){
139 labels.push_back(flavor[f]);
141 f_pos[flavor[f]].push_back(f);
144 std::vector<Params::SpinTerms_t> perm_terms ;
145 for(
int f(0);f<labels.size();f++){
146 int Nterms =
terms.size();
149 int Nperms =
factorial(f_pos[labels[f]].size()) ;
150 QDPIO::cout<<
" SpinWF_t::"<<__func__
151 <<
": Flavor "<<labels[f]<<
" needs "<<Nperms
152 <<
": permutations"<<std::endl ;
154 for(
int t(0);
t<Nterms;
t++){
156 std::vector<int> spin ;
157 for(
int i(0);
i<f_pos[labels[f]].size();
i++)
158 spin.push_back(
terms[
t].spin[f_pos[labels[f]][
i]]);
163 for(
int k(0);
k<Nperms;
k++){
169 for(
int i(0);
i<f_pos[labels[f]].size();
i++)
170 foo.
spin[f_pos[labels[f]][
i]] = perm[
i] ;
171 perm_terms.push_back(foo) ;
179 QDPIO::cout<<
" SpinWF_t::"<<__func__
180 <<
": weight: "<<
terms[
t].weight<<
" | " ;
181 QDPIO::cout<<
"spin : " ;
183 QDPIO::cout<<flavor[
m]<<
"("<<
terms[
t].spin[
m]<<
") " ;
184 QDPIO::cout<<
">"<<std::endl ;
197 multi2d<multi2d<LatticeComplex> >
p ;
201 for(
int s(0);
s<N;
s++)
202 for(
int ss(0);ss<N;ss++)
203 p(
s,ss).resize(Nc,Nc) ;
207 QDPIO::cout<<__func__<<
": Converting to Dirac Basis"<<std::endl ;
209 LatticePropagator foo = adj(
U)*
prop*
U ;
212 int Noff = N+spin_offset;
215 for(
int s(spin_offset);
s<Noff;
s++)
216 for(
int ss(0);ss<Noff;ss++){
217 p(
s,ss).resize(Nc,Nc) ;
218 LatticeColorMatrix Cmat = peekSpin(foo,
s,ss) ;
219 for(
int c(0);
c<Nc;
c++)
220 for(
int cc(0);cc<Nc;cc++)
221 p(
s,ss)(
c,cc) = peekColor(Cmat,
c,cc);
268 void operator()(
const unsigned long update_no,
273 void func(
const unsigned long update_no,
Abstract inline measurements.
Primary include file for CHROMA library code.
multi2d< multi2d< LatticeComplex > > p
void ConvertPropUpper(const LatticePropagator &prop)
void ConvertProp(const LatticePropagator &prop, int spin_offset)
void ConvertPropLowerr(const LatticePropagator &prop)
void ConvertProp(const LatticePropagator &prop)
void permutations(const multi1d< std::string > &flavor)
SpinWF_t(const Params::SpinWF_t &ss)
std::vector< Params::SpinTerms_t > terms
Inline measurement of hadron spectrum.
unsigned long getFrequency(void) const
Tell me how often I should measure this beastie.
InlineMeas(const Params &p)
void operator()(const unsigned long update_no, XMLWriter &xml_out)
Do the measurement.
void func(const unsigned long update_no, XMLWriter &xml_out)
Do the measurement.
Basis rotation matrix from Dirac to Degrand-Rossi (and reverse)
SpinMatrixD DiracToDRMat()
The Dirac to Degrand-Rossi spin transformation matrix (and reverse)
std::map< std::string, SinkPropContainer_t > prop
int permutation_sign(int k, int n)
BasePropagator< Ns > RPropagator
std::vector< int > permutation(int k, const std::vector< int > &s)
void contract(LatticeComplex &latC, const RPropagator &q1, const RPropagator &q2, const RPropagator &q3, const SpinWF_t &snk, const SpinWF_t &src)
BasePropagator< Ns/2 > NRPropagator
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
multi1d< LatticeFermion > s(Ncb)
multi1d< State_t > states
multi1d< SpinTerms_t > terms
multi1d< Operators_t > ops
multi1d< std::string > flavor
void writeXML(XMLWriter &xml_out, const std::string &path)
struct Chroma::InlineBarSpecEnv::Params::Param_t param
struct Chroma::InlineBarSpecEnv::Params::NamedObject_t named_obj
multi1d< LatticeColorMatrix > U