#include #include #include #include #include "include.h" #include "run.h" doublereal dot2(const doublereal *,const doublereal *,const doublereal *,int); #define PRINTIT 1==1 /* Print timing and convergence information */ /** This file runs the lanczos algorithm for finding the lowest Eigenvalues of the Hamiltonian with extrapolation for nonzero P_1. The results are then analyzed for consistant dispersion relations, and a best fit is found based on this criterion. **/ #define NJPC 2 /* Number of JPC sectors */ #define TOTALSTATES 8 /*Total number of states in all NJPC sectors */ #define NP1 2 /* Number of different values of transverse momentum */ #if 1==0 /* Truncations used in paper */ #define NS 7 const static int kt[NS]={20,20,20,22,24,26,28}, np[NS]={4,6,8,6,6,6,6}; #elif 1==1 #define NS 5 const static int kt[NS]={14,10,10,12,14}, np[NS]={4,6,8,6,6}; #else #define NS 5 const static int kt[NS]={20,20,22,22,32}, np[NS]={6,8,6,8,6}; #endif const int nvals[NJPC]={4,4}; static struct sectors s[NJPC][NS],t[NJPC][NS]; #if 1==0 element par[NPARAMS]={0.1,1.0,-0.2,-0.23,10.0}, rescale=1.0; #elif 1==1 /* Best fit couplings from paper */ element par[NPARAMS]={0.0649839, 1.,-0.201606821,-0.550384068,116.657}, rescale=3.46911443596316; #elif 1==0 /* This is the new best fit using shuffle */ element par[NPARAMS]={0.064984, 1.000000,-0.147802,-0.611392,116.657000}, rescale=3.410446; #else /* This is the new best fit using larger basis. */ element par[NPARAMS]={0.064984, 1.000000, -0.152583, -0.582787, 116.657000}, rescale=3.552178; #endif static int wpar[NPARAMS]; static doublereal longvals[NP1][TOTALSTATES], p1a[NP1][HINDEX]={{0.0},{0.25}}; static const doublereal err2[TOTALSTATES]={1.0,10000.0,10000.0,1.0,1.0,1.0,10000.0,10000.0}; static const doublereal teper[TOTALSTATES]={ 16.63019968814394, 39.77813397880572, 45.7690369882667, 45.7690369882667, 35.73301963006418, 55.454956994115, 61.83048213326445, 61.83048213326445}, specterr2[TOTALSTATES]={ 1.020792692835208, 7.16636029411156, 7.995737368805813, 7.995737368805813, 16.58584836076752, 65.06810610315358, 67.44195640455192, 67.44195640455192}; int MAIN(){ char out[]="disperse3.out"; integer totalstates=TOTALSTATES,npar=1,maxfev,mode=1, ifail=0,info,nfev,ldfjac=TOTALSTATES; integer ipvt[NPARAMS]; /* fcntol should be a little less than the Lanczos accuracy tol is the desired precision of the coupling constants */ doublereal tol=0.001,fcntol=1.0e-7,factor=100.0; doublereal vpar[NPARAMS],fvec[TOTALSTATES],diag[NPARAMS], fjac[TOTALSTATES*NPARAMS],qtf[NPARAMS], wa1[NPARAMS],wa2[NPARAMS],wa3[NPARAMS],wa4[TOTALSTATES]; clock_t t1; int i,j,o[NJPC]={1,1},o2[NJPC]={-1,-1},ht[HINDEX]={0}, multi[NJPC]={1,2},multi2[NJPC]={2,1}; int new=(1==1); element chi2; FILE *fp; #ifdef BABBAGE /* Routine to initialize Fortran on Babbage */ if(hf_fint((char*)NULL)) exit(1); #endif loadelements(); if((fp = fopen(out,"w")) == NULL){ fprintf(stderr,__FILE__": Can't open file %s in monster, exiting\n",out); return; } for(i=0, j=0; i4) fprintf(stderr,__FILE__": Error in lmdif info=%li\n",info); for(i=0; i0)printf("\nwhile fitting"); for(i=0; i