CHROMA
writeszinqprop_w.cc
Go to the documentation of this file.
1 /*!
2  * @file
3  * @brief Write an old SZIN-style (checkerboarded) quark propagator
4  */
5 
6 #include "chromabase.h"
7 #include "io/writeszinqprop_w.h"
8 
9 #include "qdp_util.h" // from QDP++
10 
11 namespace Chroma {
12 
13 //! Write a SZIN propagator file. This is a simple memory dump writer.
14 /*!
15  * \ingroup io
16  *
17  * \param q propagator ( Read )
18  * \param file path ( Read )
19  * \param kappa kappa value (Read)
20  */
21 
22 void writeSzinQprop(const LatticePropagator& q, const std::string& file,
23  const Real& kappa)
24 {
25  BinaryFileWriter cfg_out(file);
26 
27  //
28  // Write propagator field
29  //
30  multi1d<int> lattsize_cb = Layout::lattSize();
31 
32  lattsize_cb[0] /= 2; // checkerboard in the x-direction in szin
33 
34  // Write Kappa
35  write(cfg_out, kappa);
36 
37  // Write prop
38  LatticePropagator q_old = transpose(q); // Take the transpose
39 
40  for(int cb=0; cb < 2; ++cb)
41  {
42  for(int sitecb=0; sitecb < Layout::vol()/2; ++sitecb)
43  {
44  multi1d<int> coord = crtesn(sitecb, lattsize_cb);
45 
46  // construct the checkerboard offset
47  int sum = 0;
48  for(int m=1; m<Nd; m++)
49  sum += coord[m];
50 
51  // The true lattice x-coord
52  coord[0] = 2*coord[0] + ((sum + cb) & 1);
53 
54  write(cfg_out, q_old, coord); // write out a single site
55  }
56  }
57 
58  cfg_out.close();
59 }
60 
61 } // end namespace Chroma
Primary include file for CHROMA library code.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
void writeSzinQprop(const LatticePropagator &q, const std::string &file, const Real kappa)
Write a SZIN propagator file. This is a simple memory dump writer.
static int m[4]
Definition: make_seeds.cc:16
multi1d< int > coord(Nd)
Nd
Definition: meslate.cc:74
Double q
Definition: mesq.cc:17
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
void transpose(multi2d< LatticeColorVector > &dist_rep, const multi2d< LatticeColorVector > &prop_rep)
Take transpose of a matrix in (explicit) spin space.
int cb
Definition: invbicg.cc:120
::std::string string
Definition: gtest.h:1979
int kappa
Definition: pade_trln_w.cc:112
Double sum
Definition: qtopcor.cc:37
Write out a SZIN propagator.