102 #include "qdp_util.h"
129 int operator() (
const multi1d<int>& coordinate)
const ;
163 multi1d<int> origin_off(
Nd);
164 multi1d<int> mom_off;
169 mom_off.resize(
Nd-1) ;
175 init(mom2_max, origin_off, mom_off, avg_mom,
j_decay) ;
182 multi1d<int> orig(
Nd);
185 for(
int i = 0 ;
i <
Nd ; ++
i)
206 multi1d<int> mom_off;
211 mom_off.resize(
Nd-1) ;
215 init(mom2_max, origin_offset_, mom_off, avg_mom,
j_decay) ;
227 for(
int m=0;
m <
Nd; ++
m)
228 vol *= Layout::lattSize()[
m];
236 SftMom::init(
int mom2_max, multi1d<int> origin_off, multi1d<int> mom_off,
249 multi1d<int> mom_size ;
251 mom_size.resize(
Nd) ;
253 mom_size.resize(
Nd-1) ;
259 for (L=1; L*L <= mom2_max; ++L) ;
261 for(
int mu=0;
mu < mom_size.size(); ++
mu) {
266 mom_vol *= (2*L) + 1;
267 mom_size[
mu] = (2*L) + 1;
273 for(
int n=0;
n < mom_vol; ++
n) {
274 multi1d<int> mom = crtesn(
n, mom_size);
278 for(
int mu=0;
mu < mom_size.size(); ++
mu) {
280 mom2 += mom[
mu]*mom[
mu];
283 if (mom2 > mom2_max) {
288 for(
int mu=0;
mu < mom_size.size()-1; ++
mu)
289 for(
int nu=
mu+1;
nu < mom_size.size(); ++
nu)
290 if (mom[
nu] > mom[
mu]) skip=
true;
305 for(
int n=0;
n < mom_vol; ++
n)
307 multi1d<int> mom = crtesn(
n, mom_size);
311 for(
int mu=0;
mu < mom_size.size(); ++
mu) {
313 mom2 += mom[
mu]*mom[
mu];
316 if (mom2 > mom2_max) {
321 for(
int mu=0;
mu < mom_size.size()-1; ++
mu)
322 for(
int nu=
mu+1;
nu < mom_size.size(); ++
nu)
323 if (mom[
nu] > mom[
mu]) skip = true ;
325 if (!skip)
mom_list[mom_num++] = mom ;
327 for (
int mu=0;
mu < mom_size.size(); ++
mu) {
340 multi1d<LatticeInteger> my_coord(
Nd);
342 my_coord[
mu] = Layout::latticeCoordinate(
mu);
353 for (
int mu=0;
mu < mom_size.size(); ++
mu) {
354 mom_vol *= (2*L) + 1 ;
355 mom_size[
mu] = (2*L) + 1 ;
362 for (
int n=0;
n < mom_vol; ++
n) {
363 multi1d<int> mom = crtesn(
n, mom_size) ;
367 for(
int mu=0;
mu < mom_size.size(); ++
mu) {
369 mom2 += mom[
mu]*mom[
mu];
373 if (mom2 > mom2_max)
continue;
392 for (
int mu=0;
mu < mom_tmp.size(); ++
mu) {
413 for (
int mu=0;
mu < mom_size.size(); ++
mu) {
419 for (
int mu=0;
mu < mom_size.size(); ++
mu) {
431 LatticeReal p_dot_x ;
436 const Real
twopi = 6.283185307179586476925286;
441 Real(mom[
j]) / Layout::lattSize()[
mu];
445 phases[mom_num] += cmplx(cos(p_dot_x), sin(p_dot_x)) ;
455 for (
int mom_num=0; mom_num <
num_mom; ++mom_num)
467 multi1d<int> mom_tmp = mom;
468 for (
int mu=0;
mu < mom_tmp.size(); ++
mu)
469 if (mom_tmp[
mu] < 0) mom_tmp[
mu] = -mom_tmp[
mu];
473 for (
int mu=1;
mu < mom_tmp.size(); ++
mu)
480 while (mom_tmp[
nu-1] < v) {
481 mom_tmp[
nu] = mom_tmp[
nu-1];
507 for(
int mom_num=0; mom_num <
num_mom; ++mom_num)
510 for (
int mu=0;
mu < mom.size(); ++
mu)
518 if (match)
return mom_num ;
528 for (
int mom_num=0; mom_num <
num_mom; ++mom_num)
537 int length =
sft_set.numSubsets();
538 multi2d<DComplex> hsum(
num_mom, length);
540 for (
int mom_num=0; mom_num <
num_mom; ++mom_num)
542 hsum[mom_num] =
zero;
543 hsum[mom_num][subset_color] =
sum(
phases[mom_num]*cf,
sft_set[subset_color]);
554 for (
int mom_num=0; mom_num <
num_mom; ++mom_num)
563 int length =
sft_set.numSubsets();
564 multi2d<DComplex> hsum(
num_mom, length);
566 for (
int mom_num=0; mom_num <
num_mom; ++mom_num)
568 hsum[mom_num] =
zero;
569 hsum[mom_num][subset_color] =
sum(
phases[mom_num]*cf,
sft_set[subset_color]);
575 #if BASE_PRECISION==32
581 for (
int mom_num=0; mom_num <
num_mom; ++mom_num)
588 SftMom::sft(
const LatticeComplexD& cf,
int subset_color)
const
590 int length =
sft_set.numSubsets();
591 multi2d<DComplex> hsum(
num_mom, length);
593 for (
int mom_num=0; mom_num <
num_mom; ++mom_num)
595 hsum[mom_num] =
zero;
596 hsum[mom_num][subset_color] =
sum(
phases[mom_num]*cf,
sft_set[subset_color]);
int numSites() const
Number of sites in each subset.
multi1d< int > canonicalOrder(const multi1d< int > &mom) const
Canonically order an array of momenta.
multi1d< int > origin_offset
multi1d< int > mom_offset
int momToNum(const multi1d< int > &mom_in) const
Convert array of momenta to momenta id.
multi2d< DComplex > sft(const LatticeComplex &cf) const
Do a sumMulti(cf*phases,getSet())
multi1d< LatticeComplex > phases
void init(int mom2_max, multi1d< int > origin_offset, multi1d< int > mom_offset, bool avg_mom_=false, int j_decay=-1)
Function object used for constructing the time-slice set.
int operator()(const multi1d< int > &coordinate) const
LatticeComplex singlePhase(const multi1d< int > &t_srce, const multi1d< int > &sink_mom, int j_decay)
A single exp(ip.x) phase used in hadron construction.
Asqtad Staggered-Dirac operator.
QDP_error_exit("too many BiCG iterations", n_count, rsd_sq, cp, c, re_rvr, im_rvr, re_a, im_a, re_b, im_b)
Fourier transform phase factor support.
Compute a single phase factor.
multi1d< int > mom_offset
multi1d< int > origin_offset