32 stoch_var(multi1d<DComplex>& ferm_loop_sum, multi2d<DComplex>& ferm_loop,
33 multi1d<Real64>& sigma, multi1d<Real64>& im_sigma,
34 int t_length,
int Nsamp)
36 multi1d<Real64> mean_sq(t_length), im_mean_sq(t_length),
s(t_length),
37 im_s(t_length), std_dev(t_length), im_std_dev(t_length),
38 re_loop(t_length), im_loop(t_length);
42 for (
int t = 0;
t < t_length; ++
t){
45 re_loop[
t] = real(ferm_loop_sum[
t])/Nsamp;
46 im_loop[
t] = imag(ferm_loop_sum[
t])/Nsamp;
47 ferm_loop_sum[
t] = cmplx(re_loop[
t], im_loop[
t]);
54 mean_sq[
t] = pow(re_loop[
t], 2);
55 im_mean_sq[
t] = pow(im_loop[
t], 2);
58 for (
int i = 0;
i < Nsamp; ++
i){
59 s[
t] += pow(real(ferm_loop[
i][
t]) , 2);
60 im_s[
t] += pow(imag(ferm_loop[
i][
t]) , 2);
64 std_dev[
t] = sqrt((
s[
t]/Nsamp) - mean_sq[
t]);
65 im_std_dev[
t] = sqrt((im_s[
t]/Nsamp) - im_mean_sq[
t]);
68 sigma[
t] = (1/sqrt(Nsamp-1.0))*std_dev[
t];
69 im_sigma[
t] = (1/sqrt(Nsamp-1.0))*im_std_dev[
t];
Primary include file for CHROMA library code.
void stoch_var(multi1d< DComplex > &ferm_loop_sum, multi2d< DComplex > &ferm_loop, multi1d< Real64 > &sigma, multi1d< Real64 > &im_sigma, int t_length, int Nsamp)
Stochastic variable construction.
Asqtad Staggered-Dirac operator.
multi1d< LatticeFermion > s(Ncb)
Stochastic variable construction.