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