CHROMA
schr_sf_gaugebc.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Schroedinger functional base class
3  */
4 
5 #include "gaugebc.h"
6 
8 
9 namespace Chroma
10 {
11 
12  //! Construct the mask and boundary fields
13  void SchrSFGaugeBC::initBnd(multi1d<LatticeColorMatrix>& SFBndFld,
14  multi1d<LatticeBoolean>& lSFmask) const
15  {
16  START_CODE();
17 
18  SFBndFld.resize(Nd);
19  lSFmask.resize(Nd);
20 
21  int j_decay = getDir();
22  int igluetmp = getMaxExtent();
23 
24  /* First construct the masks indicating the boundaries */
25  LatticeInteger litmp = Layout::latticeCoordinate(j_decay);
26 
27  LatticeBoolean lbtest;
28  switch (igluetmp)
29  {
30  case 2:
31  /* if (coord(j_decay) == 0 || coord(j_decay) == latt_cb_size(j_decay)-2) then */
32  lbtest = (litmp == 0);
33  lbtest |= (litmp == (QDP::Layout::lattSize()[j_decay]-2));
34  /* endif */
35  break;
36 
37  case 1:
38  lbtest = false;
39  break;
40 
41  default:
42  QDPIO::cerr << "SchrSFGaugeBC: unsupported igluetmp = " << igluetmp << std::endl;
43  QDP_abort(1);
44  }
45 
46  /* if (coord(j_decay) == latt_cb_size(j_decay)-1) then */
47  lbtest |= (litmp == (QDP::Layout::lattSize()[j_decay]-1));
48  /* endif */
49 
50  lSFmask[j_decay] = lbtest;
51 
52  /* The remaining spatial directions */
53  switch(igluetmp)
54  {
55  case 2:
56  /* if (coord(j_decay) == 1) then */
57  lbtest |= (litmp == 1);
58  /* endif */
59  break;
60 
61  case 1:
62  break;
63  }
64 
65  /* if (coord(j_decay) == 0) then */
66  lbtest |= (litmp == 0);
67  /* endif */
68 
69  for(int mu = 0; mu < Nd; ++mu)
70  {
71  if (mu == j_decay) continue;
72 
73  lSFmask[mu] = lbtest;
74  }
75 // lSFmaskF = lbtest;
76 
77 
78  /*
79  * Construct the boundary fields
80  */
81 
82  /* In the j_decay direction they are 1 */
83  SFBndFld[j_decay] = 1;
84 
85  /* They are uniform in the spatial direction */
86  /* Here I am assuming a uniform diagonal boundary and general Nc */
87 
88  /* Construct the coordinates used */
89  int tval;
90  switch (igluetmp)
91  {
92  case 1:
93  tval = QDP::Layout::lattSize()[j_decay] - 1; /* construct T-x0 */
94  break;
95 
96  case 2:
97  tval = QDP::Layout::lattSize()[j_decay] - 2; /* construct T-x0 */
98  break;
99 
100  default:
101  QDP_error_exit("SchrSFGaugeBC: cannot get here");
102  }
103 
104  LatticeReal lftmp0(litmp);
105  LatticeReal lftmp1(tval - litmp);
106 
107  /* Construct the spatial phases. Only this part is specific to Nc==2,3 */
108  Phases_t phases = getPhases();
109  multi1d<Real> phi0 = phases.lower;
110  multi1d<Real> phi1 = phases.upper;
111 
112  /* Normalize. This is generic */
113  multi3d<Real> phi(Nd, Nc, 2);
114 
115  for(int mu = 0; mu < Nd; ++mu)
116  {
117  if (mu == j_decay) continue;
118 
119  Real ftmp = Real(1) / Real(tval * QDP::Layout::lattSize()[mu]);
120 
121  for(int i = 0; i < Nc; ++i)
122  {
123  phi[mu][i][0] = phi0[i] * ftmp;
124  phi[mu][i][1] = phi1[i] * ftmp;
125  }
126  }
127 
128  /* push(xml_out,"Setfsbc");
129  write(xml_out, "tval", tval);
130  write(xml_out, "phi0", phi0);
131  write(xml_out, "phi1", phi1);
132  write(xml_out, "phi", phi);
133  write(xml_out, "lftmp0", lftmp0);
134  write(xml_out, "lftmp1", lftmp1);
135  pop(xml_out); */
136 
137  /* Exponentiate the diagonal phases into the boundary fields */
138 
139  for(int mu = 0; mu < Nd; ++mu)
140  {
141  if (mu == j_decay) continue;
142 
143  SFBndFld[mu] = QDP::zero;
144 
145  LatticeReal lftmp;
146  for(int i = 0; i < Nc; ++i)
147  {
148  lftmp = lftmp0 * phi[mu][i][1];
149  lftmp += lftmp1 * phi[mu][i][0];
150 
151  pokeColor(SFBndFld[mu], cmplx(cos(lftmp),sin(lftmp)), i, i);
152  }
153  }
154 
155 
156 #if 0
157  XMLFileWriter xml_out("sf_bc.xml");
158  push(xml_out, "SFBC");
159  write(xml_out, "lSFmask", lSFmask);
160  write(xml_out, "SFBndFld", SFBndFld);
161  pop(xml_out);
162 #endif
163 
164  END_CODE();
165  }
166 
167 }
virtual const multi1d< LatticeColorMatrix > & SFBndFld() const =0
Fixed gauge links on only the lSFmask() sites.
virtual const multi1d< LatticeBoolean > & lSFmask() const =0
Mask which lattice sites have fixed gauge links.
virtual int getDir() const =0
Decay direction.
virtual int getMaxExtent() const =0
Maximum plaquette size. This is what knows about 1x1 plaq or 1x2 rect.
virtual const Phases_t & getPhases() const =0
Get the angles on the boundaries.
virtual void initBnd(multi1d< LatticeColorMatrix > &SFBndFld, multi1d< LatticeBoolean > &lSFmask) const
Construct the mask and boundary fields.
int mu
Definition: cool.cc:24
Gauge boundary conditions.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
const int igluetmp
Definition: mciter32.cc:19
int j_decay
Definition: meslate.cc:22
Nd
Definition: meslate.cc:74
LatticeReal phi
Definition: mesq.cc:27
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)
push(xml_out,"Condensates")
int i
Definition: pbg5p_w.cc:55
pop(xml_out)
START_CODE()
Double zero
Definition: invbicg.cc:106
Schroedinger gauge boundary conditions.
Structure holding phases.