Skip to content

Commit

Permalink
factor 2 moved to deriv_Sb and deriv_Sb_D_psi
Browse files Browse the repository at this point in the history
  • Loading branch information
urbach committed May 29, 2012
1 parent 23d1009 commit fa2ace6
Show file tree
Hide file tree
Showing 13 changed files with 98 additions and 168 deletions.
10 changes: 10 additions & 0 deletions bgl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1573,5 +1573,15 @@
(r).d7+= (+__creal(r21) - __creal(r12)); \
(r).d8+= ((-__cimag(r00) - __cimag(r11) + 2.*__cimag(r22))*0.577350269189625);

#define _bgl_trace_lambda_mul_add_assign(r, c) \
(r).d1+= c * (-__cimag(r10) - __cimag(r01)); \
(r).d2+= c * (+__creal(r10) - __creal(r01)); \
(r).d3+= c * (-__cimag(r00) + __cimag(r11)); \
(r).d4+= c * (-__cimag(r20) - __cimag(r02)); \
(r).d5+= c * (+__creal(r20) - __creal(r02)); \
(r).d6+= c * (-__cimag(r21) - __cimag(r12)); \
(r).d7+= c * (+__creal(r21) - __creal(r12)); \
(r).d8+= c * ((-__cimag(r00) - __cimag(r11) + 2.*__cimag(r22))*0.577350269189625);


#endif
2 changes: 1 addition & 1 deletion cloverdet_monomial.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void cloverdet_derivative(const int id, hamiltonian_field_t * const hf) {
monomial * mnl = &monomial_list[id];

/* This factor 2 a missing factor 2 in trace_lambda */
(*mnl).forcefactor = 2.;
(*mnl).forcefactor = 1.;


/*********************************************************************
Expand Down
4 changes: 2 additions & 2 deletions cloverdetratio_monomial.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void cloverdetratio_derivative_orig(const int no, hamiltonian_field_t * const hf
monomial * mnl = &monomial_list[no];

/* This factor 2* a missing factor 2 in trace_lambda */
mnl->forcefactor = 2.;
mnl->forcefactor = 1.;

/*********************************************************************
*
Expand Down Expand Up @@ -160,7 +160,7 @@ void cloverdetratio_derivative(const int no, hamiltonian_field_t * const hf) {
monomial * mnl = &monomial_list[no];

/* This factor 2* a missing factor 2 in trace_lambda */
mnl->forcefactor = 2.;
mnl->forcefactor = 1.;

/*********************************************************************
*
Expand Down
36 changes: 16 additions & 20 deletions deriv_Sb.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ void deriv_Sb(const int ieo, spinor * const l, spinor * const k, hamiltonian_fie
_bgl_su3_times_v(*up);
/* result in r now */
_bgl_complex_times_r(ka0);
_bgl_trace_lambda_add_assign((*ddd));
_bgl_trace_lambda_mul_add_assign((*ddd), 2.);


/************** direction -0 ****************************/
Expand Down Expand Up @@ -185,7 +185,7 @@ void deriv_Sb(const int ieo, spinor * const l, spinor * const k, hamiltonian_fie

/* result in r now */
_bgl_complex_times_r(ka0);
_bgl_trace_lambda_add_assign((*ddd));
_bgl_trace_lambda_mul_add_assign((*ddd), 2.);

/*************** direction +1 **************************/

Expand Down Expand Up @@ -218,7 +218,7 @@ void deriv_Sb(const int ieo, spinor * const l, spinor * const k, hamiltonian_fie
_bgl_su3_times_v(*up);
/* result in r now */
_bgl_complex_times_r(ka1);
_bgl_trace_lambda_add_assign((*ddd));
_bgl_trace_lambda_mul_add_assign((*ddd), 2.);

/**************** direction -1 *************************/

Expand Down Expand Up @@ -251,7 +251,7 @@ void deriv_Sb(const int ieo, spinor * const l, spinor * const k, hamiltonian_fie
_bgl_su3_times_v(*um);
/* result in r now */
_bgl_complex_times_r(ka1);
_bgl_trace_lambda_add_assign((*ddd));
_bgl_trace_lambda_mul_add_assign((*ddd), 2.);

/*************** direction +2 **************************/

Expand Down Expand Up @@ -284,7 +284,7 @@ void deriv_Sb(const int ieo, spinor * const l, spinor * const k, hamiltonian_fie
_bgl_su3_times_v(*up);
/* result in r now */
_bgl_complex_times_r(ka2);
_bgl_trace_lambda_add_assign((*ddd));
_bgl_trace_lambda_mul_add_assign((*ddd), 2.);

/***************** direction -2 ************************/

Expand Down Expand Up @@ -317,7 +317,7 @@ void deriv_Sb(const int ieo, spinor * const l, spinor * const k, hamiltonian_fie
_bgl_su3_times_v(*um);
/* result in r now */
_bgl_complex_times_r(ka1);
_bgl_trace_lambda_add_assign(*ddd);
_bgl_trace_lambda_mul_add_assign(*ddd, 2.);

/****************** direction +3 ***********************/

Expand Down Expand Up @@ -350,7 +350,7 @@ void deriv_Sb(const int ieo, spinor * const l, spinor * const k, hamiltonian_fie
_bgl_su3_times_v(*up);
/* result in r now */
_bgl_complex_times_r(ka3);
_bgl_trace_lambda_add_assign((*ddd));
_bgl_trace_lambda_mul_add_assign((*ddd), 2.);

/***************** direction -3 ************************/

Expand Down Expand Up @@ -387,7 +387,7 @@ void deriv_Sb(const int ieo, spinor * const l, spinor * const k, hamiltonian_fie
_bgl_su3_times_v(*um);
/* result in r now */
_bgl_complex_times_r(ka3);
_bgl_trace_lambda_add_assign((*ddd));
_bgl_trace_lambda_mul_add_assign((*ddd), 2.);

/****************** end of loop ************************/
}
Expand All @@ -401,17 +401,13 @@ void deriv_Sb(const int ieo, spinor * const l, spinor * const k, hamiltonian_fie


void deriv_Sb(const int ieo, spinor * const l, spinor * const k, hamiltonian_field_t * const hf) {
/* const int l, const int k){ */
int ix,iy;
int ioff, icx, icy;
su3 * restrict up ALIGN;
su3 * restrict um ALIGN;
/* su3adj * restrict ddd; */
/* static su3adj der; */
static su3 v1,v2;
static su3_vector psia,psib,phia,phib;
static spinor rr;
/* spinor * restrict r ALIGN; */
spinor * restrict sp ALIGN;
spinor * restrict sm ALIGN;

Expand Down Expand Up @@ -473,7 +469,7 @@ void deriv_Sb(const int ieo, spinor * const l, spinor * const k, hamiltonian_fie
_vector_tensor_vector_add(v1, phia, psia, phib, psib);
_su3_times_su3d(v2,*up,v1);
_complex_times_su3(v1, ka0, v2);
_trace_lambda_add_assign(hf->derivative[ix][0], v1);
_trace_lambda_mul_add_assign(hf->derivative[ix][0], 2., v1);

/************** direction -0 ****************************/

Expand All @@ -496,7 +492,7 @@ void deriv_Sb(const int ieo, spinor * const l, spinor * const k, hamiltonian_fie
_vector_tensor_vector_add(v1, psia, phia, psib, phib);
_su3_times_su3d(v2,*um,v1);
_complex_times_su3(v1,ka0,v2);
_trace_lambda_add_assign(hf->derivative[iy][0], v1);
_trace_lambda_mul_add_assign(hf->derivative[iy][0], 2., v1);

/*************** direction +1 **************************/

Expand All @@ -517,7 +513,7 @@ void deriv_Sb(const int ieo, spinor * const l, spinor * const k, hamiltonian_fie
_vector_tensor_vector_add(v1, phia, psia, phib, psib);
_su3_times_su3d(v2,*up,v1);
_complex_times_su3(v1,ka1,v2);
_trace_lambda_add_assign(hf->derivative[ix][1], v1);
_trace_lambda_mul_add_assign(hf->derivative[ix][1], 2., v1);

/**************** direction -1 *************************/

Expand All @@ -538,7 +534,7 @@ void deriv_Sb(const int ieo, spinor * const l, spinor * const k, hamiltonian_fie
_vector_tensor_vector_add(v1, psia, phia, psib, phib);
_su3_times_su3d(v2,*um,v1);
_complex_times_su3(v1,ka1,v2);
_trace_lambda_add_assign(hf->derivative[iy][1], v1);
_trace_lambda_mul_add_assign(hf->derivative[iy][1], 2., v1);

/*************** direction +2 **************************/

Expand All @@ -559,7 +555,7 @@ void deriv_Sb(const int ieo, spinor * const l, spinor * const k, hamiltonian_fie
_vector_tensor_vector_add(v1, phia, psia, phib, psib);
_su3_times_su3d(v2,*up,v1);
_complex_times_su3(v1,ka2,v2);
_trace_lambda_add_assign(hf->derivative[ix][2], v1);
_trace_lambda_mul_add_assign(hf->derivative[ix][2], 2., v1);

/***************** direction -2 ************************/

Expand All @@ -580,7 +576,7 @@ void deriv_Sb(const int ieo, spinor * const l, spinor * const k, hamiltonian_fie
_vector_tensor_vector_add(v1, psia, phia, psib, phib);
_su3_times_su3d(v2,*um,v1);
_complex_times_su3(v1,ka2,v2);
_trace_lambda_add_assign(hf->derivative[iy][2], v1);
_trace_lambda_mul_add_assign(hf->derivative[iy][2], 2., v1);

/****************** direction +3 ***********************/

Expand All @@ -601,7 +597,7 @@ void deriv_Sb(const int ieo, spinor * const l, spinor * const k, hamiltonian_fie
_vector_tensor_vector_add(v1, phia, psia, phib, psib);
_su3_times_su3d(v2,*up,v1);
_complex_times_su3(v1, ka3, v2);
_trace_lambda_add_assign(hf->derivative[ix][3], v1);
_trace_lambda_mul_add_assign(hf->derivative[ix][3], 2., v1);

/***************** direction -3 ************************/

Expand All @@ -622,7 +618,7 @@ void deriv_Sb(const int ieo, spinor * const l, spinor * const k, hamiltonian_fie
_vector_tensor_vector_add(v1, psia, phia, psib, phib);
_su3_times_su3d(v2,*um,v1);
_complex_times_su3(v1,ka3,v2);
_trace_lambda_add_assign(hf->derivative[iy][3], v1);
_trace_lambda_mul_add_assign(hf->derivative[iy][3], 2., v1);

/****************** end of loop ************************/
}
Expand Down
Loading

0 comments on commit fa2ace6

Please sign in to comment.