CHROMA
t_fuzwilp.cc
Go to the documentation of this file.
1 
2 #include <iostream>
3 #include <cstdio>
4 #include <time.h>
5 
6 #include "chroma.h"
7 
8 using namespace Chroma;
9 
10 int main(int argc, char *argv[])
11 {
12  // Put the machine into a known state
13  Chroma::initialize(&argc, &argv);
14 
15  // Setup the layout
16 // const int foo[] = {4,4,4,4};
17  const int foo[] = {16,16,16,32};
18 // const int foo[] = {20,20,20,64};
19 
20  multi1d<int> nrow(Nd);
21  nrow = foo; // Use only Nd elements
22  Layout::setLattSize(nrow);
23  Layout::create();
24 
25  XMLFileWriter xml("t_fuzwilp.xml");
26  push(xml, "t_fuzwilp");
27 
28  push(xml,"lattice");
29  write(xml,"Nd",Nd);
30  write(xml,"Nc",Nc);
31  write(xml,"nrow",nrow);
32  pop(xml);
33 
34  //! Example of calling a plaquette routine
35  /*! NOTE: the STL is *not* used to hold gauge fields */
36  multi1d<LatticeColorMatrix> u(Nd);
38 
39 /*
40  QDPIO::cerr << "Start gaussian\n";
41  for(int m=0; m < u.size(); ++m)
42  gaussian(u[m]);
43 */
44 
45 
46  XMLReader gauge_xml;
47  std::string gaugeFilename;
48 
49  gaugeFilename="/raidd/aci/configs/getlat.1200";
50 // gaugeFilename="/raidd/aci/chromaqdp/chroma/tests/t_asqtad_prop/t_nersc.cfg";
51 // gaugeFilename="/raidd/aci/configs/u_MILC_2064f21b681m030m050.246";
52 
53  QDPIO::cout << "Reading config: " << gaugeFilename << std::endl;
54  readArchiv(gauge_xml, u, gaugeFilename);
55 
56  // Reunitarize the gauge field
57  for(int m=0; m < u.size(); ++m)
58  reunit(u[m]);
59 
60 // Check gauge invariance here if required
61 // rgauge(u);
62 // QDPIO::cout << "Random gauge transformation for testing " << std::endl;
63 
64  // Try out the plaquette routine
65  QDPIO::cout << "Measure the plaquette and link " << std::endl;
66 
67  StopWatch swatch;
68  swatch.start();
69 
71 
72  swatch.stop();
73  double time_in_sec = swatch.getTimeInSeconds();
74 
75  QDPIO::cout << "w_plaq = " << w_plaq << std::endl;
76  QDPIO::cout << "s_plaq = " << s_plaq << std::endl;
77  QDPIO::cout << "t_plaq = " << t_plaq << std::endl;
78  QDPIO::cout << "link = " << link << std::endl;
79 
80  QDPIO::cout << "Measurement took " << time_in_sec
81  << " secs" << std::endl;
82 
83  // Write out the results
84  push(xml,"observables");
85  write(xml,"w_plaq",w_plaq);
86  write(xml,"w_link",link);
87 
88 
89 
90  // Now try calling the fuzzed Wilson loop routine
91  QDPIO::cout << "Measure ape-smeared Wilson loops" << std::endl;
92  int j_decay = Nd - 1;
93 
94  Real sm_fact = 2.5; // typical parameter
95  int n_smear = 0; // number of smearing hits
96 
97  int BlkMax = 100; // max iterations in max-ing trace
98  Real BlkAccu = 1.0e-5; // accuracy of max-ing
99  int tmax = 3 ;
100 
101  QDPIO::cout << "sm_fact: " << sm_fact << std::endl;
102  QDPIO::cout << "n_smear: " << n_smear << std::endl;
103 
104  swatch.reset();
105  swatch.start();
106 
107  fuzwilp(u, j_decay, tmax, n_smear, sm_fact, BlkAccu, BlkMax, xml,
108  "Fuzzed_Wilson_Loops");
109 
110  swatch.stop();
111  time_in_sec = swatch.getTimeInSeconds();
112  QDPIO::cout << "Loop measurements complete" << std::endl;
113  QDPIO::cout << "Measurement took " << time_in_sec
114  << " secs" << std::endl;
115 
116  pop(xml);
117  pop(xml);
118 
119  // Time to bolt
121 
122  exit(0);
123 }
Primary include file for CHROMA in application codes.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
void fuzwilp(const multi1d< LatticeColorMatrix > &u, int j_decay, int tmax, int n_smear, const Real &sm_fact, const Real &BlkAccu, int BlkMax, XMLWriter &xml, const std::string &xml_group)
Calculate ape-fuzzed Wilson loops.
Definition: fuzwilp.cc:38
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
static multi1d< LatticeColorMatrix > u
push(xml_out,"Condensates")
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
::std::string string
Definition: gtest.h:1979
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_fuzwilp.cc:10