CHROMA
hisq_fermact_s.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Hisq staggered fermion action
3  */
4 
5 /*
6 
7 Highly improved staggered quarks on the lattice, with applications to char\m physics.
8 By HPQCD Collaboration and UKQCD Collaboration (E. Follana et al.). Oct 20\06. 21pp.
9 Published in Phys.Rev.D75:054502,2007.
10 e-Print: hep-lat/0610092
11 
12 Note
13 -----
14 
15 My current understanding is that Hisq and Asqtad then
16 differ by the way the fat links are constructed.
17 
18 This is meant to be the minimum modification to add
19 HISQ to chroma. I want to try not do too much cut and pasting
20 of Asqtad code, so that the chroma class police
21 are kept happy. Reuse and all that!
22 
23 
24 The correction to the Naik term, known as epsilon
25 (equation 24 in the above paper) is included now as an external argument.
26 This is the way that Christine wanted it done. I assume that
27 epsilon will be computed to one loop order in perturbation
28 theory (one day).
29 */
30 
31 #include "chromabase.h"
32 
35 
40 #include "util/gauge/reunit.h"
41 #include "util/gauge/sun_proj.h"
42 #include "meas/gfix/polar_dec.h"
43 
44 // DEBUG
45 #include "util/gauge/unit_check.h"
46 #include "meas/glue/mesplq.h"
47 
48 namespace Chroma
49 {
50 
51  //! Hooks to register the class with the fermact factory
52  namespace HisqFermActEnv
53  {
54  //! Callback function
55  StaggeredTypeFermAct<LatticeStaggeredFermion,
56  multi1d<LatticeColorMatrix>,
57  multi1d<LatticeColorMatrix> >* createFermAct4D(XMLReader& xml_in,
58  const std::string& path)
59  {
60  return new HisqFermAct(StaggeredCreateFermStateEnv::reader(xml_in, path),
61  HisqFermActParams(xml_in, path));
62  }
63 
64  //! Callback function
65  /*! Differs in return type */
66  FermionAction<LatticeStaggeredFermion,
67  multi1d<LatticeColorMatrix>,
68  multi1d<LatticeColorMatrix> >* createFermAct(XMLReader& xml_in,
69  const std::string& path)
70  {
71  return createFermAct4D(xml_in, path);
72  }
73 
74  //! Name to be used
75  const std::string name = "HISQ";
76 
77  //! Local registration flag
78  static bool registered = false;
79 
80  //! Register all the factories
81  bool registerAll()
82  {
83  bool success = true;
84  if (! registered)
85  {
88  registered = true;
89  }
90  return success;
91  }
92  }
93 
94 
95  //! Produce a linear operator for this action
96  /*!
97  * \ingroup fermact
98  *
99  * The operator acts on the entire lattice
100  *
101  * \param u_fat, u_triple fat7 and triple links (Read)
102  * \u has already had KS phases multiplied in.
103  */
104  EvenOddLinearOperator<LatticeStaggeredFermion,
105  multi1d<LatticeColorMatrix>,
106  multi1d<LatticeColorMatrix> >*
108  {
109 
110  // Why in fact are we casting to the base class on both sides of
111  // this assignment ? The answer is so that we can use a proxy.
112  // Both the Proxy and the ConnectState inherit from the BaseClass
113  // and can be cast to and from the base class. However the Proxy
114  // and the connect state cannot be directly cast into each other.
115  // Which is why we have a virtual base class in the first place.
116  //
117  // So We cast the ConnectState to an AsqtadConnectStateBase
118  // This we can do at our leisure from either AsqtadConnectState
119  // OR from the Proxy. We then get access to all the virtual methods
120  // in the AsqtadConnectState. Only Restriction: We have to use the
121  // get() methods as they are all the base class provides.
122  return new AsqtadLinOp(state.cast<AsqtadConnectStateBase>(), param.Mass);
123  }
124 
125  //! Produce a M^dag.M linear operator for this action
126  /*!
127  * \ingroup fermact
128  *
129  * The operator acts on the checkerboarded lattice
130  *
131  * \param u_fat, u_triple fat7 and triple links (Read)
132  */
133  DiffLinearOperator<LatticeStaggeredFermion,
134  multi1d<LatticeColorMatrix>,
135  multi1d<LatticeColorMatrix> >*
137  {
138  return new AsqtadMdagM(state.cast<AsqtadConnectStateBase>(), param.Mass);
139  }
140 
141 
142  //! Create a state -- this multiplies in the K-S phases computes the fat and triple links etc
144  HisqFermAct::createState(const multi1d<LatticeColorMatrix>& u_) const
145  {
146  multi1d<LatticeColorMatrix> u_with_phases(Nd);
147  multi1d<LatticeColorMatrix> u_fat(Nd);
148  multi1d<LatticeColorMatrix> u_fat_I(Nd);
149  multi1d<LatticeColorMatrix> u_triple(Nd);
150 
151  QDPIO::cout << "HISQ setting up the fat links\n" ;
152 
153  // First put in the BC
154  u_with_phases = u_;
155  getFermBC().modify(u_with_phases);
156 
157 #if 0
158  // DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG
159  fat7_param pp ;
160  QDPIO::cout << "HISQ hacked to do ASQTAD" << std::endl ;
161  pp.c_1l = (Real)(5) / (Real)(8);
162  pp.c_3l = (Real)(-1) / ((Real)(16));
163  pp.c_5l = - pp.c_3l / ((Real)(4));
164  pp.c_7l = - pp.c_5l / ((Real)(6));
165  pp.c_Lepage = pp.c_3l ;
166  Fat7_Links(u_with_phases, u_fat, pp);
167  Real one = (Real) 1.0 ;
168  Triple_Links(u_with_phases, u_triple, one);
169  // DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG
170 #endif
171  Real ep = param.epsilon ;
172 #if 0
173  QDPIO::cout << "HISQ epsilon = " << ep << "\n"; ;
174  QDPIO::cout << "HISQ Mass = " << param.Mass << "\n"; ;
175  QDPIO::cout << "HISQ u0 = " << param.u0 << "\n"; ;
176 #endif
177  QDPIO::cout << "Setting up HISQ inverter\n"; ;
178 
179  // Create Fat7 links. This uses the same
180  // coefficients as Asqtad, but with zero
181  // Lepage term
182  fat7_param pp ;
183 
184 
185  pp.c_1l = (Real)(1)/(Real)(8) ; // lepage contributes here
186  pp.c_3l = (Real)(1) / ((Real)(16));
187  pp.c_5l = pp.c_3l / ((Real)(4)); // 1/64
188  pp.c_7l = pp.c_5l / ((Real)(6)); // -1/384
189  pp.c_Lepage = 0.0 ;
190 
191 
192  Fat7_Links(u_with_phases, u_fat_I, pp);
193 
194  // reunitarise (using polar method)
195  LatticeReal alpha ; // complex phase (not needed here)
196  Real JacAccu = 0.00000000001 ;
197  int JacMax = 100 ;
198  LatticeColorMatrix w ;
199  QDPIO::cout << "SU3 polar projection Accuracy " << JacAccu << " max iters = " << JacMax << std::endl;
200 
201  for(int i = 0; i < Nd; i++)
202  {
203  w = u_fat_I[i] ;
204  polar_dec(w, u_fat_I[i],alpha, JacAccu, JacMax) ;
205  }
206 
207  // with HISQ the three links are fat
208  Real UU0 = (Real) 1.0 ; // tadpole
209  Real c_3 ;
210  c_3 = (Real)(-1 - ep) / (Real)(24);
211  Triple_Links(u_fat_I, u_triple, UU0, c_3);
212  // Triple_Links(u_fat_I, u_triple, UU0);
213 
214  // fatten again with different coefficient of fat term
215  pp.c_1l = (Real)(8 + ep) / (Real)(8) ;
216  pp.c_3l = (Real)(1) / ((Real)(16)); // -0.0625 or -1/16
217  pp.c_5l = pp.c_3l / ((Real)(4)); // 0.01562500 or 1/64
218  pp.c_7l = pp.c_5l / ((Real)(6)); // .00260416666 or 1/384
219  pp.c_Lepage = -2.0 * pp.c_3l ; // double Lepage term -1/8
220 
221  Fat7_Links(u_fat_I, u_fat, pp);
222 
223  for(int i = 0; i < Nd; i++)
224  {
225  u_fat[i] *= StagPhases::alpha(i);
226  u_triple[i] *= StagPhases::alpha(i);
227  }
228 
229  // ---------------------------------------------------
230 
231  return new AsqtadConnectState(cfs->getFermBC(), u_with_phases, u_fat, u_triple);
232  }
233 
234 } // End Namespace Chroma
235 
Unpreconditioned Wilson fermion linear operator.
Primary include file for CHROMA library code.
Basic "Connect State" for ASQTAD.
Definition: asqtad_state.h:24
The actual Asqtad thing.
Definition: asqtad_state.h:48
Asqtad Staggered-Dirac operator.
Differentiable Linear Operator.
Definition: linearop.h:98
Even odd Linear Operator (for staggered like things )
Definition: eo_linop.h:28
Support class for fermion actions and linear operators.
Definition: state.h:94
Base class for quadratic matter actions (e.g., fermions)
Definition: fermact.h:53
Class for counted reference semantics.
Definition: handle.h:33
Hisq staggered fermion action.
const FermBC< T, P, Q > & getFermBC() const
Return the fermion BC object for this action.
Handle< CreateFermState< T, P, Q > > cfs
HisqFermActParams param
AsqtadConnectStateBase * createState(const Q &u_) const
Create state should apply the BC.
static T & Instance()
Definition: singleton.h:432
Staggered-like fermion actions.
Definition: fermact.orig.h:644
Pass parameters to the fat link code.
All ferm create-state method.
Fermion action factories.
DiffLinearOperator< T, P, Q > * lMdagM(Handle< FermState< T, P, Q > > state_) const
Produce a linear operator M^dag.M for this action.
EvenOddLinearOperator< T, P, Q > * linOp(Handle< FermState< T, P, Q > > state_) const
Produce a linear operator for this action.
void polar_dec(LatticeColorMatrix &c, LatticeColorMatrix &v, LatticeReal &alpha, const Real &JacAccu, int JacMax)
Decompose a complex matrix as C = exp(i\alpha) V P.
Definition: polar_dec.cc:25
void Triple_Links(multi1d< LatticeColorMatrix > &u, multi1d< LatticeColorMatrix > &u_triple, Real u0)
Definition: naik_term_s.cc:33
void Fat7_Links(multi1d< LatticeColorMatrix > &u, multi1d< LatticeColorMatrix > &uf, Real u0)
FAT7_LINKS.
Definition: fat7_links_s.cc:21
Hisq staggered fermion action.
Nd
Definition: meslate.cc:74
StaggeredTypeFermAct< LatticeStaggeredFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createFermAct4D(XMLReader &xml_in, const std::string &path)
Callback function.
bool registerAll()
Register all the factories.
static bool registered
Local registration flag.
FermionAction< LatticeStaggeredFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createFermAct(XMLReader &xml_in, const std::string &path)
Callback function.
const std::string name
Name to be used.
static const LatticeInteger & alpha(const int dim)
Definition: stag_phases_s.h:43
Handle< CreateFermState< LatticeStaggeredFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > reader(XMLReader &xml_in, const std::string &path)
Helper function for the CreateFermState readers.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
Double one
Definition: invbicg.cc:105
int i
Definition: pbg5p_w.cc:55
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
Definition: pbg5p_w.cc:28
::std::string string
Definition: gtest.h:1979
Decompose a complex matrix as .
Reunitarize in place a color matrix to SU(N)
Params for hisq ferm acts.
Project a complex Nc x Nc matrix W onto SU(Nc) by maximizing Tr(VW)