void calculate_fermion_force() { int i; double fft[GRIDPOINTS]; double ffx[GRIDPOINTS]; double ffy[GRIDPOINTS]; for(i=0; i<GRIDPOINTS; i++) { g_R[i] = (gauss() + I*gauss())/sqrt(2); //Pseudofermion fields times M^{-1} }; fermion(g_fermion, g_R); //g_fermion the pseudofermion field, i.e. phi = M R //g_cgiterations1 += cg(g_eta, g_fermion, ITER_MAX, DELTACG, &fermion_sqr); for(i = 0; i < GRIDPOINTS; i++) { //printf("%d \n", i); //printf("Brute-force %f\n", stupid_fermion_force_x(i)); //printf("Smart %f\n", fermion_forcex(i)); ffx[i] = stupid_fermion_force_x(i); printf("Brute-force %d, %f\n", i, ffx[i]); //fft[i] = fermion_forcet(i); //ffy[i] = fermion_forcey(i); } print_vector_r(ffx); //print_vector_r(fft); printf("Max x fermion force: %f\n", max_r(ffx)); //printf("Max t fermion force: %f\n", max_r(fft)); return; }
TGraph *MakeGraph(int Type, double fn) { Double_t x[numb], y[numb]; Int_t n = numb; for (Int_t i=0; i<n; i++) { x[i] = i*0.1*1/k; if(Type == 0) y[i] = scalar(&x[i], fn); else if (Type == 1) y[i] = fermion(&x[i], fn); else y[i] = 0; } TGraph *gr = new TGraph(n,x,y); gr->GetXaxis()->SetLimits(1,1000); //gr->GetXaxis()->SetLimits(5,100000); return gr; }
void test_fermion_force(int n) { int i, j; complex double x; double dA, f; for(i=0; i<GRIDPOINTS; i++) { g_R[i] = (gauss() + I*gauss())/sqrt(2); //Pseudofermion fields times M^{-1} }; fermion(g_fermion, g_R); //g_fermion the pseudofermion field, i.e. phi = M R g_cgiterations1 += cg(g_eta, g_fermion, ITER_MAX, DELTACG, &fermion_sqr); f = fermion_forcex(n); printf("Fermion force: %f\n", f); printf("%f\n", stupid_fermion_force_x(n)); return; }