CHROMA
srcfil.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Point source construction
3  */
4 
5 #include "chromabase.h"
6 #include "meas/sources/srcfil.h"
7 
8 namespace Chroma
9 {
10 
11  //! Fill a specific color and spin index with 1.0
12  /*!
13  * \ingroup sources
14  *
15  * This routine is specific to Wilson fermions!
16  *
17  * \param a Source fermion
18  * \param coord Lattice coordinate
19  * \param color_index Color index
20  * \param spin_index Spin index
21  */
22 
23  void srcfil(LatticeFermion& a, const multi1d<int>& coord, int color_index, int spin_index)
24  {
25  if (color_index >= Nc || color_index < 0)
26  QDP_error_exit("invalid color index", color_index);
27 
28  if (spin_index >= Ns || spin_index < 0)
29  QDP_error_exit("invalid spin index", spin_index);
30 
31  Real one = 1;
32  Complex sitecomp = cmplx(one,0);
33  ColorVector sitecolor = zero;
34  Fermion sitefield = zero;
35 
36  // Put [1,0] into the fermion a
37  pokeSite(a,
38  pokeSpin(sitefield,
39  pokeColor(sitecolor,sitecomp,color_index),
40  spin_index),
41  coord);
42  }
43 
44 
45  //! Fill a specific color index with 1.0
46  /*!
47  * This routine is specific to Wilson fermions!
48  *
49  * \param a Source lattice Color Vector
50  * \param coord Lattice coordinate
51  * \param color_index Color index
52  */
53 
54  void srcfil(LatticeColorVector& a, const multi1d<int>& coord, int color_index)
55  {
56  if (color_index >= Nc || color_index < 0)
57  QDP_error_exit("invalid color index", color_index);
58 
59  Real one = 1;
60  Complex sitecomp = cmplx(one,0);
61  ColorVector sitecolor = zero;
62 
63  // Put [1,0] into the fermion a
64  pokeSite(a,
65  pokeColor(sitecolor,sitecomp,color_index),
66  coord);
67  }
68 
69 
70  //! Fill a specific color and spin index with 1.0
71  /*!
72  * \ingroup sources
73  *
74  * This routine is specific to Staggered fermions!
75  *
76  * \param a Source fermion
77  * \param coord Lattice coordinate
78  * \param color_index Color index
79  */
80 
81  void srcfil(LatticeStaggeredFermion& a, const multi1d<int>& coord, int color_index)
82  {
83  if (color_index >= Nc || color_index < 0)
84  QDP_error_exit("invalid color index", color_index);
85 
86  Real one = 1;
87  Complex sitecomp = cmplx(one,0);
88  ColorVector sitecolor = zero;
89  StaggeredFermion sitefield = zero;
90 
91  const int spin_index = 0 ;
92 
93  // Put [1,0] into the fermion a
94  pokeSite(a,
95  pokeSpin(sitefield,
96  pokeColor(sitecolor,sitecomp,color_index),
97  spin_index),
98  coord);
99  }
100 
101 } // end namespace Chroma
102 
Primary include file for CHROMA library code.
void srcfil(LatticeFermion &a, const multi1d< int > &coord, int color_index, int spin_index)
Fill a specific color and spin index with 1.0.
Definition: srcfil.cc:23
multi1d< int > coord(Nd)
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
Complex a
Definition: invbicg.cc:95
Double zero
Definition: invbicg.cc:106
Point source construction.