Beispiel #1
0
//------------------------------------------------------------------------------
// GforceSite(Matrix& force, int *x, int mu):
// It calculates the gauge force at site x and direction mu.
//------------------------------------------------------------------------------
void GimprRect::GforceSite(Matrix& force, int *x, int mu)
{
  const char *fname = "GforceSite(M&,i*,i)";
  setCbufCntrlReg(4, CBUF_MODE4);

  Matrix *u_off = GaugeField()+GsiteOffset(x)+mu;

  Matrix mt1;
  //----------------------------------------------------------------------------
  //  get staple
  //     mt1 = staple
  //----------------------------------------------------------------------------
  Staple(mt1, x, mu);	
  ForceFlops += 198*3*3+12+216*3;

  //----------------------------------------------------------------------------
  // mt2 = U_mu(x)
  //----------------------------------------------------------------------------
  Matrix mt2(*u_off);
  // moveMem((IFloat *)mp2, (IFloat *)u_off, MATRIX_SIZE * sizeof(IFloat)) ;

  //----------------------------------------------------------------------------
  // force = -(beta*(1-8*c_1)/3)*U_mu(x)*stap
  //----------------------------------------------------------------------------
  force.DotMEqual(mt2, mt1);
  force *= plaq_coeff;
  // mDotMEqual((IFloat *)&force, (const IFloat *)mp2, (const IFloat *)mp1);
  // tmp = plaq_coeff ;
  // vecTimesEquFloat((IFloat *)&force, tmp, MATRIX_SIZE);

  //----------------------------------------------------------------------------
  //  get rectangle staple
  //     mt1 = rect_stap
  //----------------------------------------------------------------------------
  RectStaple(mt1, x, mu);
  ForceFlops += 198*3*18+216*3*6;

  //----------------------------------------------------------------------------
  // mt2 = -(beta*c_1/3)*U_mu(x)
  //----------------------------------------------------------------------------
  // mt2 = *u_off;
  // moveMem((IFloat *)mp2, (IFloat *)u_off, MATRIX_SIZE*sizeof(IFloat));

  mt2 *= rect_coeff;
  // tmp = rect_coeff;
  // vecTimesEquFloat((IFloat *)mp2, tmp, MATRIX_SIZE) ;
  ForceFlops +=234;

  //----------------------------------------------------------------------------
  // force += -(beta*c_1/3)*U_mu(x)*rect_stap
  //----------------------------------------------------------------------------
  force.DotMPlus(mt2, mt1); 
  // mDotMPlus((IFloat *)&force, (const IFloat *)mp2, (const IFloat *)mp1);

  mt1.Dagger(force);
  force.TrLessAntiHermMatrix(mt1);
  ForceFlops +=198+24;
}
Beispiel #2
0
Complex MkTop( Matrix plaqs1[], Matrix plaqs2[] )
{
  const Float nfactor(-1.0/( 4 * 3.141592654 * 3.141592654 ));

  Matrix Top;

  // negative weight

  Top.DotMEqual( plaqs1[1] , plaqs2[4] );
  
  Top *= -1.0 ;
  // positive weight 
  
  Top.DotMPlus ( plaqs1[2] , plaqs2[3] );
  Top.DotMPlus ( plaqs1[5] , plaqs2[0] );
  
  return nfactor*Top.Tr();
}
//--------------------------------------------------------------------------
// void 
// DiracOpClover::SiteFuv(Matrix &Fuv, const int *site, int mu, int nu) const
//--------------------------------------------------------------------------
// Purpose: 
//    calculate F(x, u, v) = 1/4 1/2 (PLAQs - PLAQs^dag)
// where PLAQs are:
//    U_mu(x) U_nu(x+mu) U_mu(x+nu)^dag U_nu(x)^dag +
//    U_nu(x) U_mu(x-mu+nu)^dag U_nu(x-mu)^dag U_mu(x-mu) +
//    U_mu(x-mu)^dag U_nu(x-mu-nu)^dag U_mu(x-mu-nu) U_nu(x-nu) +
//    U_nu(x-nu)^dag U_mu(x-nu) U_nu(x+mu-nu) U_mu(x)^dag
// Note:
//  1. We adopt same definition of clover term as in Xiang-Qian Luo's paper,
//     But slightly different notation:
//        Fuv (here) / i = Fuv (Luo)
//  2. MATRIX STORAGE CONVENTION:
//     2.1. All the comments in this functions choose the canonical
//          convention, that is IFloat[row][col][2].
//     2.2. Fuv returned in the canonical convention.
//     2.3. GetLink(..) gives links in the wilson order, that is
//          IFloat[col][row][2].
//     2.4. In order to use the matrix utilities in the system, 
//          we have to change the formulae into:
//            F(x, u, v) = 1/4 1/2 (NewPLAQs - NewPLAQs^dag)^Transpose
//          where NewPLAQs are
//           [ U_mu(x) U_nu(x+mu) U_mu(x+nu)^dag U_nu(x)^dag +
//             U_nu(x) U_mu(x-mu+nu)^dag U_nu(x-mu)^dag U_mu(x-mu) +
//             U_mu(x-mu)^dag U_nu(x-mu-nu)^dag U_mu(x-mu-nu) U_nu(x-nu) +
//             U_nu(x-nu)^dag U_mu(x-nu) U_nu(x+mu-nu) U_mu(x)^dag 
//           ] ^Transpose
//  3. site[] has to be a legal site, and should not be off-node which is OK
//     only in calling GetLink.
//--------------------------------------------------------------------------
void 
DiracOpClover::SiteFuv(Matrix &Fuv, const int *site, int mu, int nu) const
{
  //  char *fname = "SiteFuv()";
  //  VRB.Func(cname,fname);

  // neighbour[] is the local coordinates of a neighbour site
  //------------------------------------------------------------------------
  int neighbor[4] = {site[0], site[1], site[2], site[3]};
  
  // mp0 = [ U_mu(x) U_nu(x+mu) ] ^Transpose
  //------------------------------------------------------------------------
  ++(neighbor[mu]);                               // neighbor = x+mu
  mp0->DotMEqual(GetLink(neighbor, nu), GetLink(site, mu));
 
  // mp1 = [ U_mu(x+nu)^dag U_nu(x)^dag ] ^Transpose
  //------------------------------------------------------------------------
  --(neighbor[mu]);  
  ++(neighbor[nu]);                               // neighbor = x+nu
  mp2->DotMEqual(GetLink(neighbor, mu), GetLink(site, nu));
  mp1->Dagger(*mp2);  
 
  // Fuv = [ U_mu(x) U_nu(x+mu) U_mu(x+nu)^dag U_nu(x)^dag ] ^Transpose
  //------------------------------------------------------------------------
  Fuv.DotMEqual(*mp1, *mp0);
   
  // mp0 = [ U_nu(x) U_mu(x-mu+nu)^dag ] ^Transpose
  //------------------------------------------------------------------------
  --(neighbor[mu]);                             // neighbor = x-mu+nu
  mp2->Dagger(GetLink(neighbor, mu));
  mp0->DotMEqual(*mp2, GetLink(site, nu));
  
  // mp1 = [ U_nu(x-mu)^dag U_mu(x-mu) ] ^Transpose
  //------------------------------------------------------------------------
  --(neighbor[nu]);                             // neighbor = x-mu
  mp2->Dagger(GetLink(neighbor, nu));
  mp1->DotMEqual(GetLink(neighbor, mu), *mp2);
 
  // Fuv += [ U_nu(x) U_mu(x-mu+nu)^dag U_nu(x-mu)^dag U_mu(x-mu) ] ^Trans
  //------------------------------------------------------------------------
  Fuv.DotMPlus(*mp1, *mp0);

  // mp0 = [ U_mu(x-mu)^dag U_nu(x-mu-nu)^dag ] ^Trans
  //------------------------------------------------------------------------
  mp1->Dagger(GetLink(neighbor, mu));
  --(neighbor[nu]);                             // neighbor = x-mu-nu
  mp2->Dagger(GetLink(neighbor, nu));
  mp0->DotMEqual(*mp2, *mp1);
  
  // mp1 = [ U_mu(x-mu-nu) U_nu(x-nu) ] ^Transpose
  //------------------------------------------------------------------------
  *mp2 = GetLink(neighbor, mu);
  ++(neighbor[mu]);                             // neighbor = x-nu
  mp1->DotMEqual(GetLink(neighbor, nu), *mp2);
  
  // Fuv += [ U_mu(x-mu)^dag U_nu(x-mu-nu)^dag U_mu(x-mu-nu) U_nu(x-nu) ] ^T
  //------------------------------------------------------------------------
  Fuv.DotMPlus(*mp1, *mp0);
 
  // mp0 = [ U_nu(x-nu)^dag U_mu(x-nu) ] ^Transpose
  //------------------------------------------------------------------------
  mp2->Dagger(GetLink(neighbor, nu));
  mp0->DotMEqual(GetLink(neighbor, mu), *mp2);
 
  // mp1 = [ U_nu(x+mu-nu) U_mu(x)^dag ] ^Transpose
  //------------------------------------------------------------------------
  mp2->Dagger(GetLink(site, mu));
  ++(neighbor[mu]);                             // neighbor = x+mu-nu
  mp1->DotMEqual(*mp2, GetLink(neighbor, nu));
 
  // Fuv += [ U_nu(x-nu)^dag U_mu(x-nu) U_nu(x+mu-nu) U_mu(x)^dag ] ^Trans
  //------------------------------------------------------------------------
  Fuv.DotMPlus(*mp1, *mp0);
  
  // Fuv = (PLAQa - PLAQs^dag)/8
  //------------------------------------------------------------------------
  mp0->Dagger(Fuv);
  *mp0 -= Fuv;
  Fuv.Trans(*mp0);  
  Fuv *= -0.125;
}