/* On a lattice with lattice constant len, along each axis, multiply two adjacent smeared links in src to form a coarse link res on a lattice s with lattice constant 2 * len */ void RG_create_gauge(QDP_ColorMatrix *res[RG_Nd], QDP_ColorMatrix *src[RG_Nd], QDP_Sub_Block s, int len) { int i,j,k; int v[RG_Nd]; QDP_ColorMatrix *temp,*temp1; QDP_Shift offset; temp = QDP_create_M(); temp1 = QDP_create_M(); for(j=0; j<RG_Nd; ++j) { /* On axis displacement of length len */ for(k=0; k<RG_Nd; ++k) v[k] = 0; v[j] = len; offset = QDP_create_shift(v); SQDP_M_eq_M_times_sM(res[j],src[j],src[j],offset,QDP_forward,s); QDP_destroy_shift(offset); // printf("Multp........node %d for %d\n",this_node,j); fflush(stdout); } // node0_printf(".......................done\n"); fflush(stdout); QDP_destroy_M(temp); QDP_destroy_M(temp1); return; }
void make_3n_gathers(){ int i; #ifdef HAVE_QDP int disp[4]={0,0,0,0}; #endif for(i=XUP;i<=TUP;i++) { make_gather(third_neighbor,&i,WANT_INVERSE, ALLOW_EVEN_ODD,SWITCH_PARITY); } /* Sort into the order we want for nearest neighbor gathers, so you can use X3UP, X3DOWN, etc. as argument in calling them. */ sort_eight_gathers(X3UP); #ifdef HAVE_QDP for(i=0; i<4; i++) { disp[i] = 3; neighbor3[i] = QDP_create_shift(disp); disp[i] = 0; } #endif }
void RG_smear_dir (QDP_ColorMatrix *sm_link, QDP_ColorMatrix *link[], QLA_Real w_l, QLA_Real w_s, QLA_Int dir, QDP_Sub_Block s, int len) { int i,v[RG_Nd],n; QLA_Int nu,mu=dir; QDP_Subset sub; QDP_Shift offset[RG_Nd]; QLA_Complex unit; QDP_ColorMatrix *temp1, *temp2, *temp3, *temp4, *temp5, *temp6; temp1 = QDP_create_M(); temp2 = QDP_create_M(); temp3 = QDP_create_M(); temp4 = QDP_create_M(); temp5 = QDP_create_M(); temp6 = QDP_create_M(); for(nu=0; nu < RG_Nd ; nu++) { for(i=0; i<RG_Nd;i++) v[i] = 0; v[nu] = len; offset[nu] = QDP_create_shift(v); } SQDP_M_eq_r_times_M(temp6,&w_l,link[mu],s); /* Set temp4 to zero */ SQDP_M_eq_zero(temp4,s); n = RG_Nd; #ifdef CHECK_SMEAR_QDP_MILC n = 3; #endif /* Sum on staples */ for(nu=0; nu < n ; nu++)if(nu != mu) { /* For forward staples */ SQDP_M_eq_sM(temp1, link[mu], offset[nu], QDP_forward, s); SQDP_M_eq_sM(temp2, link[nu], offset[mu], QDP_forward, s); SQDP_M_eq_M_times_Ma(temp3, temp1, temp2, s); SQDP_M_peq_M_times_M(temp4, link[nu], temp3, s); /* For backward staples */ SQDP_M_eq_M_times_M(temp3, link[mu], temp2, s); SQDP_M_eq_Ma_times_M(temp1, link[nu], temp3, s); SQDP_M_eq_sM(temp5, temp1, offset[nu], QDP_backward, s); SQDP_M_peq_M(temp4, temp5, s); } /* U_smeared = w_l * U + w_s * U_staple */ SQDP_M_eq_r_times_M_plus_M(sm_link,&w_s,temp4,temp6,s); QDP_destroy_M(temp1); QDP_destroy_M(temp2); QDP_destroy_M(temp3); QDP_destroy_M(temp4); QDP_destroy_M(temp5); QDP_destroy_M(temp6); for(nu=0; nu < RG_Nd ; nu++) QDP_destroy_shift(offset[nu]); return ; }
void RG_create_path(QDP_ColorMatrix *pr_wlink[RG_Ncn], QDP_ColorMatrix *link_qdp[RG_Nd], QDP_Sub_Block s,int len) { int i,j,k,t,x[4]; int count,c2,space_only; QDP_ColorMatrix *path_1[4]; QDP_ColorMatrix *path_2[12]; QDP_ColorMatrix *path_3[24]; QDP_ColorMatrix *path_4[24]; QDP_ColorMatrix *wlink[RG_Ncn]; QDP_Shift offset; shift_v *d1,*d2,*d3,*d4; QLA_Real c = 1.0; QLA_Real fact2 = 1.0/2.0; QLA_Real fact3 = 1.0/6.0; QLA_Real fact4 = 1.0/24.0; QLA_Complex unit; d1 = (shift_v *) malloc(4*sizeof(shift_v)); d2 = (shift_v *) malloc(12*sizeof(shift_v)); d3 = (shift_v *) malloc(24*sizeof(shift_v)); d4 = (shift_v *) malloc(24*sizeof(shift_v)); for (i = 0; i < RG_Ncn; i++) wlink[i] = QDP_create_M(); for (i = 0; i < 4; i++) path_1[i] = QDP_create_M(); for (i = 0; i < 4; i++) SQDP_M_eq_M(path_1[i],link_qdp[i],s); for (i = 0; i < 12; i++) path_2[i] = QDP_create_M(); for (i = 0; i < 24; i++) { path_3[i] = QDP_create_M(); path_4[i] = QDP_create_M(); } // printf("Start building paths %d\n",this_node); fflush(stdout); for (i = 0; i < RG_Nd; i++) { x[0] = i; d1[i] = create_shift(x,1,len); } // printf("First shift %d\n",this_node);fflush(stdout); count = 0; for (i = 0; i < RG_Nd; i++) { x[0] = i; c2 = find_count(d1,x,1); offset = QDP_create_shift(d1[c2].s); for (j = 0; j < RG_Nd ; j++) if ( j != i) { x[1] = j; d2[count] = create_shift(x,2,len); SQDP_M_eq_M_times_sM(path_2[count],path_1[c2],link_qdp[j],offset,QDP_forward,s); count ++; } QDP_destroy_shift(offset); } // printf("Second shift %d\n",this_node);fflush(stdout); count = 0; for (i = 0; i < RG_Nd; i++) for (j = 0; j < RG_Nd; j++) if (j != i) { x[0] = i; x[1] = j; c2 = find_count(d2,x,2); offset = QDP_create_shift(d2[c2].s); for (k = 0; k < RG_Nd; k++) if (k != i) if (k != j) { x[2] = k; d3[count] = create_shift(x,3,len); SQDP_M_eq_M_times_sM(path_3[count],path_2[c2],link_qdp[k],offset,QDP_forward,s); count++; } QDP_destroy_shift(offset); } // printf("Third shift %d\n",this_node);fflush(stdout); count = 0; for (i = 0; i < RG_Nd; i++) for (j = 0; j < RG_Nd; j++) if (j != i) for (k = 0; k < RG_Nd; k++) if (k != i) if (k != j) { x[0] = i; x[1] = j; x[2] = k; c2 = find_count(d3,x,3); offset = QDP_create_shift(d3[c2].s); for (t = 0; t < RG_Nd; t++) if (t != i) if (t != j) if (t != k) { x[3] = t; d4[count] = create_shift(x,4,len); SQDP_M_eq_M_times_sM(path_4[count],path_3[c2],link_qdp[t],offset,QDP_forward,s); count++; } QDP_destroy_shift(offset); } // printf("Fourth shift %d\n",this_node);fflush(stdout); QLA_C_eq_R(&unit,&c); SQDP_M_eq_c(wlink[0],&unit,s); for (i=1;i<5;i++) SQDP_M_eq_M(wlink[i],path_1[i-1],s); for (i=5;i<RG_Ncn;i++) { SQDP_M_eq_zero(wlink[i],s); for (j=0;j<12;j++) if(d2[j].rv == i) SQDP_M_peq_r_times_M(wlink[i],&fact2,path_2[j],s); for (j=0;j<24;j++) if(d3[j].rv == i) SQDP_M_peq_r_times_M(wlink[i],&fact3,path_3[j],s); for (j=0;j<24;j++) if(d4[j].rv == i) SQDP_M_peq_r_times_M(wlink[i],&fact4,path_3[j],s); } space_only = RG_Ncn; // printf("projection %d\n",this_node);fflush(stdout); project_qdp(wlink, pr_wlink,&space_only); for (i = 0; i < 4; i++) QDP_destroy_M(path_1[i]); for (i = 0; i < 12; i++) QDP_destroy_M(path_2[i]); for (i = 0; i < 24; i++) { QDP_destroy_M(path_3[i]); QDP_destroy_M(path_4[i]); } for (i = 0; i < RG_Ncn; i++) QDP_destroy_M(wlink[i]); free(d1); free(d2); free(d3); free(d4); return; }
//originally make_path_table in quark_stuff_hisq.c static void QOP_make_paths_and_dirs_hisq(QOP_hisq_coeffs_t *coef, QOP_hisq_unitarize_method_t umethod) { int disp[4] = {0,0,0,0}; for(int i=0; i<4; i++) { disp[i] = 3; neighbor3[i] = QDP_create_shift(disp); disp[i] = 0; } for(int i=0; i<4; ++i) { shiftdirs[i] = QDP_neighbor[i]; shiftdirs[i+4] = neighbor3[i]; } REAL path_coeff_1[NUM_BASIC_PATHS_1] = {coef->fat7_one_link, coef->fat7_three_staple, coef->fat7_five_staple, coef->fat7_seven_staple}; REAL path_coeff_2[NUM_BASIC_PATHS_2] = {coef->asqtad_one_link, coef->asqtad_naik, coef->asqtad_three_staple, coef->asqtad_five_staple, coef->asqtad_seven_staple, coef->asqtad_lepage}; REAL path_coeff_3[NUM_BASIC_PATHS_3] = {coef->difference_one_link, coef->difference_naik}; QOP_printf0("QOP MAKING PATH TABLES\n"); num_q_paths_1 = make_path_table_hisq( QUARK_ACTION_DESCRIPTION_1, quark_action_npaths_1, MAX_NUM_1, path_length_in_1, path_coeff_1, path_ind_1, act_path_coeff_1, q_paths_1, 0.0, -1, -1 ); if ( umethod==QOP_UNITARIZE_NONE ) { QOP_printf0("QOP Unitarization method = QOP_UNITARIZE_NONE\n"); } else if ( umethod==QOP_UNITARIZE_RATIONAL ) { QOP_printf0("QOP Unitarization method = QOP_UNITARIZE_RATIONAL\n"); } else { QOP_printf0("QOP Unknown or unsupported unitarization method\n"); exit(0); } num_q_paths_2 = make_path_table_hisq( QUARK_ACTION_DESCRIPTION_2, quark_action_npaths_2, MAX_NUM_2, path_length_in_2, path_coeff_2, path_ind_2, act_path_coeff_2, q_paths_2, 0.0, -1, -1 ); num_q_paths_3 = make_path_table_hisq( QUARK_ACTION_DESCRIPTION_3, quark_action_npaths_3, MAX_NUM_3, path_length_in_3, path_coeff_3, path_ind_3, act_path_coeff_3, q_paths_3, 0.0, -1, -1 ); }