00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058 class ApeSmearing {
00059 public: static void smear(gauge_field &U,
00060 mdp_real alpha=0.7,
00061 int iterations=20,
00062 int cooling_steps=10) {
00063 gauge_field V(U.lattice(),U.nc);
00064 mdp_site x(U.lattice());
00065 for(int iter=0; iter<iterations; iter++) {
00066 cout << "smearing step " << iter << "/" << iterations << endl;
00067 V=U;
00068 for(int mu=0; mu<4; mu++) {
00069 forallsites(x) {
00070 U(x,mu)=(1.0-alpha)*V(x,mu);
00071 for(int nu=0; nu<U.ndim; nu++)
00072 if(nu!=mu)
00073 U(x,mu)+=(1.0-alpha)/6*
00074 (V(x,nu)*V(x+nu,mu)*hermitian(V(x+mu,nu))+
00075 hermitian(V(x-nu,nu))*V(x-nu,mu)*V((x-nu)+mu,nu));
00076 U(x,mu)=project_SU(U(x,mu),cooling_steps);
00077 }
00078 }
00079 U.update();
00080 }
00081 }
00082 };
00083
00084
00085 void compute_em_notrace_field(gauge_field &U) {
00086 compute_em_field(U);
00087 mdp_site x(U.lattice());
00088 forallsitesandcopies(x)
00089 for(int mu=0; mu<U.ndim-1; mu++)
00090 for(int nu=mu+1; nu<U.ndim; nu++)
00091 U.em(x,mu,nu)-=8.0/3.0*I*trace(U.em(x,mu,nu));
00092 }
00093
00094 void topological_charge(mdp_field<float> &Q, gauge_field &U) {
00095 compute_em_notrace_field(U);
00096 mdp_site x(U.lattice());
00097 forallsitesandcopies(x) {
00098 Q(x)=0;
00099 for(int i=0; i<U.nc; i++)
00100 for(int j=0; j<U.nc; j++)
00101 Q(x)+=real(U.em(x,0,1,i,j)*U.em(x,2,3,j,i)-
00102 U.em(x,0,2,i,j)*U.em(x,1,3,j,i)+
00103 U.em(x,0,3,i,j)*U.em(x,1,2,j,i));
00104 }
00105 Q.update();
00106 }
00107
00108 float topological_charge_vtk(gauge_field &U, string filename, int t=-1) {
00109 mdp_field<float> Q(U.lattice()), P(U.lattice());
00110 mdp_site x(U.lattice());
00111 topological_charge(Q,U);
00112 Q.save_vtk(filename,t);
00113 cumulate_field(Q,filename).save_vtk(filename.replace(filename.rfind("."),1,".sum."),t);
00114 for(int t=U.lattice().size(3)-1; t>=0; t--) {
00115 forallsites(x) if(x(0)==t) {
00116 if(t==U.lattice().size(3)-1) P(x)=Q(x);
00117 else P(x)=P(x+0)+Q(x);
00118 }
00119 P.update();
00120 }
00121 P.save_vtk(filename.replace(filename.rfind(".sum."),5,".flat."),0);
00122 double total=0.0;
00123 forallsites(x) total+=Q(x);
00124 mdp.add(total);
00125 return total;
00126 }