00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00024 class staggered_field: public mdp_complex_field {
00025 public:
00026 int nc, ndim, nspin;
00027
00028 staggered_field(mdp_lattice &a, int nc_, int nspin_=4) {
00029
00030 nc=nc_;
00031 nspin=nspin_;
00032 ndim=a.ndim;
00033 allocate_field(a,nc);
00034 }
00035 staggered_field(const staggered_field &chi) : mdp_complex_field(chi) {
00036 nc=chi.nc;
00037 ndim=chi.ndim;
00038 nspin=chi.nspin;
00039 }
00040 void operator=(const staggered_field &chi) {
00041 nc=chi.nc;
00042 ndim=chi.ndim;
00043 nspin=chi.nspin;
00044 mdp_complex_field::operator=(chi);
00045 }
00046 inline mdp_matrix operator() (site x) {
00047 return mdp_matrix(address(x),nc,1);
00048 }
00049 inline mdp_complex& operator() (site x, int i) {
00050 return *(address(x,i));
00051 }
00052 inline const mdp_complex& operator() (site x, int i) const {
00053 return *(address(x,i));
00054 }
00055 void operator= (mdp_complex a) {
00056 for(mdp_int i=0; i<size; i++) m[i]=a;
00057 }
00058
00059 inline mdp_real component(site x, int mu) {
00060 return x(mu) % 2;
00061 }
00062 inline mdp_real eta(site x, int mu) {
00063 #ifdef USE_GOLTERMAN
00064 int i, tmp, i_max=(mu+ndim-1) % ndim;
00065 tmp=0;
00066 for(i=1; i<=i_max; i++) tmp+=x(i);
00067 #else
00068 int i, tmp;
00069 tmp=0;
00070 for(i=0; i<mu; i++) tmp+=x(i);
00071 #endif
00072 return mdp_mod2sign(tmp);
00073 }
00074
00075
00076
00077
00078
00079 inline mdp_real eps (site x) {
00080 int tmp;
00081 int i;
00082 tmp=x(0);
00083 for(i=1; i<ndim; i++) tmp+=x(i);
00084 return mdp_mod2sign(tmp);
00085 }
00086 inline mdp_real type (site x) {
00087 mdp_real tmp;
00088 int i;
00089 tmp=x(0) % 2;
00090 for(i=1; i<ndim; i++) tmp+=(x(i) % 2)*pow(2.0,i);
00091 return tmp;
00092 }
00093
00094
00095 };
00096