32 int Nspc_size, Ntmp_size, Ntype;
35 err += params.
fetch_int(
"max_spatial_loop_size", Nspc_size);
36 err += params.
fetch_int(
"max_temporal_loop_size", Ntmp_size);
37 err += params.
fetch_int(
"number_of_loop_type", Ntype);
103 m_Nmax[2] = Nspc_size / 2;
105 m_Nmax[4] = Nspc_size / 2;
106 m_Nmax[5] = Nspc_size / 2;
120 const int Ndim_spc = Ndim - 1;
163 const int Ndim_spc = Ndim - 1;
180 for (
size_t i = 0, n = wloop.size(); i < n; ++i) {
185 for (
int i_type = 0; i_type <
m_Ntype; ++i_type) {
187 for (
int nu = 0; nu < Ndim_spc; ++nu) {
188 std::vector<int> unit_v(Ndim_spc);
189 unit_v[0] =
m_Nunit[i_type][nu % Ndim_spc];
190 unit_v[1] =
m_Nunit[i_type][(1 + nu) % Ndim_spc];
191 unit_v[2] =
m_Nunit[i_type][(2 + nu) % Ndim_spc];
193 int unit_v_max = unit_v[0];
194 if (unit_v_max < unit_v[1]) unit_v_max = unit_v[1];
195 if (unit_v_max < unit_v[2]) unit_v_max = unit_v[2];
198 for (
int site = 0; site <
m_Nvol_ext; ++site) {
202 int Nmax =
m_Nmax[i_type];
203 for (
int j = 0; j < Nmax; ++j) {
208 for (
int t_sep = 0; t_sep <
m_Ntmp_size; ++t_sep) {
211 i_type, nu, j + 1, t_sep + 1, wloop1);
212 wloop[
index_wloop(j, t_sep, i_type)] += wloop1 / 3.0;
220 std::ofstream log_file;
227 for (
int i_type = 0; i_type <
m_Ntype; ++i_type) {
228 int Nmax =
m_Nmax[i_type];
229 for (
int x_sep = 0; x_sep < Nmax; ++x_sep) {
230 for (
int t_sep = 0; t_sep <
m_Ntmp_size; ++t_sep) {
232 i_type + 1, x_sep + 1, t_sep + 1, wloop[
index_wloop(x_sep, t_sep, i_type)]);
263 double wloop_r = 0.0;
264 double wloop_i = 0.0;
266 for (
int t = 0; t < Nt; ++t) {
267 for (
int z = 0; z < Nz; ++z) {
268 for (
int y = 0; y < Ny; ++y) {
269 for (
int x = 0; x < Nx; ++x) {
270 int site1 = index_ext.
site(x, y, z, t);
271 int site2 = index_ext.
site(x, y, z, t + t_sep);
274 Utmp1 = Uspc.
mat(site1, 0);
277 Utmp2 = Uspc.
mat_dag(site2, 0);
280 Utmp3 = Utmp1 * Utmp2;
282 wloop_r +=
ReTr(Utmp3);
283 wloop_i +=
ImTr(Utmp3);
292 wloop_r = wloop_r / Nc / Nvol / NPE;
293 wloop_i = wloop_i / Nc / Nvol / NPE;
301 const int j,
const int nu,
const std::vector<int>& unit_v)
310 int unit_v_max = unit_v[0];
312 if (unit_v_max < unit_v[1]) unit_v_max = unit_v[1];
313 if (unit_v_max < unit_v[2]) unit_v_max = unit_v[2];
321 for (
int k = 0; k < 3 * unit_v_max; ++k) {
322 int kmod = (k + 3 - nu) % 3;
324 if ((kmod == 0) && (imx < unit_v[0])) {
325 for (
int t = 0; t <
m_Nt_ext; ++t) {
326 for (
int z = 0; z < Nz; ++z) {
327 for (
int y = 0; y < Ny; ++y) {
328 for (
int x = 0; x < Nx; ++x) {
329 int x2 = x + unit_v[0] * j + imx;
330 int y2 = y + unit_v[1] * j + imy;
331 int z2 = z + unit_v[2] * j + imz;
333 int site1 = index_ext.
site(x, y, z, t);
334 int site2 = index_ext.
site(x2, y2, z2, t);
337 Utmp1 = Uspc.
mat(site1, 0);
340 Utmp2 = Uext.
mat(site2, 0);
343 Utmp3 = Utmp1 * Utmp2;
353 if ((kmod == 1) && (imy < unit_v[1])) {
354 for (
int t = 0; t <
m_Nt_ext; ++t) {
355 for (
int z = 0; z < Nz; ++z) {
356 for (
int y = 0; y < Ny; ++y) {
357 for (
int x = 0; x < Nx; ++x) {
358 int x2 = x + unit_v[0] * j + imx;
359 int y2 = y + unit_v[1] * j + imy;
360 int z2 = z + unit_v[2] * j + imz;
362 int site1 = index_ext.
site(x, y, z, t);
363 int site2 = index_ext.
site(x2, y2, z2, t);
366 Utmp1 = Uspc.
mat(site1, 0);
369 Utmp2 = Uext.
mat(site2, 1);
372 Utmp3 = Utmp1 * Utmp2;
382 if ((kmod == 2) && (imz < unit_v[2])) {
383 for (
int t = 0; t <
m_Nt_ext; ++t) {
384 for (
int z = 0; z < Nz; ++z) {
385 for (
int y = 0; y < Ny; ++y) {
386 for (
int x = 0; x < Nx; ++x) {
387 int x2 = x + unit_v[0] * j + imx;
388 int y2 = y + unit_v[1] * j + imy;
389 int z2 = z + unit_v[2] * j + imz;
391 int site1 = index_ext.
site(x, y, z, t);
392 int site2 = index_ext.
site(x2, y2, z2, t);
395 Utmp1 = Uspc.
mat(site1, 0);
398 Utmp2 = Uext.
mat(site2, 2);
401 Utmp3 = Utmp1 * Utmp2;
422 const int NinG = Uorg.
nin();
430 for (
int it = 0; it < Nt; ++it) {
431 for (
int iz = 0; iz < Nz; ++iz) {
432 for (
int iy = 0; iy < Ny; ++iy) {
433 for (
int ix = 0; ix < Nx; ++ix) {
434 int site1 = index_lex.
site(ix, iy, iz, it);
435 int site2 = index_ext.
site(ix, iy, iz, it);
437 for (
int ex = 0; ex < Ndim; ++ex) {
457 const int size_ex = NinG * Nvol_cp * Ndim;
461 for (
int it_off = 0; it_off <
m_Ntmp_size + 1; ++it_off) {
462 for (
int iz = 0; iz <
m_Nz_ext; ++iz) {
463 for (
int iy = 0; iy <
m_Ny_ext; ++iy) {
464 for (
int ix = 0; ix <
m_Nx_ext; ++ix) {
465 int site1 = index_ext.
site(ix, iy, iz, it_off);
468 for (
int ex = 0; ex < Ndim; ++ex) {
477 for (
int iz = 0; iz <
m_Nz_ext; ++iz) {
478 for (
int iy = 0; iy <
m_Ny_ext; ++iy) {
479 for (
int ix = 0; ix <
m_Nx_ext; ++ix) {
481 int site2 = index_ext.
site(ix, iy, iz, Nt + it_off);
483 for (
int ex = 0; ex < Ndim; ++ex) {
492 for (
int iz_off = 0; iz_off <
m_Nspc_size + 1; ++iz_off) {
493 for (
int it = 0; it <
m_Nt_ext; ++it) {
494 for (
int iy = 0; iy <
m_Ny_ext; ++iy) {
495 for (
int ix = 0; ix <
m_Nx_ext; ++ix) {
496 int site1 = index_ext.
site(ix, iy, iz_off, it);
499 for (
int ex = 0; ex < Ndim; ++ex) {
508 for (
int it = 0; it <
m_Nt_ext; ++it) {
509 for (
int iy = 0; iy <
m_Ny_ext; ++iy) {
510 for (
int ix = 0; ix <
m_Nx_ext; ++ix) {
512 int site2 = index_ext.
site(ix, iy, Nz + iz_off, it);
514 for (
int ex = 0; ex < Ndim; ++ex) {
523 for (
int iy_off = 0; iy_off <
m_Nspc_size + 1; ++iy_off) {
524 for (
int it = 0; it <
m_Nt_ext; ++it) {
525 for (
int iz = 0; iz <
m_Nz_ext; ++iz) {
526 for (
int ix = 0; ix <
m_Nx_ext; ++ix) {
527 int site1 = index_ext.
site(ix, iy_off, iz, it);
530 for (
int ex = 0; ex < Ndim; ++ex) {
539 for (
int it = 0; it <
m_Nt_ext; ++it) {
540 for (
int iz = 0; iz <
m_Nz_ext; ++iz) {
541 for (
int ix = 0; ix <
m_Nx_ext; ++ix) {
543 int site2 = index_ext.
site(ix, Ny + iy_off, iz, it);
545 for (
int ex = 0; ex < Ndim; ++ex) {
554 for (
int ix_off = 0; ix_off <
m_Nspc_size + 1; ++ix_off) {
555 for (
int it = 0; it <
m_Nt_ext; ++it) {
556 for (
int iz = 0; iz <
m_Nz_ext; ++iz) {
557 for (
int iy = 0; iy <
m_Ny_ext; ++iy) {
558 int site1 = index_ext.
site(ix_off, iy, iz, it);
561 for (
int ex = 0; ex < Ndim; ++ex) {
570 for (
int it = 0; it <
m_Nt_ext; ++it) {
571 for (
int iz = 0; iz <
m_Nz_ext; ++iz) {
572 for (
int iy = 0; iy <
m_Ny_ext; ++iy) {
574 int site2 = index_ext.
site(Nx + ix_off, iy, iz, it);
576 for (
int ex = 0; ex < Ndim; ++ex) {
592 const int dir_t = Ndim - 1;
596 for (
int it = 1; it <
m_Nt_ext; ++it) {
597 for (
int iz = 0; iz <
m_Nz_ext; ++iz) {
598 for (
int iy = 0; iy <
m_Ny_ext; ++iy) {
599 for (
int ix = 0; ix <
m_Nx_ext; ++ix) {
600 int site0 = index_ext.
site(ix, iy, iz, it - 1);
603 Utrf1 = Uext.
mat(site0, dir_t);
606 Utrf2 = Uext.
mat_dag(site0, dir_t);
609 Utmp2 = Utrf1 * Utrf2;
613 int site1 = index_ext.
site(ix, iy, iz, it);
615 for (
int ex = 0; ex < Ndim; ++ex) {
617 Utmp = Uext.
mat(site1, ex);
618 Utmp2 = Utrf1 * Utmp;
619 Uext.
set_mat(site1, ex, Utmp2);
623 int site2 = index_ext.
site(ix - 1, iy, iz, it);
626 Utmp = Uext.
mat(site2, 0);
627 Utmp2 = Utmp * Utrf2;
632 int site2 = index_ext.
site(ix, iy - 1, iz, it);
635 Utmp = Uext.
mat(site2, 1);
636 Utmp2 = Utmp * Utrf2;
641 int site2 = index_ext.
site(ix, iy, iz - 1, it);
644 Utmp = Uext.
mat(site2, 2);
645 Utmp2 = Utmp * Utrf2;