示例#1
0
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;
    }
}
void Print(QDP_ColorMatrix * field){
  QLA_ColorMatrix *mom0;
  const int x[4] = {0,0,0,0};
  int ind = QDP_index(x);
  
  mom0 = QDP_expose_M(field);        
  printf("Field: %e %e %e\n\n", mom0[ind].e[0][0].real, mom0[ind].e[0][1].real, mom0[ind].e[0][2].real);

  QDP_reset_M(field);
}
示例#3
0
int
node_index(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_index(c);
}
static void 
PrintV(QDP_ColorVector * field){
  QLA_ColorVector *mom0;
  const int x[4] = {0,0,0,0};
  int ind = QDP_index(x);

  mom0 = QDP_expose_V(field);
  printf("Field: %e %e %e\n\n", mom0[ind].c[0].real, 
	 mom0[ind].c[1].real, mom0[ind].c[2].real);

  QDP_reset_V(field);
}
static void 
PrintVsite(QDP_ColorVector * field, int *x){
  QLA_ColorVector *mom0;
  int ind = QDP_index(x);

  mom0 = QDP_expose_V(field);
  printf("Field: %e %e\n", mom0[ind].c[0].real, mom0[ind].c[0].imag);
  printf("       %e %e\n", mom0[ind].c[1].real, mom0[ind].c[1].imag);
  printf("       %e %e\n", mom0[ind].c[2].real, mom0[ind].c[2].imag);

  QDP_reset_V(field);
}
static void 
PrintMsite(QDP_ColorMatrix * field, int *x){
  QLA_ColorMatrix *mom0;
  int ind = QDP_index(x);

  mom0 = QDP_expose_M(field);
  printf("Field: %e %e %e\n", mom0[ind].e[0][0].real,
	 mom0[ind].e[0][1].real, mom0[ind].e[0][2].real);
  printf("       %e %e %e\n", mom0[ind].e[1][0].real,
	 mom0[ind].e[1][1].real, mom0[ind].e[1][2].real);
  printf("       %e %e %e\n\n", mom0[ind].e[2][0].real,
	 mom0[ind].e[2][1].real, mom0[ind].e[2][2].real);

  QDP_reset_M(field);
}
示例#7
0
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);
}
示例#8
0
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;
}
示例#9
0
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;
}