CHROMA
lw_tree_gaugeact.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Tree-level tadpole-improved Luscher-Weisz gauge action
3  */
4 
5 #include "chromabase.h"
9 
10 namespace Chroma
11 {
12 
13  namespace LWTreeGaugeActEnv
14  {
16  multi1d<LatticeColorMatrix> >* createGaugeAct(XMLReader& xml,
17  const std::string& path)
18  {
19  return new LWTreeGaugeAct(CreateGaugeStateEnv::reader(xml, path),
20  LWTreeGaugeActParams(xml, path));
21  }
22 
23  const std::string name = "LW_TREE_GAUGEACT";
24 
25  //! Local registration flag
26  static bool registered = false;
27 
28  //! Register all the factories
29  bool registerAll()
30  {
31  bool success = true;
32  if (! registered)
33  {
34  success &= TheGaugeActFactory::Instance().registerObject(name, createGaugeAct);
35  registered = true;
36  }
37  return success;
38  }
39  }
40 
41 
42  LWTreeGaugeActParams::LWTreeGaugeActParams(XMLReader& xml_in, const std::string& path) {
43  XMLReader paramtop(xml_in, path);
44 
45  try {
46  read(paramtop, "./beta", beta);
47  read(paramtop, "./u0", u0);
48 
49  // Read optional anisoParam.
50  if (paramtop.count("AnisoParam") != 0)
51  read(paramtop, "AnisoParam", aniso);
52  }
53  catch( const std::string& e ) {
54  QDPIO::cerr << "Error reading XML: " << e << std::endl;
55  QDP_abort(1);
56  }
57  }
58 
59  void read(XMLReader& xml, const std::string& path, LWTreeGaugeActParams& p) {
60  LWTreeGaugeActParams tmp(xml, path);
61  p=tmp;
62  }
63 
64 
65  // Private initializer
66  void
68  {
69  START_CODE();
70 
71  // Fold in normalizations and create action
72  // NOTE: the 5/3 is folded into beta, hence divided out of c1
73  Real c0 = param.beta;
74  plaq = new PlaqGaugeAct(cgs,c0,param.aniso);
75 
76  Real c1 = -c0 * (1/(20*param.u0*param.u0));
77  rect = new RectGaugeAct(cgs,c1);
78 
79  END_CODE();
80  }
81 
82 }
83 
Primary include file for CHROMA library code.
Create a gauge connection state.
Definition: create_state.h:47
Abstract base class for gauge actions.
Definition: gaugeact.h:25
Class for counted reference semantics.
Definition: handle.h:33
LWTree gauge action.
LWTreeGaugeActParams param
Handle< RectGaugeAct > rect
Handle< PlaqGaugeAct > plaq
void init(Handle< CreateGaugeState< P, Q > > cgs)
Private initializer.
Rect gauge action.
Definition: rect_gaugeact.h:54
static T & Instance()
Definition: singleton.h:432
All gauge create-state method.
Fermion action factories.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams &param)
Read parameters.
Tree-level tadpole-improved Luscher-Weisz gauge action.
Handle< CreateGaugeState< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > reader(XMLReader &xml_in, const std::string &path)
Helper function for the CreateGaugeState readers.
bool registerAll()
Register all the factories.
GaugeAction< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createGaugeAct(XMLReader &xml, const std::string &path)
static bool registered
Local registration flag.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
LatticeFermion tmp
Definition: mespbg5p_w.cc:36
START_CODE()
::std::string string
Definition: gtest.h:1979