54#include <cuda_runtime.h>
55cublasHandle_t cublas_handle;
56cublasStatus_t cublas_status;
79int main(
int argc,
char *argv[]){
81 const char *funcname =
"main";
86 MPI_Comm_rank(comm, &
rank);
87 MPI_Comm_size(comm, &
size);
114 float akappa = 0.1780f;
125#ifdef USE_MATH_DEFINES
126 const double tpi = 2*
M_PI;
128 const double tpi = 2*acos(-1.0);
130 float dt=0.004;
float ajq = 0.0;
133 int stepl = 250;
int ntraj = 10;
137 const char *filename = (argc!=2) ?
"midout":argv[1];
139 if( !(midout = fopen(filename, fileop) ) ){
140 fprintf(stderr,
"Error %i in %s: Failed to open file %s for %s.\nExiting\n\n",\
141 OPENERROR, funcname, filename, fileop);
143 MPI_Abort(comm,OPENERROR);
149 fscanf(midout,
"%f %f %f %f %f %f %f %d %d %d %d %d", &dt, &beta, &akappa,\
150 &ajq, &athq, &fmu, &delb, &stepl, &ntraj, &istart, &icheck, &iread);
152 assert(stepl>0); assert(ntraj>0); assert(istart>=0); assert(icheck>0); assert(iread>=0);
161 jqq=ajq*cexp(athq*I);
165 cublasCreate(&cublas_handle);
167 blockInit(
nx,
ny,
nz,
nt, &dimBlock, &dimGrid);
170 cudaGetDevice(&device);
173 cudaDeviceGetDefaultMemPool(&mempool, device);
175 cudaMemPoolSetAttribute(mempool, cudaMemPoolAttrReleaseThreshold, &threshold);
178 printf(
"jqq=%f+(%f)I\n",creal(jqq),cimag(jqq));
190 Complex *u11, *u12, *u11t, *u12t;
192 double *dk4m, *dk4p, *pp;
193 float *dk4m_f, *dk4p_f;
195 unsigned int *iu, *id;
197 cudaMallocManaged((
void**)&iu,
ndim*
kvol*
sizeof(
int),cudaMemAttachGlobal);
198 cudaMallocManaged((
void**)&
id,
ndim*
kvol*
sizeof(
int),cudaMemAttachGlobal);
200 cudaMallocManaged(&dk4m,(
kvol+
halo)*
sizeof(
double),cudaMemAttachGlobal);
201 cudaMallocManaged(&dk4p,(
kvol+
halo)*
sizeof(
double),cudaMemAttachGlobal);
203 cudaMallocManaged(&dk4m_f,(
kvol+
halo)*
sizeof(
float),cudaMemAttachGlobal);
204 cudaMallocManaged(&dk4p_f,(
kvol+
halo)*
sizeof(
float),cudaMemAttachGlobal);
206 cudaMalloc(&dk4m_f,(
kvol+
halo)*
sizeof(
float));
207 cudaMalloc(&dk4p_f,(
kvol+
halo)*
sizeof(
float));
213 cudaMallocManaged(&gamin,4*4*
sizeof(
Complex),cudaMemAttachGlobal);
214 cudaMallocManaged(&gamval,5*4*
sizeof(
Complex),cudaMemAttachGlobal);
216 cudaMallocManaged(&gamval_f,5*4*
sizeof(
Complex_f),cudaMemAttachGlobal);
218 cudaMalloc(&gamval_f,5*4*
sizeof(
Complex_f));
232 id = (
unsigned int*)aligned_alloc(
AVX,
ndim*
kvol*
sizeof(
int));
233 iu = (
unsigned int*)aligned_alloc(
AVX,
ndim*
kvol*
sizeof(
int));
235 int *gamin = (
int *)aligned_alloc(
AVX,4*4*
sizeof(
int));
239 dk4m = (
double *)aligned_alloc(
AVX,(
kvol+
halo)*
sizeof(
double));
240 dk4p = (
double *)aligned_alloc(
AVX,(
kvol+
halo)*
sizeof(
double));
241 dk4m_f = (
float *)aligned_alloc(
AVX,(
kvol+
halo)*
sizeof(
float));
242 dk4p_f = (
float *)aligned_alloc(
AVX,(
kvol+
halo)*
sizeof(
float));
264 Init(istart,ibound,iread,beta,fmu,akappa,ajq,u11,u12,u11t,u12t,u11t_f,u12t_f,gamval,gamval_f,gamin,dk4m,dk4p,dk4m_f,dk4p_f,iu,
id);
267 Init_CUDA(u11t,u12t,gamval,gamval_f,gamin,dk4m,dk4p,iu,
id);
276 Diagnostics(istart, u11, u12, u11t, u12t, u11t_f, u12t_f, iu,
id,
hu,
hd, dk4m, dk4p,\
277 dk4m_f, dk4p_f, gamin, gamval, gamval_f, jqq, akappa, beta, ancg_diag);
283 double poly =
Polyakov(u11t_f,u12t_f);
285 if(!
rank) printf(
"Initial Polyakov loop evaluated as %e\n", poly);
287 double hg, avplaqs, avplaqt;
291 double traj=stepl*dt;
293 double proby = 2.5/stepl;
295 int buffer;
char buff2[7];
297 buffer = (int)round(100*beta);
298 sprintf(buff2,
"b%03d",buffer);
299 strcat(suffix,buff2);
301 buffer = (int)round(10000*akappa);
302 sprintf(buff2,
"k%04d",buffer);
303 strcat(suffix,buff2);
305 buffer = (int)round(1000*fmu);
306 sprintf(buff2,
"mu%04d",buffer);
307 strcat(suffix,buff2);
309 buffer = (int)round(1000*ajq);
310 sprintf(buff2,
"j%03d",buffer);
311 strcat(suffix,buff2);
313 sprintf(buff2,
"s%02d",
nx);
314 strcat(suffix,buff2);
316 sprintf(buff2,
"t%02d",
nt);
317 strcat(suffix,buff2);
318 char outname[
FILELEN] =
"Output.";
char *outop=
"a";
319 strcat(outname,suffix);
322 if(!(output=fopen(outname, outop) )){
323 fprintf(stderr,
"Error %i in %s: Failed to open file %s for %s.\nExiting\n\n",OPENERROR,funcname,outname,outop);
325 MPI_Abort(comm,OPENERROR);
330 printf(
"hg = %e, <Ps> = %e, <Pt> = %e, <Poly> = %e\n", hg, avplaqs, avplaqt, poly);
331 fprintf(output,
"ksize = %i ksizet = %i Nf = %i Halo =%i\nTime step dt = %e Trajectory length = %e\n"\
332 "No. of Trajectories = %i β = %e\nκ = %e μ = %e\nDiquark source = %e Diquark phase angle = %e\n"\
333 "Stopping Residuals: Guidance: %e Acceptance: %e, Estimator: %e\nSeed = %ld\n",
334 ksize,
ksizet,
nf,
halo, dt, traj, ntraj, beta, akappa, fmu, ajq, athq,
rescgg,
rescga,
respbp,
seed);
337 printf(
"ksize = %i ksizet = %i Nf = %i Halo = %i\nTime step dt = %e Trajectory length = %e\n"\
338 "No. of Trajectories = %i β = %e\nκ = %e μ = %e\nDiquark source = %e Diquark phase angle = %e\n"\
339 "Stopping Residuals: Guidance: %e Acceptance: %e, Estimator: %e\nSeed = %ld\n",
340 ksize,
ksizet,
nf,
halo, dt, traj, ntraj, beta, akappa, fmu, ajq, athq,
rescgg,
rescga,
respbp,
seed);
345 double actiona = 0.0;
double vel2a = 0.0;
double pbpa = 0.0;
double endenfa = 0.0;
double denfa = 0.0;
347 double e_dH=0;
double e_dH_e=0;
349 double yav = 0.0;
double yyav = 0.0;
351 int naccp = 0;
int ipbp = 0;
int itot = 0;
372 cudaMallocManaged(&pp,
kmom*
sizeof(
double),cudaMemAttachGlobal);
373 cudaMalloc(&dSdpi,
kmom*
sizeof(
double));
374 cudaDeviceSynchronise();
380 dSdpi = aligned_alloc(
AVX,
kmom*
sizeof(
double));
382 pp = aligned_alloc(
AVX,
kmom*
sizeof(
double));
393 start_time = MPI_Wtime();
395 start_time = omp_get_wtime();
401 double ancg,ancgh,totancg,totancgh=0;
402 for(
int itraj = iread+1; itraj <= ntraj+iread; itraj++){
407 printf(
"Starting itraj %i\n", itraj);
409 for(
int na=0; na<
nf; na++){
419 cudaMallocManaged(&R1_f,
kferm*
sizeof(
Complex_f),cudaMemAttachGlobal);
433#if (defined __NVCC__ && defined _DEBUG)
434 cudaMemPrefetchAsync(R1_f,
kferm*
sizeof(
Complex_f),device,streams[1]);
436#if (defined(USE_RAN2)||defined(__RANLUX__)||!defined(__INTEL_MKL__))
439 vsRngGaussian(VSL_RNG_METHOD_GAUSSIAN_ICDF, stream, 2*
kferm, R, 0, 1/sqrt(2));
449 Transpose_c(u11t_f,
ndim,
kvol,dimGrid,dimBlock);
450 Transpose_c(u12t_f,
ndim,
kvol,dimGrid,dimBlock);
451 cudaDeviceSynchronise();
453 Dslashd_f(R1_f,R,u11t_f,u12t_f,iu,
id,gamval_f,gamin,dk4m_f,dk4p_f,jqq,akappa);
459 cuComplex_convert(R1_f,R1,
kferm,
false,dimBlock,dimGrid);
460 Transpose_c(u11t_f,
kvol,
ndim,dimGrid,dimBlock);
461 Transpose_c(u12t_f,
kvol,
ndim,dimGrid,dimBlock);
466 cudaDeviceSynchronise();
470 cudaFreeAsync(R1_f,0);
475#pragma omp simd aligned(R1_f,R1:AVX)
476 for(
int i=0;i<
kferm;i++)
482 UpDownPart(na, X0, R1);
489 cudaMemcpyAsync(u11t, u11,
ndim*
kvol*
sizeof(
Complex),cudaMemcpyHostToDevice,streams[1]);
490 cudaMemcpyAsync(u12t, u12,
ndim*
kvol*
sizeof(
Complex),cudaMemcpyHostToDevice,streams[2]);
495#if (defined(USE_RAN2)||defined(__RANLUX__)||!defined(__INTEL_MKL__))
498 vdRngGaussian(VSL_RNG_METHOD_GAUSSIAN_ICDF, stream,
kmom, pp, 0, 1);
502 cudaMemPrefetchAsync(pp,
kmom*
sizeof(
double),device,streams[1]);
511 Hamilton(&H0, &S0,
rescga,pp,X0,X1,Phi,u11t,u12t,u11t_f,u12t_f,iu,
id,gamval_f,gamin,\
512 dk4m_f,dk4p_f,jqq,akappa,beta,&ancgh,itraj);
514 if(!
rank) printf(
"H0: %e S0: %e\n", H0, S0);
521#if (defined INT_LPFR && defined INT_OMF2) ||(defined INT_LPFR && defined INT_OMF4)||(defined INT_OMF2 && defined INT_OMF4)
522#error "Only one integrator may be defined
523#elif defined INT_LPFR
524 Leapfrog(u11t, u12t, u11t_f, u12t_f, X0, X1, Phi, dk4m, dk4p, dk4m_f, dk4p_f, dSdpi, pp,iu, id, gamval,
525 gamval_f, gamin, jqq, beta,akappa,stepl,dt,&ancg,&itot,proby);
526#elif defined INT_OMF2
527 OMF2(u11t, u12t, u11t_f, u12t_f, X0, X1, Phi, dk4m, dk4p, dk4m_f, dk4p_f, dSdpi, pp,iu, id, gamval,
528 gamval_f, gamin, jqq, beta,akappa,stepl,dt,&ancg,&itot,proby);
529#elif defined INT_OMF4
530 OMF4(u11t, u12t, u11t_f, u12t_f, X0, X1, Phi, dk4m, dk4p, dk4m_f, dk4p_f, dSdpi, pp,iu, id, gamval,
531 gamval_f, gamin, jqq, beta,akappa,stepl,dt,&ancg,&itot,proby);
533#error "No integrator defined. Please define {INT_LPFR.INT_OMF2,INT_OMF4}"
537 //Monte Carlo step: Accept new fields with the probability of min(1,exp(H0-X0))
538 //Kernel Call needed here?
539 Reunitarise(u11t,u12t);
541 Hamilton(&H1, &S1, rescga,pp,X0,X1,Phi,u11t,u12t,u11t_f,u12t_f,iu,id,gamval_f,gamin,\
542 dk4m_f,dk4p_f,jqq,akappa,beta,&ancgh,itraj);
543 ancgh/=2.0; //Hamilton is called at start and end of trajectory
546 printf("H0-H1=%f-%f",H0,H1);
554 fprintf(output, "dH = %e dS = %e\n", dH, dS);
556 printf("dH = %e dS = %e\n", dH, dS);
559 e_dH+=dH; e_dH_e+=dH*dH;
564 //Always update dH is positive (gone from higher to lower energy)
566 if(dH>0 || Par_granf()<=y){
567 //Step is accepted. Set s=st
569 printf("New configuration accepted on trajectory %i.\n", itraj);
570 //Original FORTRAN Comment:
571 //JIS 20100525: write config here to preempt troubles during measurement!
572 //JIS 20100525: remove when all is ok....
573 memcpy(u11,u11t,ndim*kvol*sizeof(Complex));
574 memcpy(u12,u12t,ndim*kvol*sizeof(Complex));
576 //Divide by gvol since we've summed over all lattice sites
582 printf("New configuration rejected on trajectory %i.\n", itraj);
588 cublasDnrm2(cublas_handle,kmom, pp, 1,&vel2);
590#elif defined USE_BLAS
591 vel2 = cblas_dnrm2(kmom, pp, 1);
595 for(int i=0; i<kmom; i++)
601 vel2a+=vel2/(ndim*nadj*gvol);
604 //If rejected, copy the previously accepted field in for measurements
607 cudaMemcpyAsync(u11t, u11, ndim*kvol*sizeof(Complex),cudaMemcpyDefault,streams[0]);
608 cudaMemcpyAsync(u12t, u12, ndim*kvol*sizeof(Complex),cudaMemcpyDefault,streams[1]);
610 memcpy(u11t, u11, ndim*kvol*sizeof(Complex));
611 memcpy(u12t, u12, ndim*kvol*sizeof(Complex));
613 Trial_Exchange(u11t,u12t,u11t_f,u12t_f);
617 printf("Starting measurements\n");
622 //Stop gap for measurement failure on Kay;
623 //If the Congrad in Measure fails, don't measure the Diquark or PBP-Density observables for
626 measure_check = Measure(&pbp,&endenf,&denf,&qq,&qbqb,respbp,&itercg,u11t,u12t,u11t_f,u12t_f,iu,id,\
627 gamval,gamval_f,gamin,dk4m,dk4p,dk4m_f,dk4p_f,jqq,akappa,Phi,R1);
630 printf("Finished measurements\n");
632 pbpa+=pbp; endenfa+=endenf; denfa+=denf; ipbp++;
633 Average_Plaquette(&hg,&avplaqs,&avplaqt,u11t_f,u12t_f,iu,beta);
634 poly = Polyakov(u11t_f,u12t_f);
635 //We have four output files, so may as well get the other ranks to help out
636 //and abuse scoping rules while we're at it.
637 //Can use either OpenMP or MPI to do this
642#pragma omp parallel for
643 for(int i=0; i<4; i++)
648 //Output code... Some files weren't opened in the main loop of the FORTRAN code
649 //That will need to be looked into for the C version
650 //It would explain the weird names like fort.1X that looked like they were somehow
652 fprintf(output, "Measure (CG) %i Update (CG) %.3f Hamiltonian (CG) %.3f\n", itercg, ancg, ancgh);
658 char fortname[FILELEN] = "fermi.";
659 strcat(fortname,suffix);
660 const char *fortop= (itraj==1) ? "w" : "a";
661 if(!(fortout=fopen(fortname, fortop) )){
662 fprintf(stderr, "Error %i in %s: Failed to open file %s for %s.\nExiting\n\n",\
663 OPENERROR, funcname, fortname, fortop);
665 MPI_Abort(comm,OPENERROR);
671 fprintf(fortout, "pbp\tendenf\tdenf\n");
673 fprintf(fortout, "%e\t%e\t%e\n", NAN, NAN, NAN);
675 fprintf(fortout, "%e\t%e\t%e\n", pbp, endenf, denf);
680 //The original code implicitly created these files with the name
681 //fort.XX where XX is the file label
682 //from FORTRAN. This was fort.12
685 char fortname[FILELEN] = "bose.";
686 strcat(fortname,suffix);
687 const char *fortop= (itraj==1) ? "w" : "a";
688 if(!(fortout=fopen(fortname, fortop) )){
689 fprintf(stderr, "Error %i in %s: Failed to open file %s for %s.\nExiting\n\n",\
690 OPENERROR, funcname, fortname, fortop);
693 fprintf(fortout, "avplaqs\tavplaqt\tpoly\n");
694 fprintf(fortout, "%e\t%e\t%e\n", avplaqs, avplaqt, poly);
701 char fortname[FILELEN] = "diq.";
702 strcat(fortname,suffix);
703 const char *fortop= (itraj==1) ? "w" : "a";
704 if(!(fortout=fopen(fortname, fortop) )){
705 fprintf(stderr, "Error %i in %s: Failed to open file %s for %s.\nExiting\n\n",\
706 OPENERROR, funcname, fortname, fortop);
708 MPI_Abort(comm,OPENERROR);
714 fprintf(fortout, "Re(qq)\n");
716 fprintf(fortout, "%e\n", NAN);
718 fprintf(fortout, "%e\n", creal(qq));
726 Par_swrite(itraj,icheck,beta,fmu,akappa,ajq,u11,u12);
735 elapsed = MPI_Wtime()-start_time;
737 elapsed = omp_get_wtime()-start_time;
744 //Make a routine that does this for us
745 cudaFree(dk4m); cudaFree(dk4p); cudaFree(R1); cudaFree(dSdpi); cudaFree(pp);
746 cudaFree(Phi); cudaFree(u11t); cudaFree(u12t);
747 cudaFree(X0); cudaFree(X1); cudaFree(u11); cudaFree(u12);
748 cudaFree(id); cudaFree(iu);
749 cudaFree(dk4m_f); cudaFree(dk4p_f); cudaFree(u11t_f); cudaFree(u12t_f);
750 cudaFree(gamin); cudaFree(gamval); cudaFree(gamval_f);
751 cublasDestroy(cublas_handle);
753 free(dk4m); free(dk4p); free(R1); free(dSdpi); free(pp);
754 free(Phi); free(u11t); free(u12t);
755 free(X0); free(X1); free(u11); free(u12);
757 free(dk4m_f); free(dk4p_f); free(u11t_f); free(u12t_f);
758 free(gamin); free(gamval); free(gamval_f);
760 free(hd); free(hu);free(h1u); free(h1d); free(halosize); free(pcoord);
762 gsl_rng_free(ranlux_instd);
763#elif (defined __INTEL_MKL__ &&!defined USE_RAN2)
764 vslDeleteStream(&stream);
768 FILE *sa3at = fopen("Bench_times.csv", "a");
771 int cuversion; cudaRuntimeGetVersion(&cuversion);
772 sprintf(version,"CUDA %d\tBlock: (%d,%d,%d)\tGrid: (%d,%d,%d)\n%s\n",cuversion,\
773 dimBlock.x,dimBlock.y,dimBlock.z,dimGrid.x,dimGrid.y,dimGrid.z,__VERSION__);
775 char *version=__VERSION__;
777 fprintf(sa3at, "%s\nβ%0.3f κ:%0.4f μ:%0.4f j:%0.3f s:%i t:%i kvol:%ld\n"
778 "npx:%i npt:%i nthread:%i ncore:%i time:%f traj_time:%f\n\n",\
779 version,beta,akappa,fmu,ajq,nx,nt,kvol,npx,npt,nthreads,npx*npy*npz*npt*nthreads,elapsed,elapsed/ntraj);
783 //Get averages for final output
784 actiona/=ntraj; vel2a/=ntraj; pbpa/=ipbp; endenfa/=ipbp; denfa/=ipbp;
785 totancg/=ntraj; totancgh/=ntraj;
786 e_dH/=ntraj; e_dH_e=sqrt((e_dH_e/ntraj-e_dH*e_dH)/(ntraj-1));
787 yav/=ntraj; yyav=sqrt((yyav/ntraj - yav*yav)/(ntraj-1));
788 float traj_cost=totancg/dt;
789 double atraj=dt*itot/ntraj;
792 fprintf(output, "Averages for the last %i trajectories\n"\
793 "Number of acceptances: %i\tAverage Trajectory Length = %e\n"\
794 "<dH>=%e+/-%e\t<exp(dH)>=%e+/-%e\tTrajectory cost=N_cg/dt =%e\n"\
795 "Average number of congrad iter guidance: %.3f acceptance %.3f\n"\
797 "Mean Square Velocity = %e\tAction Per Site = %e\n"\
798 "Energy Density = %e\tNumber Density %e\n\n\n",\
799 ntraj, naccp, atraj, e_dH,e_dH_e, yav, yyav, traj_cost, totancg, totancgh, pbpa, vel2a, actiona, endenfa, denfa);
803 //Ensure writing is done before finalising just in case finalise segfaults and crashes the other ranks mid-write
Header for routines related to lattice sites.
unsigned int * hd
Down halo indices.
unsigned int * hu
Up halo indices.
int main(int argc, char *argv[])
Matrix multiplication and related declarations.
int Dslashd_f(Complex_f *phi, Complex_f *r, Complex_f *u11t, Complex_f *u12t, unsigned int *iu, unsigned int *id, Complex_f *gamval, int *gamin, float *dk4m, float *dk4p, Complex_f jqq, float akappa)
Evaluates in single precision.
int Par_fcopy(float *fval)
Broadcasts a float to the other processes.
int size
The number of MPI ranks in total.
int Par_begin(int argc, char *argv[])
Initialises the MPI configuration.
int Par_icopy(int *ival)
Broadcasts an integer to the other processes.
int Trial_Exchange(Complex *u11t, Complex *u12t, Complex_f *u11t_f, Complex_f *u12t_f)
Exchanges the trial fields.
#define M_PI
if not defined elsewhere
Header for random number configuration.
int Gauss_c(Complex_f *ps, unsigned int n, const Complex_f mu, const float sigma)
Generates a vector of normally distributed random single precision complex numbers using the Box-Mull...
int Gauss_d(double *ps, unsigned int n, const double mu, const double sigma)
Generates a vector of normally distributed random double precision numbers using the Box-Muller Metho...
#define AVX
Alignment of arrays. 64 for AVX-512, 32 for AVX/AVX2. 16 for SSE. Since AVX is standard on modern x86...
#define rescgg
Conjugate gradient residue for update.
#define nt
Lattice temporal extent. This also corresponds to the inverse temperature.
#define kmom
sublattice momentum sites
#define nx
Lattice x extent.
#define ngorkov
Gor'kov indices.
#define ksizet
Sublattice t extent.
#define kferm2Halo
Dirac lattice and halo.
#define kvol
Sublattice volume.
#define Complex
Double precision complex number.
#define kferm
sublattice size including Gor'kov indices
#define rescga
Conjugate gradient residue for acceptance.
#define ksize
Sublattice spatial extent for a cubic lattice.
#define nf
Fermion flavours (double it)
#define respbp
Conjugate gradient residue for .
#define gvol
Lattice volume.
#define FILELEN
Default file name length.
#define halo
Total Halo size.
#define Complex_f
Single precision complex number.
#define kferm2
sublattice size including Dirac indices
#define kfermHalo
Gor'kov lattice and halo.
#define nz
Lattice z extent. We normally use cubic lattices so this is the same as nx.
#define ny
Lattice y extent. We normally use cubic lattices so this is the same as nx.
Function declarations for most of the routines.
int Init(int istart, int ibound, int iread, float beta, float fmu, float akappa, Complex_f ajq, Complex *u11, Complex *u12, Complex *u11t, Complex *u12t, Complex_f *u11t_f, Complex_f *u12t_f, Complex *gamval, Complex_f *gamval_f, int *gamin, double *dk4m, double *dk4p, float *dk4m_f, float *dk4p_f, unsigned int *iu, unsigned int *id)
Initialises the system.
int Hamilton(double *h, double *s, double res2, double *pp, Complex *X0, Complex *X1, Complex *Phi, Complex *u11t, Complex *u12t, Complex_f *u11t_f, Complex_f *u12t_f, unsigned int *iu, unsigned int *id, Complex_f *gamval_f, int *gamin, float *dk4m_f, float *dk4p_f, Complex_f jqq, float akappa, float beta, double *ancgh, int traj)
Calculate the Hamiltonian.
int Average_Plaquette(double *hg, double *avplaqs, double *avplaqt, Complex_f *u11t, Complex_f *u12t, unsigned int *iu, float beta)
Calculates the gauge action using new (how new?) lookup table.
int Reunitarise(Complex *u11t, Complex *u12t)
Reunitarises u11t and u12t as in conj(u11t[i])*u11t[i]+conj(u12t[i])*u12t[i]=1.
double Polyakov(Complex_f *u11t, Complex_f *u12t)
Calculate the Polyakov loop (no prizes for guessing that one...)