CHROMA
t_ape_smear.cc
Go to the documentation of this file.
1 
2 #include <iostream>
3 #include <cstdio>
4 
5 #include "chroma.h"
6 
7 using namespace Chroma;
8 
9 int main(int argc, char *argv[])
10 {
11  // Put the machine into a known state
12  Chroma::initialize(&argc, &argv);
13 
14  // Setup the layout
15  const int foo[] = {4,4,4,4};
16  multi1d<int> nrow(Nd);
17  nrow = foo; // Use only Nd elements
18  Layout::setLattSize(nrow);
19  Layout::create();
20 
21  XMLFileWriter xml("t_ape_smear.xml");
22  push(xml, "t_ape_smear");
23 
24  push(xml,"lattis");
25  write(xml,"Nd", Nd);
26  write(xml,"Nc", Nc);
27  write(xml,"nrow", nrow);
28  pop(xml);
29 
30  //! Example of calling a plaquette routine
31  /*! NOTE: the STL is *not* used to hold gauge fields */
32  multi1d<LatticeColorMatrix> u(Nd);
34 
35  QDPIO::cerr << "Start gaussian\n";
36  for(int m=0; m < u.size(); ++m)
37  gaussian(u[m]);
38 
39  // Reunitarize the gauge field
40  for(int m=0; m < u.size(); ++m)
41  reunit(u[m]);
42 
43  // Try out the plaquette routine
45  QDPIO::cout << "w_plaq = " << w_plaq << std::endl;
46  QDPIO::cout << "link = " << link << std::endl;
47 
48  // Write out the results
49  push(xml,"observables");
50  write(xml,"w_plaq", w_plaq);
51  write(xml,"link", link);
52  pop(xml);
53 
54 
55  // Now APE smear the gauge field
56  int j_decay = Nd - 1;
57 
58  Real sm_fact = 2.5; // typical parameter
59  int sm_numb = 10; // number of smearing hits
60 
61  int BlkMax = 100; // max iterations in max-ing trace
62  Real BlkAccu = 1.0e-5; // accuracy of max-ing
63 
64  multi1d<LatticeColorMatrix> u_smr(Nd);
65  u_smr = u;
66  for(int i=0; i < sm_numb; ++i)
67  {
68  multi1d<LatticeColorMatrix> u_tmp(Nd);
69 
70  for(int mu = 0; mu < Nd; ++mu)
71  if ( mu != j_decay )
72  APE_Smear(u_smr, u_tmp[mu], mu, 0, sm_fact, BlkAccu, BlkMax, j_decay);
73  else
74  u_tmp[mu] = u_smr[mu];
75 
76  u_smr = u_tmp;
77  }
78 
79  // Compute plaquette on smeared links
80  MesPlq(u_smr, w_plaq, s_plaq, t_plaq, link);
81  QDPIO::cout << "w_plaq = " << w_plaq << std::endl;
82  QDPIO::cout << "link = " << link << std::endl;
83 
84  // Write out the results
85  push(xml,"Smeared_observables");
86  write(xml,"w_plaq", w_plaq);
87  write(xml,"link", link);
88  pop(xml);
89 
90  pop(xml);
91 
92  // Time to bolt
94 
95  exit(0);
96 }
Primary include file for CHROMA in application codes.
int mu
Definition: cool.cc:24
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
void APE_Smear(const multi1d< LatticeColorMatrix > &u, LatticeColorMatrix &u_smear, int mu, int bl_level, const Real &sm_fact, const Real &BlkAccu, int BlkMax, int j_decay)
Construct APE smeared links from:
Definition: ape_smear.cc:44
static int m[4]
Definition: make_seeds.cc:16
int j_decay
Definition: meslate.cc:22
Nd
Definition: meslate.cc:74
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
gaussian(aux)
static multi1d< LatticeColorMatrix > u
push(xml_out,"Condensates")
int i
Definition: pbg5p_w.cc:55
void initialize(int *argc, char ***argv)
Chroma initialisation routine.
Definition: chroma_init.cc:114
void finalize(void)
Chroma finalization routine.
Definition: chroma_init.cc:308
void reunit(LatticeColorMatrixF3 &xa)
Definition: reunit.cc:467
pop(xml_out)
void MesPlq(const multi1d< LatticeColorMatrixF3 > &u, multi2d< Double > &plane_plaq, Double &link)
Definition: mesplq.cc:83
FloatingPoint< double > Double
Definition: gtest.h:7351
Double link
Definition: pade_trln_w.cc:146
Double t_plaq
Definition: pade_trln_w.cc:145
Double w_plaq
Definition: pade_trln_w.cc:143
Double s_plaq
Definition: pade_trln_w.cc:144
int main(int argc, char *argv[])
Definition: t_ape_smear.cc:9