asq_dsl_s.cc

Go to the documentation of this file.
00001 /*  $Id: asq_dsl_s.cc,v 3.1 2006/11/18 02:33:03 kostas Exp $  */
00002 
00003 #include "chromabase.h"
00004 #include "actions/ferm/linop/asq_dsl_s.h"
00005 
00006 
00007 namespace Chroma 
00008 { 
00009   //! Creation routine
00010   /*!
00011    *
00012    * This routine is specific to staggered fermions!
00013    *
00014    * Description:
00015    *
00016    * This routine applies the "asq" or "asqtad" operator D' to Psi, 
00017    * putting the result in Chi.
00018    *
00019    *           Nd-1
00020    *           ---
00021    *           \                     F                     
00022    *   chi(x)  :=  >  isign eta  (x) [U  (x) psi(x+mu)
00023    *           /             mu      mu
00024    *           ---
00025    *           mu=0
00026    *
00027    *                    + c_3 U  (x) U  (x+mu) U  (x+2mu) psi(x+3mu) ]
00028    *                             mu     mu        mu
00029    *
00030    *                 Nd-1
00031    *                 ---
00032    *                 \                      +F
00033    *                -    >  isign eta  (x)  [U  (x-mu) psi(x-mu)
00034    *                 /             mu       mu
00035    *                 ---
00036    *                 mu=0
00037    *
00038    *                             +      +          +
00039    *                    + c_3 U  (x) U  (x-2mu) U  (x-3mu) psi(x-3mu) ]
00040    *                             mu     mu         mu
00041    * Note the KS phase factors are already included in the U's!
00042    *
00043    * Arguments:
00044    *
00045    *
00046    *  U_fat     'fat link' Gauge field                          (Read)
00047    *  U_triple    'triple-links' UUU                            (Read)
00048    *  Psi             Pseudofermion field                               (Read)
00049    *  Chi             Pseudofermion field                               (Write)
00050    *                  +
00051    *  ISign      D' or D'  ( +1 | -1 ) respectively             (Read)
00052    *  CB              Checkerboard of OUTPUT vector                     (Read)
00053    *
00054    * NOTE: the coefficient c_3 is included in u_triple! 
00055    *
00056    *
00057    *  recoded by mcneile
00058    */
00059   void QDPStaggeredDslash::create(Handle<AsqtadConnectStateBase> state_)
00060   { 
00061     START_CODE();
00062 
00063     state = state_;
00064 
00065     //  XMLFileWriter xml_out("output2.xml");
00066     //  push(xml_out, "more_tests");
00067     //  write(xml_out, "u_fat", u_fat);
00068     //  write(xml_out,"u_triple", u_triple);
00069     //  pop(xml_out);
00070 
00071     END_CODE();
00072   }
00073 
00074   void QDPStaggeredDslash::apply (LatticeStaggeredFermion& chi, const LatticeStaggeredFermion& psi, enum PlusMinus isign, int cb) const
00075   {
00076     START_CODE();
00077 
00078     const multi1d<LatticeColorMatrix>& u_fat = state->getFatLinks();
00079     const multi1d<LatticeColorMatrix>& u_triple = state->getTripleLinks();
00080 
00081     // need convention on isign
00082     //
00083     // isign == PLUS is normal isign == MINUS is daggered
00084     //
00085 
00086     LatticeStaggeredFermion tmp_0 = zero;
00087     LatticeStaggeredFermion tmp_1 = zero;
00088     LatticeStaggeredFermion tmp_2 = zero;
00089 
00090     int mu;
00091 
00092     /* Forward one-hop and three-hop neigbhors */
00093     /* Note the KS phase factors are already included in the U's! */
00094     mu = 0;
00095     tmp_0 = shift(psi, FORWARD, mu);
00096     chi[rb[cb]] = u_fat[mu] * tmp_0; // Color matrix X color vector : 66 flops
00097     //  NEIGHBOUR(tmp_0, tmp_1, FORWARD, mu, 1);
00098     tmp_1 = shift(tmp_0, FORWARD, mu);
00099     tmp_2 = shift(tmp_1, FORWARD, mu);
00100     chi[rb[cb]] += u_triple[mu] * tmp_2; // +66 + 6  flops
00101 
00102     for(mu = 1;mu  <= ( Nd - 1); ++mu )
00103     {
00104       tmp_0 = shift(psi, FORWARD, mu);
00105       chi[rb[cb]] += u_fat[mu] * tmp_0; //+66 + 6 flops
00106       //    NEIGHBOUR(tmp_0, tmp_1, FORWARD, mu, 1);
00107       tmp_1 = shift(tmp_0, FORWARD, mu);
00108       tmp_2 = shift(tmp_1, FORWARD, mu);
00109       chi[rb[cb]] += u_triple[mu] * tmp_2; //+66 + 6 flops
00110     }
00111 
00112     // Up to now 570 flops
00113 
00114     /* Backward one-hop and three-hop neigbhors */
00115     /* Note the KS phase factors are already included in the U's! */
00116     for(mu = 0;mu  <= ( Nd - 1); ++mu )
00117     {
00118       chi[rb[cb]] -= shift(adj(u_fat[mu]), BACKWARD, mu) * shift(psi,BACKWARD, mu);
00119       // +66 + 6 flops
00120       tmp_0 = shift(adj(u_triple[mu]),  BACKWARD, mu) * shift(psi, BACKWARD,  mu);
00121       // +66 flops
00122       // NEIGHBOUR(tmp_0, tmp_1, BACKWARD, mu, 1);
00123       tmp_1 = shift(tmp_0, BACKWARD, mu);
00124       tmp_2 = shift(tmp_1, BACKWARD, mu);
00125 
00126       chi[rb[cb]] -= tmp_2; //+6 flops
00127     }
00128 
00129 
00130     // this requires more thought
00131     // No it doesnt
00132     // const int MINUS = -1 ;
00133      
00134     if(isign == MINUS)
00135       chi = -chi;
00136 
00137     END_CODE();
00138   }
00139 
00140 } // End Namespace Chroma

Generated on Sun Nov 22 04:28:49 2009 for CHROMA by  doxygen 1.4.7