static double c_reader(int mu, int nu, const int pos[NDIM], int a, int b, int re_im, void *e) { int xm, xn, d; for (d = 0, xm = 0; xm < NDIM; xm++) { for (xn = xm + 1; xn < NDIM; xn++, d++) { if ((xm == mu) && (xn == nu)) goto found; } } return 0.0; found: { QLA_Real xx; QLA_ColorMatrix *m = QDP_expose_M(C[d]); int n = QDP_node_number(pos); int i = QDP_index(pos); assert(n == self); if (re_im == 0) { QLA_r_eq_Re_c(xx, QLA_elem_M(m[i], a, b)); } else { QLA_r_eq_Im_c(xx, QLA_elem_M(m[i], a, b)); } QDP_reset_M(C[d]); return xx; } }
int node_number(int x, int y, int z, int t) { int c[4]; c[0] = x; c[1] = y; c[2] = z; c[3] = t; return QDP_node_number(c); }
static void f_writer(const int pos[4], int c, int d, int re_im, double v, void *env) { int n = QDP_node_number(pos); int i = QDP_index(pos); QDP_DiracFermion *f = (QDP_DiracFermion *)env; QLA_DiracFermion *df = QDP_expose_D(f); assert(n == self); if (re_im == 0) { QLA_real(QLA_elem_D(df[i], c, d)) = v; } else { QLA_imag(QLA_elem_D(df[i], c, d)) = v; } QDP_reset_D(f); }
static double f_reader(const int pos[NDIM], int c, int d, int re_im, void *env) { QLA_Real xx; int n = QDP_node_number(pos); int i = QDP_index(pos); QDP_DiracFermion *f = (QDP_DiracFermion *)env; QLA_DiracFermion *df = QDP_expose_D(f); assert(n == self); if (re_im == 0) { QLA_r_eq_Re_c(xx, QLA_elem_D(df[i], c, d)); } else { QLA_r_eq_Im_c(xx, QLA_elem_D(df[i], c, d)); } QDP_reset_D(f); return xx; }
static double u_reader(int dir, const int pos[NDIM], int a, int b, int re_im, void *e) { QLA_Real xx; int n = QDP_node_number(pos); int i = QDP_index(pos); QLA_ColorMatrix *m = QDP_expose_M(U[dir]); assert(n == self); if (re_im == 0) { QLA_r_eq_Re_c(xx, QLA_elem_M(m[i], a, b)); } else { QLA_r_eq_Im_c(xx, QLA_elem_M(m[i], a, b)); } QDP_reset_M(U[dir]); return xx; }