- if (!loadedobs) {
- for (int kpiruv=0; kpiruv<2; kpiruv++) {
- double ppt = 2.*M_PI/O815->comargs.lsize[0] * ( 0 + kpiruv * O815->comargs.lsize[0]/2 ) ;
- double ppx = 2.*M_PI/O815->comargs.lsize[1] * ( 0 + kpiruv * O815->comargs.lsize[1]/2 );
-
- OM->phip2[ kpiruv ] = 0;
-
- for (int ixt = 0; ixt < O815->comargs.lsize[0]; ixt++)
- for (int ixx = 0; ixx < O815->comargs.lsize[1]; ixx++)
- for (int ixpt = 0; ixpt < O815->comargs.lsize[0]; ixpt++)
- for (int ixpx = 0; ixpx < O815->comargs.lsize[1]; ixpx++)
- OM->phip2[ kpiruv ] += real( conj( Sim->conf[ ixt*O815->comargs.lsize[1] + ixx ].phi )
- * Sim->conf[ ixpt*O815->comargs.lsize[1] + ixpx ].phi
- * exp ( _i_*(double)ppx*(double)(ixx-ixpx) + _i_*(double)ppt*(double)(ixt-ixpt) ) );
-
- OM->phip2[ kpiruv ] /= Sim->LSIZE2;
+ for (int kpimode=0; kpimode<4; kpimode++) {
+ const double ppt = 2.*M_PI/O815->comargs.lsize[0] * ( 0 + int( kpimode/4. * O815->comargs.lsize[0] ) ) ;
+ const double ppx = 2.*M_PI/O815->comargs.lsize[1] * ( 0 + int( kpimode/4. * O815->comargs.lsize[1] ) );
+
+ if (!loadedobs) {
+ complex<double> phitildepp = 0;
+
+ for (int ixpt = 0; ixpt < O815->comargs.lsize[0]; ixpt++)
+ for (int ixpx = 0; ixpx < O815->comargs.lsize[1]; ixpx++)
+ phitildepp += Sim->conf[ ixpt*O815->comargs.lsize[1] + ixpx ].phi
+ * exp ( - _i_*(double)ppx*(double)ixpx - _i_*(double)ppt*(double)ixpt );
+
+ OM->phip2[ kpimode ] = norm( phitildepp) / Sim->LSIZE2;