CHROMA
t_lower_tests.cc
Go to the documentation of this file.
1 //
2 // This is a collection of simple
3 // tests to make sure that none of
4 // the underlying routines have been
5 // broken.
6 //
7 //
8 //
9 
10 #include <iostream>
11 #include <cstdio>
12 
13 #include "chroma.h"
14 
15 using namespace Chroma;
16 
17 int main(int argc, char *argv[])
18 {
19  // Put the machine into a known state
20  Chroma::initialize(&argc, &argv);
21 
22  // Setup the layout
23  const int foo[] = {4,4,4,4};
24  multi1d<int> nrow(Nd);
25  nrow = foo; // Use only Nd elements
26  Layout::setLattSize(nrow);
27  Layout::create();
28 
29  XMLFileWriter& xml = Chroma::getXMLOutputInstance();
30  push(xml, "collection_of_unit_tests");
31 
32  push(xml,"lattis");
33  write(xml,"Nd", Nd);
34  write(xml,"Nc", Nc);
35  write(xml,"nrow", nrow);
36  pop(xml);
37 
38  // create a hot gauge gauge configuration
39  multi1d<LatticeColorMatrix> u(Nd);
41 
42  QDPIO::cerr << "Creating gauge configuration\n";
43  for(int m=0; m < u.size(); ++m)
44  gaussian(u[m]);
45 
46  // Reunitarize the gauge field
47  for(int m=0; m < u.size(); ++m)
48  reunit(u[m]);
49 
50  // Try out the plaquette routine
52  // Write out the results
53  push(xml,"gauge_observables");
54  write(xml,"config_type", "hot");
55  write(xml,"w_plaq", w_plaq);
56  write(xml,"link", link);
57  pop(xml);
58 
59  QDPIO::cerr << "Starting tests\n";
60 
61  //
62  // regression test the displacement operator
63  //
64 
65  push(xml,"simple_test");
66  write(xml,"testname", "displacement");
67 
68 
69  int length = 3 ;
70  int dir = 0 ;
71 
72  LatticePropagator chiA ;
73  LatticePropagator chiB ;
74 
75  gaussian(chiA) ;
76  chiB = chiA ;
77  displacement(u,chiA,length,dir);
78 
79  Double tmp_ = sum(real(trace(chiA*chiA)));
80  write(xml,"sumorg", tmp_);
81 
82  Double tmp = sum(real(trace(chiA*chiB)));
83  write(xml,"sum", tmp);
84 
85  pop(xml); // end of single test
86 
87  // final pop
88  pop(xml);
89 
90  xml.close();
91 
92  // Time to bolt
94 
95  exit(0);
96 }
Primary include file for CHROMA in application codes.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
LatticePropagator displacement(const multi1d< LatticeColorMatrix > &u, const LatticePropagator &chi, int length, int dir)
Apply a displacement operator to a lattice field.
static int m[4]
Definition: make_seeds.cc:16
Nd
Definition: meslate.cc:74
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
gaussian(aux)
static multi1d< LatticeColorMatrix > u
LatticeFermion tmp
Definition: mespbg5p_w.cc:36
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
XMLFileWriter & getXMLOutputInstance()
Get xml output instance.
Definition: chroma_init.cc:359
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
Double sum
Definition: qtopcor.cc:37
int main(int argc, char *argv[])