CHROMA
t_formfac.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Test the form-factor routine
3  */
4 
5 #include <iostream>
6 #include <cstdio>
7 
8 #include "chroma.h"
9 
10 using namespace Chroma;
11 
12 int main(int argc, char *argv[])
13 {
14  // Put the machine into a known state
15  Chroma::initialize(&argc, &argv);
16 
17  // Setup the layout
18  const int foo[] = {4,4,4,4};
19  multi1d<int> nrow(Nd);
20  nrow = foo; // Use only Nd elements
21  Layout::setLattSize(nrow);
22  Layout::create();
23 
24  XMLFileWriter xml("t_formfac.xml");
25 
26  push(xml,"lattice");
27  write(xml,"Nd", Nd);
28  write(xml,"Nc", Nc);
29  write(xml,"Ns", Ns);
30  write(xml,"nrow", nrow);
31  pop(xml);
32 
33  // Randomize the gauge field
34  multi1d<LatticeColorMatrix> u(Nd);
35 
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  LatticePropagator quark_prop_1, quark_prop_2;
44  gaussian(quark_prop_1);
45  gaussian(quark_prop_2);
46 
47  // propagation direction
48  int j_decay = Nd-1;
49 
50  // source timeslice
51  int t0 = 0 ;
52 
53  // sink momentum {1,0,0}
54  multi1d<int> sink_mom(Nd-1) ;
55  sink_mom = 0 ;
56  sink_mom[0] = 1 ;
57 
58  clock_t start_clock = clock() ;
59 
60  // create Fourier phases with (mom-sink_mom)^2 <= 10 (NO AVERAGING)
61  SftMom phases(10, sink_mom, false, j_decay) ;
62 
63  FormFac(u, quark_prop_1, quark_prop_2, phases, t0, xml) ;
64 
65  clock_t end_clock = clock() ;
66 
67  QDPIO::cout << "Test took " << end_clock - start_clock << " clocks.\n" ;
68 
69  // Time to bolt
71 
72  exit(0);
73 }
74 
Primary include file for CHROMA in application codes.
Fourier transform phase factor support.
Definition: sftmom.h:35
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
void FormFac(FormFac_insertions_t &form, const multi1d< LatticeColorMatrix > &u, const LatticePropagator &quark_propagator, const LatticePropagator &seq_quark_prop, int gamma_insertion, const SftMom &phases, int t0)
Compute contractions for current insertion 3-point functions.
Definition: formfac_w.cc:92
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")
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)
int main(int argc, char *argv[])
Definition: t_formfac.cc:12