void overrel_sweep(){ int x0,x1,x2,x3; int mu,ix; static su3 v; if(LX<2) {printf("LX is smaller than 2 \n"); exit(0);} /* xchange the gauge-field */ xchange_gaugefield(g_gauge_field); /* update the left half of the sublattice */ for(x1=0;x1<LX/2;x1++) { for(x0=0;x0<T;x0++) { for(x2=0;x2<LY;x2++) { for(x3=0;x3<LZ;x3++) { ix=g_ipt[x0][x1][x2][x3]; for(mu=0;mu<4;mu++){ v=get_staples(ix,mu,g_gauge_field); flip_subgroup(ix,mu,v,1); flip_subgroup(ix,mu,v,2); flip_subgroup(ix,mu,v,3); } } } } } /* xchange the gauge-field */ xchange_gaugefield(g_gauge_field); /* update the right half of the sub lattice */ for(x1=LX/2;x1<LX;x1++) { for(x0=0;x0<T;x0++) { for(x2=0;x2<LY;x2++) { for(x3=0;x3<LZ;x3++) { ix=g_ipt[x0][x1][x2][x3]; for(mu=0;mu<4;mu++){ v=get_staples(ix,mu,g_gauge_field); flip_subgroup(ix,mu,v,1); flip_subgroup(ix,mu,v,2); flip_subgroup(ix,mu,v,3); } } } } } }
void sf_gauge_derivative(const int id, hamiltonian_field_t * const hf) { int i, mu; static su3 v, w; su3 *z; su3adj *xm; monomial * mnl = &monomial_list[id]; printf ("hola"); if(mnl->use_rectangles) { mnl->forcefactor = -mnl->c0 * g_beta/3.0; } else { mnl->forcefactor = -1. * g_beta/3.0; } for(i = 0; i < VOLUME; i++) { for(mu=0;mu<4;mu++) { z=&hf->gaugefield[i][mu]; xm=&hf->derivative[i][mu]; v=get_staples(i,mu, hf->gaugefield); _su3_times_su3d(w,*z,v); _add_trace_lambda((*xm),w); if(mnl->use_rectangles) { get_rectangle_staples(&v, i, mu); _su3_times_su3d(w, *z, v); _mul_add_trace_lambda((*xm), w, mnl->c1/mnl->c0); } } } return; }
void sf_gauge_derivative(const int id, hamiltonian_field_t * const hf) { int i, mu; static su3 v, w; su3 *z; su3adj *xm; monomial * mnl = &monomial_list[id]; double factor = -1. * g_beta/3.0; if(mnl->use_rectangles) { factor = -mnl->c0 * g_beta/3.0; } for(i = 0; i < VOLUME; i++) { for(mu=0;mu<4;mu++) { z=&hf->gaugefield[i][mu]; xm=&hf->derivative[i][mu]; get_staples(&v,i,mu, (const su3**) hf->gaugefield); _su3_times_su3d(w,*z,v); _trace_lambda_mul_add_assign((*xm), factor, w); if(mnl->use_rectangles) { get_rectangle_staples(&v, i, mu); _su3_times_su3d(w, *z, v); _trace_lambda_mul_add_assign((*xm), factor*mnl->c1/mnl->c0, w); } } } return; }
void overrel_sweep(){ int mu,ix; static su3 v; for(mu=0;mu<4;mu++){ for(ix=0;ix<VOLUME;ix++){ v=get_staples(ix,mu,g_gauge_field); flip_subgroup(ix,mu,v,1); flip_subgroup(ix,mu,v,2); flip_subgroup(ix,mu,v,3); } } }
/* this function calculates the derivative of the momenta: equation 13 of Gottlieb */ void gauge_derivative(const int id, hamiltonian_field_t * const hf) { monomial * mnl = &monomial_list[id]; double factor = -1. * g_beta/3.0; if(mnl->use_rectangles) { mnl->forcefactor = 1.; factor = -mnl->c0 * g_beta/3.0; } double atime, etime; atime = gettime(); #ifdef OMP #pragma omp parallel { #endif su3 ALIGN v, w; int i, mu; su3 *z; su3adj *xm; #ifdef OMP #pragma omp for #endif for(i = 0; i < VOLUME; i++) { for(mu=0;mu<4;mu++) { z=&hf->gaugefield[i][mu]; xm=&hf->derivative[i][mu]; get_staples(&v,i,mu, (const su3**) hf->gaugefield); _su3_times_su3d(w,*z,v); _trace_lambda_mul_add_assign((*xm), factor, w); if(mnl->use_rectangles) { get_rectangle_staples(&v, i, mu); _su3_times_su3d(w, *z, v); _trace_lambda_mul_add_assign((*xm), factor*mnl->c1/mnl->c0, w); } } } #ifdef OMP } /* OpenMP closing brace */ #endif etime = gettime(); if(g_debug_level > 1 && g_proc_id == 0) { printf("# Time for %s monomial derivative: %e s\n", mnl->name, etime-atime); } return; }
int stout_smear_gauge_field(const double rho , const int no_iters) { const int dim=4 ; int iter , mu , x; su3 *gauge_wk[4] ; su3 wk_staple ; su3 omega , Exp_p ; su3adj p; su3 *gauge_local ; su3 new_gauge_local ; /*printf("Entering stout_smear_gauge_field\n");*/ if(g_proc_id == 0 && g_debug_level > 3) { printf("DUMP OF g_gauge_field in STOUT\n"); print_config_to_screen(g_gauge_field); printf("STOUT smearing the gauge fields\n") ; printf("rho = %g number of iterations = %d\n",rho,no_iters) ; } /* reserve memory */ for(mu = 0 ; mu < dim ; ++mu) { gauge_wk[mu] = calloc(VOLUME, sizeof(su3)); if(errno == ENOMEM) { return(1); } } /* start of the the stout smearing **/ for(iter = 0 ; iter < no_iters ; ++iter) { for(mu = 0 ; mu < dim ; ++mu) { for(x= 0 ; x < VOLUME ; x++) { /* * we need to save all intermediate gauge configurations * because they are needed for the force back iteration in * "stout_smear_force.c" */ /*_su3_assign(g_gauge_field_smear_iterations[iter][x][mu], g_gauge_field[x][mu]);*/ /* get staples */ wk_staple = get_staples(x, mu, g_gauge_field) ; scale_su3(&wk_staple, rho) ; /* omega = staple * u^dagger */ gauge_local = &g_gauge_field[x][mu]; _su3_times_su3d(omega,wk_staple,*gauge_local); /* project out anti-hermitian traceless part */ project_anti_herm(&omega) ; /* exponentiate */ _trace_lambda(p,omega) ; /* -2.0 to get su3 to su3adjoint consistency ****/ p.d1 /= -2.0 ; p.d2 /= -2.0 ; p.d3 /= -2.0 ; p.d4 /= -2.0 ; p.d5 /= -2.0 ; p.d6 /= -2.0 ; p.d7 /= -2.0 ; p.d8 /= -2.0 ; Exp_p = exposu3(p); /* new_gauge_local = Exp_p * gauge_local */ _su3_times_su3(new_gauge_local,Exp_p,*gauge_local); gauge_wk[mu][x] = new_gauge_local ; } /* end the loop over space-time */ } /** update gauge field on this node **/ for(mu = 0 ; mu < dim ; ++mu) { for(x= 0 ; x < VOLUME ; ++x) { g_gauge_field[x][mu] = gauge_wk[mu][x] ; } } if(g_debug_level > 3 && g_proc_id == 0) { printf("DUMP OF g_gauge_field in STOUT\n"); print_config_to_screen(g_gauge_field); } #ifdef MPI /** update boundaries for parallel stuff **/ xchange_gauge(); #endif g_update_gauge_copy = 1; g_update_gauge_energy = 1; g_update_rectangle_energy = 1; /* * here we save the intermediate smeares gauge fields a large array */ } /* end loop over stout smearing iterations */ /* free up memory */ for(mu=0 ; mu < dim ; ++mu) { free(gauge_wk[mu]); } if(g_debug_level > 3 && g_proc_id == 0) { printf("Leaving stout_smear_gauge_field\n"); } return(0); }