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