Exemplo n.º 1
0
void AlgFourierProp::calcmom(const FourMom& p)
{
  char *fname="calcmom(const FourMom&)";
  VRB.Func(cname,fname);

  Float   p1( p.x() + 0.5*bc[0] );
  Float   p2( p.y() + 0.5*bc[1] );
  Float   p3( p.z() + 0.5*bc[2] );
  Float   p4( p.t() + 0.5*bc[3] );
 
  const Float PI(3.141592654);
 
  p1 *= 2.0*PI/(GJP.XnodeSites()*GJP.Xnodes());
  p2 *= 2.0*PI/(GJP.YnodeSites()*GJP.Ynodes());
  p3 *= 2.0*PI/(GJP.ZnodeSites()*GJP.Znodes());
  p4 *= 2.0*PI/(GJP.TnodeSites()*GJP.Tnodes());

  Site site;

  while ( site.LoopsOverNode() )
    {
      const Float px( site.physX()*p1 );
      const Float py( site.physY()*p2 );
      const Float pz( site.physZ()*p3 );
      const Float pt( site.physT()*p4 );
      
      const Float pdotx( px + py + pz + pt );


      Rcomplex fact( cos(pdotx), -sin(pdotx) );

      //--------------------------------------------
      //  Using AddMult is logically equivalent to
      //     momprop += fact * (*prop)[i]; ,
      //  but cuts down on the number of loops over
      //  the data. The time taken is reduced by
      //  a factor of two.
      //--------------------------------------------
      
      momprop.AddMult(fact,(*prop)[site.Index()]);
      
    }
}