@@ -21,7 +21,8 @@ class Measure
2121 double TOT_Mag; // magnetization s
2222 double TOT_Mag2; // magnetization squared
2323 double TOT_WilX; // Wilson loop in the x-direction
24- double TOT_WilY; // Wilson loop in the k-direction
24+ double TOT_WilY; // Wilson loop in the y-direction
25+ double TOT_WilZ; // Wilson loop in the z-direction
2526
2627 // vector <double> Wilson_RunningAvg;
2728
@@ -45,8 +46,9 @@ Measure::Measure(const int & N, const PARAMS & p){
4546 TOT_Mag2 = 0.0 ;
4647 TOT_WilX= 0.0 ;
4748 TOT_WilY= 0.0 ;
49+ TOT_WilZ= 0.0 ;
4850
49- // Wilson_RunningAvg.assign(p.Dim_,0.0);
51+ // Wilson_RunningAvg.assign(p.Dim_,0.0);
5052}
5153
5254// zero
@@ -56,10 +58,11 @@ void Measure::zero(){
5658 TOT_energy2 = 0.0 ;
5759 TOT_Mag = 0.0 ;
5860 TOT_Mag2 = 0.0 ;
59- TOT_WilX= 0.0 ;
60- TOT_WilY= 0.0 ;
61+ TOT_WilX= 0.0 ;
62+ TOT_WilY= 0.0 ;
63+ TOT_WilZ= 0.0 ;
6164
62- // for (int d=0; d<Wilson_RunningAvg.size(); d++)
65+ // for (int d=0; d<Wilson_RunningAvg.size(); d++)
6366 // Wilson_RunningAvg[d] = 0.0;
6467
6568}
@@ -79,15 +82,20 @@ void Measure::record(double & energy, Spins & sigma, const array_2t & WilsonLoop
7982
8083 int prodx = 1 ;
8184 int prody = 1 ;
82- int L = WilsonLoops[0 ].size ();
85+ int prodz = 1 ;
86+ int L = WilsonLoops[0 ].size ();
8387 for (int i=0 ; i<L; i++){
84- prodx *= sigma.spin [WilsonLoops[0 ][i]];
85- prody *= sigma.spin [WilsonLoops[1 ][i]];
88+ prodx *= sigma.spin [WilsonLoops[0 ][i]];
89+ prody *= sigma.spin [WilsonLoops[1 ][i]];
90+ if (WilsonLoops.size () > 2 )
91+ prodz *= sigma.spin [WilsonLoops[2 ][i]];
92+ else prodz = 0 ;
8693 }
8794
8895
8996 TOT_WilX += 1.0 *prodx;
9097 TOT_WilY += 1.0 *prody;
98+ TOT_WilZ += 1.0 *prodz;
9199
92100}// update
93101
@@ -102,24 +110,25 @@ void Measure::output(const double & T, const double & H, const int & SimNum){
102110 fname[6 ] = ' a' ;
103111 fname[7 ] = ' \0 ' ;
104112
105- ofstream cfout;
106- cfout.open (fname,ios::app);
113+ ofstream cfout;
114+ cfout.open (fname,ios::app);
107115
108- // cfout.open("00.data",ios::app);
116+ // cfout.open("00.data",ios::app);
109117
110118 cfout<<T<<" " ;
111119 cfout<<H<<" " ;
112120 cfout<<TOT_energy/(1.0 *MCS * Nspin)<<" " ;
113- double Cv = TOT_energy2/(1.0 *MCS) - TOT_energy*TOT_energy/(1.0 *MCS*MCS);
121+ double Cv = TOT_energy2/(1.0 *MCS) - TOT_energy*TOT_energy/(1.0 *MCS*MCS);
114122 cfout<<Cv/(T*T*1.0 *Nspin)<<" " ;
115123 cfout<<TOT_Mag/(1.0 *MCS * Nspin)<<" " ;
116124 cfout<<TOT_Mag2/(1.0 *MCS * Nspin*Nspin)<<" " ;
117- double susc = TOT_Mag2/(1.0 *MCS) - TOT_Mag*TOT_Mag/(1.0 *MCS*MCS);
125+ double susc = TOT_Mag2/(1.0 *MCS) - TOT_Mag*TOT_Mag/(1.0 *MCS*MCS);
118126 cfout<<susc/(T*1.0 *Nspin)<<" " ;
119127 cfout<<TOT_WilX/(1.0 *MCS)<<" " ;
120- cfout<<TOT_WilY/(1.0 *MCS)<<" \n " ;
128+ cfout<<TOT_WilY/(1.0 *MCS)<<" " ;
129+ cfout<<TOT_WilZ/(1.0 *MCS)<<" \n " ;
121130
122- cfout.close ();
131+ cfout.close ();
123132
124133}// output
125134
@@ -135,25 +144,25 @@ void Measure::outputWilsonLoop(const Spins & sigma, const array_2t & WilsonLoops
135144 fname[6 ] = ' m' ;
136145 fname[7 ] = ' \0 ' ;
137146
138- ofstream cfout;
139- cfout.open (fname,ios::app);
147+ ofstream cfout;
148+ cfout.open (fname,ios::app);
140149
141- int L = WilsonLoops[0 ].size ();
142- int D = WilsonLoops.size ();
150+ int L = WilsonLoops[0 ].size ();
151+ int D = WilsonLoops.size ();
143152
144153 double prod;
145- for (int d=0 ; d<D; d++){
146- prod = 1 ;
147- for (int i=0 ; i<L; i++)
148- prod *= sigma.spin [WilsonLoops[d][i]];
149- // cfout<<prod<<" ";
150- // Wilson_RunningAvg[d] += prod;
154+ for (int d=0 ; d<D; d++){
155+ prod = 1 ;
156+ for (int i=0 ; i<L; i++)
157+ prod *= sigma.spin [WilsonLoops[d][i]];
158+ // cfout<<prod<<" ";
159+ // Wilson_RunningAvg[d] += prod;
151160 // cfout<<Wilson_RunningAvg[d]/(1.0*MCstep)<<" ";
152161 cfout<<prod<<" " ;
153- }
154- cfout<<endl;
162+ }
163+ cfout<<endl;
155164
156- cfout.close ();
165+ cfout.close ();
157166
158167}// outputWilsonLoop
159168
0 commit comments