16 #ifdef USE_FACTORY_AUTOREGISTER
18 bool init = Source_MomentumWall::register_factory();
33 std::vector<int> source_position;
34 std::vector<int> source_momentum;
61 const std::vector<int>& source_momentum)
65 const int t_dir = Ndim - 1;
68 std::vector<int> Lsize(Ndim);
79 vout.
general(
m_vl,
"Source for spinor field - momentum wall smeared:\n");
80 for (
int mu = 0; mu < Ndim; ++mu) {
82 mu, source_position[mu]);
84 for (
int mu = 0; mu < Ndim - 1; ++mu) {
86 mu, source_momentum[mu]);
92 for (
int mu = 0; mu < Ndim; ++mu) {
104 for (
int mu = 0; mu < Ndim; ++mu) {
131 const int t_dir = Ndim - 1;
137 const int Lvol3 = Lx * Ly * Lz;
145 static const double PI = 4.0 * atan(1.0);
147 std::vector<double> p_unit(Ndim - 1);
153 std::vector<int> ipe(Ndim - 1);
164 for (
int z = 0; z < Nz; ++z) {
165 for (
int y = 0; y < Ny; ++y) {
166 for (
int x = 0; x < Nx; ++x) {
169 int x_global = x + ipe[x_dir] * Nx;
170 int y_global = y + ipe[y_dir] * Ny;
171 int z_global = z + ipe[z_dir] * Nz;
177 double theta = p_x + p_y + p_z;
180 int idx_i = 2 *
idx + 1;
183 src.
set(idx_r, site, 0, cos(theta) / Lvol3);
184 src.
set(idx_i, site, 0, sin(theta) / Lvol3);
196 const int idx = i_color + Nc * i_spin;
211 const int t_dir = Ndim - 1;
217 const int Lvol3 = Lx * Ly * Lz;
225 static const double PI = 4.0 * atan(1.0);
227 std::vector<double> p_unit(Ndim - 1);
233 std::vector<int> ipe(Ndim - 1);
244 for (
int z = 0; z < Nz; ++z) {
245 for (
int y = 0; y < Ny; ++y) {
246 for (
int x = 0; x < Nx; ++x) {
249 int x_global = x + ipe[x_dir] * Nx;
250 int y_global = y + ipe[y_dir] * Ny;
251 int z_global = z + ipe[z_dir] * Nz;
257 double theta = p_x + p_y + p_z;
259 for (
int i_color = 0; i_color < Nc; ++i_color) {
260 int idx = i_color + Nc * i_spin;
262 int idx_i = 2 *
idx + 1;
265 src.
set(idx_r, site, 0, cos(theta) / Lvol3);
266 src.
set(idx_i, site, 0, sin(theta) / Lvol3);
285 const int t_dir = Ndim - 1;
291 const int Lvol3 = Lx * Ly * Lz;
299 static const double PI = 4.0 * atan(1.0);
301 std::vector<double> p_unit(Ndim - 1);
307 std::vector<int> ipe(Ndim - 1);
318 for (
int z = 0; z < Nz; ++z) {
319 for (
int y = 0; y < Ny; ++y) {
320 for (
int x = 0; x < Nx; ++x) {
323 int x_global = x + ipe[x_dir] * Nx;
324 int y_global = y + ipe[y_dir] * Ny;
325 int z_global = z + ipe[z_dir] * Nz;
331 double theta = p_x + p_y + p_z;
333 for (
int idx = 0;
idx < Nc * Nd; ++
idx) {
335 int idx_i = 2 *
idx + 1;
338 src.
set(idx_r, site, 0, cos(theta) / Lvol3);
339 src.
set(idx_i, site, 0, sin(theta) / Lvol3);