CHROMA
mesphas_s.cc
Go to the documentation of this file.
1 
2 
3 /* This routine is specific to staggered fermions! */
4 
5 /* Compute the phase factors for the Nd staggered mesons. */
6 
7 /* meson_phases -- meson phase factors ( Write ) */
8 /* wall_meson_phases -- meson phase factors for wall mesons ( Write ) */
9 /* j_decay -- direction of meson propagators ( Read ) */
10 
11 #include "chromabase.h"
12 #include "mesphas_s.h"
13 
14 namespace Chroma {
15 
16  void MesPhas(multi1d<LatticeReal>& meson_phases,
17  int j_decay)
18  {
19  LatticeReal one;
20  LatticeReal negone;
21  multi1d<LatticeInteger> x(Nd);
22  multi1d<Real> sgnn(2);
23  int i;
24  int m;
25 
26 
27  meson_phases.resize(Nd);
28 
29 
30 
31  /* Start off by getting the coordinates of x(0), x(1), ..., x(Nd-3) */
32  i = 0;
33  for(m = 0;m < ( Nd); ++m ) {
34  if ( m != j_decay ) {
35  x[i] = Layout::latticeCoordinate(m);
36  i = i + 1;
37  }
38  }
39 
40  /* For convenience, define -1 and 1. */
41  one = 1;
42  negone = -one;
43 
44  sgnn[0] = 1;
45  sgnn[1] = -sgnn[0];
46 
47 
48  /* phase(0) = +1 */
49  meson_phases[0] = one;
50 
51  /* Deal with all other directions separately. Yuk. */
52 
53  /* NOTE: in the comments below I mean x0 is the true *non*-checkerboard */
54  /* x coordinate. Also, I assume the direction j_decay has been */
55  /* permuted such that j_decay == Nd. */
56  switch(Nd)
57  {
58  /*# phase(1) = (-1)**(x0) */
59  case 2:
60 
61  meson_phases[2] = where((x[0] & 1) == 0, LatticeReal(1), LatticeReal(-1));
62 
63  break;
64 
65 
66  /*# phase(1) = (-1)**(x0) + (-1)**(x1) */
67  /*# phase(2) = (-1)**(x0+x1) */
68  case 3:
69  /*## phase(1) = (-1)**(x0) + (-1)**(x1) */
70  /* even context => cb=0, x=even; cb=1, x=odd */
71 
72  meson_phases[1] = where((x[0] & 1) == 0, LatticeReal(1), LatticeReal(-1))
73  + where((x[1] & 1) == 0, LatticeReal(1), LatticeReal(-1));
74 
75  /*## phase(2) = (-1)**(x0+x1) */
76  /* even context => cb=0, x=even; cb=1, x=odd */
77 
78  meson_phases[2] = where(((x[0]+x[1]) & 1) == 0, LatticeReal(1), LatticeReal(-1));
79 
80  break;
81 
82 
83  /*# phase(1) = (-1)**(x0) + (-1)**(x1) + (-1)**(x2) */
84  /*# phase(2) = (-1)**(x0+x1) + (-1)**(x0+x2) + (-1)**(x1+x2) */
85  /*# phase(3) = (-1)**(x0+x1+x2) */
86  case 4:
87 
88  /*## phase(1) = (-1)**(x0) + (-1)**(x1) + (-1)**(x2) */
89  meson_phases[1] = where((x[0] & 1) == 0, LatticeReal(1), LatticeReal(-1))
90  + where((x[1] & 1) == 0, LatticeReal(1), LatticeReal(-1))
91  + where((x[2] & 1) == 0, LatticeReal(1), LatticeReal(-1));
92 
93  /*## phase(2) = (-1)**(x0+x1) + (-1)**(x0+x2) + (-1)**(x1+x2) */
94  meson_phases[2] = where(((x[0]+x[1]) & 1) == 0, LatticeReal(1), LatticeReal(-1))
95  + where(((x[0]+x[2]) & 1) == 0, LatticeReal(1), LatticeReal(-1))
96  + where(((x[1]+x[2]) & 1) == 0, LatticeReal(1), LatticeReal(-1));
97 
98  /*## phase(3) = (-1)**(x0+x1+x2) */
99  meson_phases[3] = where(((x[0]+x[1]+x[2]) & 1) == 0, LatticeReal(1), LatticeReal(-1));
100 
101  break;
102 
103  default:
104  QDP_error_exit("Can only handle d=2 3 4 dimensions", Nd);
105  }
106 
107 
108  }
109 
110 } // end namespace Chroma
Primary include file for CHROMA library code.
static int m[4]
Definition: make_seeds.cc:16
int j_decay
Definition: meslate.cc:22
int x
Definition: meslate.cc:34
Nd
Definition: meslate.cc:74
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
QDP_error_exit("too many BiCG iterations", n_count, rsd_sq, cp, c, re_rvr, im_rvr, re_a, im_a, re_b, im_b)
Double one
Definition: invbicg.cc:105
int i
Definition: pbg5p_w.cc:55
void MesPhas(multi1d< LatticeReal > &meson_phases, int j_decay)
Definition: mesphas_s.cc:16