(*verification de la formule de correlation des vep*)

HN= matkn06[0,13];

H[j_]:= matkn06[0,j];

vaphn = Eigenvalues[HN];

vephn = Eigenvectors[HN];

Length[HN]

phindirect:={};

For[k=1,k<14,k++, AppendTo[phindirect, vephn[[fiboseq[k]]]]];

phi1direct:={};

For[k=1,k<14,k++, AppendTo[phi1direct, vephn[[1,fiboseq[k]]]]];

log[x_,k_]:=If[x==vaphn[[k]],0,Log[Abs[x-vaphn[[k]]]]];

th[x_]:= Sum[N[log[x,k]/fibolist[[k]]],{k,1,34}];

th[1]

fibolist:={};

For[k=1,k<35,k++,AppendTo[fibolist,fiboseq[k]]];

Clear[phi1th,listphi1th];

phi1th[j_]:=Exp[-fiboseq[j]*th[vaphn[[1]]]];

listphi1th:={};

For[k=1,k<14,k++,AppendTo[listphi1th,phi1th[k]]];

l2=listphi1th/Total[listphi1th]

ListPlot[l2]

Total[listphi1th]

phi1directabs=Abs[phi1direct];
phi1dir = phi1directabs*Abs[vephn[[1,1]]];

ListPlot[phi1dir]

Clear[listphi1th,phi1th];

vaphn

ListPlot[vaphn]

thouless[x_]:=Sum[ N[log[x,k]/233],{k,1,233}];

thouless[1]

0.15333638737787592`

(* verification de la formule de Thouless entre les sites 1 et 233 (max) *)

corr1ndir:={};

For[k=1,k<234,k++,AppendTo[corr1ndir,Abs[vephn[[k,1]]*vephn[[k,233]]]]];

ListPlot[corr1ndir]

corr1nth:={};

For[k=1,k<234,k++, AppendTo[corr1nth, N[Exp[-233*thouless[vaphn[[k]]]]]]];

ListPlot[{corr1nth,corr1ndir}]

Clear[corr1ndir];

(* verif entre les sites 1 et 144*)

fiboseq[11]

fiboseq[12]

corr1144dir:={};

For[k=1,k<234,k++,AppendTo[corr1144dir,Abs[vephn[[k,1]]*vephn[[k,144]]]]];

ListPlot[corr1144dir]

corr1144th1:={};

For[k=1,k<144,k++,AppendTo[corr1144th1,N[Exp[-144*thouless12[vaph12[[k]]]]]]];

ListPlot[{corr1144th1,corr1144dir}]

(* probleme d'ordre de grandeur *)

H12= matkn06[0,12];
vaph12 = Eigenvalues[H12];
vepn12 = Eigenvectors[H12];
log12[x_,k_]:=If[x==vaph12[[k]],0,Log[Abs[x-vaph12[[k]]]]];

thouless12[x_]:=Sum[ N[log12[x,k]/144],{k,1,144}];

Plot[{thouless12[x],thouless[x]},{x,-2,3}]

corr1144th2 :={};

For[k=1,k<234,k++,AppendTo[corr1144th2,Abs[vepn12[[k,1]]*vepn12[[k,144]]]]];

ListPlot[corr1144dir]

reste144=matkn06[fiboseq[11],13];

CharacteristicPolynomial[reste144,x]

Clear[reste144];

p1[x_]:=-6.7494070620617785`-5.546262710612109` x+9218.415083863983` (x^2)+23040.207582373827` (x^3)-2.815553122452815`*^6 (x^4)-673048.9323897681` (x^5)+3.43889570091473`*^8 (x^6)-5.1840654395104253`*^8 (x^7)-2.099994807130355`*^10 (x^8)+6.2767393902962875`*^10 (x^9)+6.783131308245292`*^11 (x^10)-3.099389960130225`*^12 (x^11)-1.0569285754207105`*^13 (x^12)+7.78623513391626`*^13 (x^13)+3.1619013778282773`*^13 (x^14)-1.0270752283861046`*^15 (x^15)+1.199977977820303`*^15 (x^16)+6.958663588238371`*^15 (x^17)-1.6247808919681792`*^16 (x^18)-2.519988861221827`*^16 (x^19)+1.0526375836129792`*^17 (x^20)+3.2925004301082824`*^16 (x^21)-4.396265109858781`*^17 (x^22)+1.459732143509255`*^17 (x^23)+1.313835536972479`*^18 (x^24)-1.0408758069960353`*^18 (x^25)-2.953494925134885`*^18 (x^26)+3.588153543884296`*^18 (x^27)+5.103414768499386`*^18 (x^28)-8.701191104153229`*^18 (x^29)-6.746101141369064`*^18 (x^30)+1.637066919783047`*^19 (x^31)+6.456387782250317`*^18 (x^32)-2.4982615753897304`*^19 (x^33)-3.398840127511933`*^18 (x^34)+3.1713359098508407`*^19 (x^35)-1.8108273755393495`*^18 (x^36)-3.40241357237152`*^19 (x^37)+7.256120543682097`*^18 (x^38)+3.1174557018418094`*^19 (x^39)-1.0873356337110434`*^19 (x^40)-2.455621006522984`*^19 (x^41)+1.1662309403459377`*^19 (x^42)+1.6688042913551739`*^19 (x^43)-1.0033235163758721`*^19 (x^44)-9.789226391974875`*^18 (x^45)+7.22562315733345`*^18 (x^46)+4.940974101098125`*^18 (x^47)-4.4479801922625126`*^18 (x^48)-2.1273071138835738`*^18 (x^49)+2.3677365181063404`*^18 (x^50)+7.666005791207311`*^17 (x^51)-1.0971818659522877`*^18 (x^52)-2.2136359781409152`*^17 (x^53)+4.441748987867429`*^17 (x^54)+4.501970790478618`*^16 (x^55)-1.573048298519479`*^17 (x^56)-2.454105260630656`*^15 (x^57)+4.870830250964296`*^16 (x^58)-2.942719491125362`*^15 (x^59)-1.3155043888596718`*^16 (x^60)+1.7177841949384205`*^15 (x^61)+3.085028451181603`*^15 (x^62)-6.123862216273938`*^14 (x^63)-6.237174928984144`*^14 (x^64)+1.6733592424434738`*^14 (x^65)+1.0751263371334794`*^14 (x^66)-3.717541476754405`*^13 (x^67)-1.5523699307559883`*^13 (x^68)+6.85115900316799`*^12 (x^69)+1.8206772742805415`*^12 (x^70)-1.0524147418462776`*^12 (x^71)-1.6271775668310944`*^11 (x^72)+1.3419699974949472`*^11 (x^73)+9.136197672454296`*^9 (x^74)-1.4042409246579542`*^10 (x^75)+4.376072869770455`*^7 (x^76)+1.1819248365273314`*^9 (x^77)-7.72035308416157`*^7 (x^78)-7.743754890986249`*^7 (x^79)+9.629290308595225`*^6 (x^80)+3.7313083159423955`*^6 (x^81)-704760.3448320009` (x^82)-117605.2831999998` (x^83)+33292.929600000025` (x^84)+1640.9423999999942` (x^85)-950.544` (x^86)+24.640000000000118` (x^87)+12.599999999999987` (x^88)-(x^89);

Clear[corr1144th3]

corr1144th3:={};

For[k=1,k<234,k++,AppendTo[corr1144th3,Abs[N[p1[vaphn[[k]]]]*Exp[-233*thouless[vaphn[[k]]]]]]];

ListPlot[{Take[corr1144th3,-233],Take[corr1144dir,-233]}]

ListPlot[corr1144th3]

Length[corr1144th3]

p1[vaphn[[233]]]

ListPlot[Table[p1[vaphn[[k]]],{k,150,233}]]

ListPlot[Table[{vaphn[[n]],thouless[vaphn[[n]]]},{n,233}]]

corr1144th4:={};
appartient[x_,v_]:=(x-v[[1]])*appartient[x,Take[v,-Length[v]+1]];

appartient[x_,{}] = 1;

appartient[1,{9,2,3}]

For[k=1,k<234,k++,
AppendTo[corr1144th4,Abs[p1[vaphn[[k]]]*Exp[-233*thouless[vaphn[[k]]]]]]];

Clear[corr1144th4]

ListPlot[{vaphn,vaph12}]

(* a quelques cas pathologiques pres, corr1144th3 donne de bons res. On continue avec le site 89*)

reste89=matkn06[fiboseq[13]-fiboseq[11],13];

CharacteristicPolynomial[reste89,x]

p89[x_]:=-26.287796685069544`-1819.5899334797564` x+28231.29253874452` (x^2)+2.8061305942658396`*^6 (x^3)+5.566682578076132`*^6 (x^4)-1.1609660526479032`*^9 (x^5)-3.8896289152658424`*^9 (x^6)+2.4395543865469724`*^11 (x^7)+5.583047462613477`*^11 (x^8)-3.1049569053126035`*^13 (x^9)-2.1255552410722285`*^13 (x^10)+2.5686846031271115`*^15 (x^11)-2.380399521752194`*^15 (x^12)-1.4193084296851618`*^17 (x^13)+3.4933586008918266`*^17 (x^14)+5.219309927067135`*^18 (x^15)-2.1305150172636893`*^19 (x^16)-1.2161362215326646`*^20 (x^17)+7.731730845854237`*^20 (x^18)+1.4621942165468372`*^21 (x^19)-1.8007487155402552`*^22 (x^20)+4.233309133710771`*^21 (x^21)+2.712378693062152`*^23 (x^22)-4.8075511714933094`*^23 (x^23)-2.5316657458503547`*^24 (x^24)+8.678514033059828`*^24 (x^25)+1.2240385423582624`*^25 (x^26)-8.795494315030642`*^25 (x^27)+9.354583767859542`*^24 (x^28)+5.8699508176018635`*^26 (x^29)-6.380466394140996`*^26 (x^30)-2.7111131506941403`*^27 (x^31)+5.57524368282404`*^27 (x^32)+8.442172772627792`*^27 (x^33)-3.0460530207843082`*^28 (x^34)-1.3547349952686524`*^28 (x^35)+1.2281929683121952`*^29 (x^36)-2.436902906671952`*^28 (x^37)-3.8774694305779416`*^29 (x^38)+2.7158598927514524`*^29 (x^39)+9.826882945645658`*^29 (x^40)-1.1693423788503525`*^30 (x^41)-2.0058266175627627`*^30 (x^42)+3.5856658581788`*^30 (x^43)+3.213817869405039`*^30 (x^44)-8.788427577090595`*^30 (x^45)-3.6338811658298676`*^30 (x^46)+1.8022801626928706`*^31 (x^47)+1.35527100650281`*^30 (x^48)-3.1663054478268246`*^31 (x^49)+6.099125152908763`*^30 (x^50)+4.830677661146676`*^31 (x^51)-2.0650747186657183`*^31 (x^52)-6.44965040810344`*^31 (x^53)+4.2195381831000355`*^31 (x^54)+7.559828008783178`*^31 (x^55)-6.769859417061368`*^31 (x^56)-7.766682368523723`*^31 (x^57)+9.168778517225501`*^31 (x^58)+6.934432514901741`*^31 (x^59)-1.0817782546250845`*^32 (x^60)-5.26433342269674`*^31 (x^61)+1.1308986123399849`*^32 (x^62)+3.2102205382046226`*^31 (x^63)-1.0583455561811215`*^32 (x^64)-1.281959019517556`*^31 (x^65)+8.925238390949976`*^31 (x^66)-1.4969957032487315`*^30 (x^67)-6.811883855678091`*^31 (x^68)+9.505662445411421`*^30 (x^69)+4.717471271040645`*^31 (x^70)-1.1993947637854446`*^31 (x^71)-2.968074003146367`*^31 (x^72)+1.0888858209994192`*^31 (x^73)+1.6962458098621064`*^31 (x^74)-8.201702988762625`*^30 (x^75)-8.789627636871981`*^30 (x^76)+5.377070481008784`*^30 (x^77)+4.1130882669724276`*^30 (x^78)-3.1368100634404495`*^30 (x^79)-1.7249572410636977`*^30 (x^80)+1.6477222485778672`*^30 (x^81)+6.39169315913069`*^29 (x^82)-7.847542656203305`*^29 (x^83)-2.032820143253147`*^29 (x^84)+3.402679812808801`*^29 (x^85)+5.167059541093217`*^28 (x^86)-1.3463131531339661`*^29 (x^87)-7.960135620681834`*^27 (x^88)+4.865570705138749`*^28 (x^89)-1.1752496117143275`*^27 (x^90)-1.605925473139707`*^28 (x^91)+1.63581515196485`*^27 (x^92)+4.8349311384305676`*^27 (x^93)-8.578460236057997`*^26 (x^94)-1.324539943048245`*^27 (x^95)+3.3701105979506836`*^26 (x^96)+3.288481433475279`*^26 (x^97)-1.1094264576852431`*^26 (x^98)-7.352070689734266`*^25 (x^99)+3.182390772981661`*^25 (x^100)+1.4650053060292207`*^25 (x^101)-8.093306982220306`*^24 (x^102)-2.5560220730139763`*^24 (x^103)+1.8398263561962637`*^24 (x^104)+3.770659864521711`*^23 (x^105)-3.751472098557298`*^23 (x^106)-4.3114694693683984`*^22 (x^107)+6.8641244826957464`*^22 (x^108)+2.6145533148541747`*^21 (x^109)-1.1248374371842961`*^22 (x^110)+3.463891852793028`*^20 (x^111)+1.6439529791008478`*^21 (x^112)-1.5771131921229513`*^20 (x^113)-2.128035859391645`*^20 (x^114)+3.438153172769248`*^19 (x^115)+2.4135705049014096`*^19 (x^116)-5.629768147992444`*^18 (x^117)-2.356921336675342`*^18 (x^118)+7.555586543780797`*^17 (x^119)+1.920893412465877`*^17 (x^120)-8.545034124124984`*^16 (x^121)-1.2213078814822286`*^16 (x^122)+8.203772188221278`*^15 (x^123)+4.855085456624296`*^14 (x^124)-6.662719028703006`*^14 (x^125)+6.406463341536867`*^12 (x^126)+4.521384878206569`*^13 (x^127)-3.2321805875771216`*^12 (x^128)-2.504555648287189`*^12 (x^129)+3.354532723086376`*^11 (x^130)+1.0847482564701779`*^11 (x^131)-2.2678630738320774`*^10 (x^132)-3.3453617727399607`*^9 (x^133)+1.111168957577894`*^9 (x^134)+5.285282723677302`*^7 (x^135)-3.940311328658175`*^7 (x^136)+878779.7474303956` (x^137)+950412.9293440002` (x^138)-77322.00575999994` (x^139)-13077.54240000001` (x^140)+1987.7759999999998` (x^141)+39.160000000000096` (x^142)-20.400000000000006` (x^143)+(x^144);

corr189dir:={};

For[k=1,k<234,k++,AppendTo[corr189dir,Abs[vephn[[k,1]]*vephn[[k,89]]]]];

ListPlot[corr189dir]

corr189th:={};

For[k=1,k<234,k++,
AppendTo[corr189th,Abs[p89[vaphn[[k]]]*Exp[-233*thouless[vaphn[[k]]]]]]];

ListPlot[{corr189th,corr189dir}]

(*sites 1 et 55*)

fiboseq[10];

corr155dir:={};

For[k=1,k<234,k++,AppendTo[corr155dir,Abs[vephn[[k,1]]*vephn[[k,55]]]]];

ListPlot[{corr155th,corr155dir}]

corr155th:={};

reste55=matkn06[fiboseq[13]-fiboseq[10],13];

CharacteristicPolynomial[reste55,x]

p55[x_]:=-81.81241853171144`-7978.239766313951` x-43482.29158689165` (x^2)+1.2624278692517174`*^7 (x^3)+2.351381589896306`*^8 (x^4)-5.254352272898215`*^9 (x^5)-1.228145048991005`*^11 (x^6)+1.2330419011990518`*^12 (x^7)+3.024123295585785`*^13 (x^8)-2.1286428004803438`*^14 (x^9)-4.446710226960575`*^15 (x^10)+2.8911449364224416`*^16 (x^11)+4.2627937878417094`*^17 (x^12)-3.005133495162952`*^18 (x^13)-2.7411987168187765`*^19 (x^14)+2.3167402152446525`*^20 (x^15)+1.154468854725379`*^21 (x^16)-1.307036501516546`*^22 (x^17)-2.7232078059956746`*^22 (x^18)+5.362916444808636`*^23 (x^19)-1.536224392481935`*^22 (x^20)-1.5822343624952348`*^25 (x^21)+2.7654465887404205`*^25 (x^22)+3.255389511888438`*^26 (x^23)-1.1356601033271739`*^27 (x^24)-4.2756923428526926`*^27 (x^25)+2.6358917803270078`*^28 (x^26)+2.3545406714537903`*^28 (x^27)-4.015677777801654`*^29 (x^28)+3.068578612368206`*^29 (x^29)+4.1070907821716406`*^30 (x^30)-8.802033652124827`*^30 (x^31)-2.6884031828774316`*^31 (x^32)+1.0840058747893227`*^32 (x^33)+8.324636964633721`*^31 (x^34)-8.700859165796277`*^32 (x^35)+3.515959932845931`*^32 (x^36)+4.985900732899093`*^33 (x^37)-6.571765709703472`*^33 (x^38)-2.0705176579821655`*^34 (x^39)+4.923104523505008`*^34 (x^40)+5.804775269375129`*^34 (x^41)-2.5489126726001575`*^35 (x^42)-6.370115464702475`*^34 (x^43)+1.017419632228056`*^36 (x^44)-3.824996630856912`*^35 (x^45)-3.2584482028392864`*^36 (x^46)+2.98962415844593`*^36 (x^47)+8.468030792903661`*^36 (x^48)-1.2783852178788795`*^37 (x^49)-1.7583570151428837`*^37 (x^50)+4.128892349690324`*^37 (x^51)+2.709910402507379`*^37 (x^52)-1.09429729993394`*^38 (x^53)-2.1110478541546401`*^37 (x^54)+2.464960897866415`*^38 (x^55)-3.940981372670827`*^37 (x^56)-4.803469144958892`*^38 (x^57)+2.239416589278956`*^38 (x^58)+8.168154298217808`*^38 (x^59)-6.2599654816778994`*^38 (x^60)-1.214190097305996`*^39 (x^61)+1.3344262025863942`*^39 (x^62)+1.5680585622026897`*^39 (x^63)-2.3851697444012752`*^39 (x^64)-1.724521772671603`*^39 (x^65)+3.712834026982059`*^39 (x^66)+1.5290036007341057`*^39 (x^67)-5.1319489760923316`*^39 (x^68)-8.96079076144515`*^38 (x^69)+6.370297610846875`*^39 (x^70)-1.3351849387394863`*^38 (x^71)-7.150893736480412`*^39 (x^72)+1.3833908789191723`*^39 (x^73)+7.289528045836616`*^39 (x^74)-2.591876525737942`*^39 (x^75)-6.761776834907918`*^39 (x^76)+3.5019220861269493`*^39 (x^77)+5.707415796934284`*^39 (x^78)-3.9480528165794123`*^39 (x^79)-4.372894477576652`*^39 (x^80)+3.9012196977830986`*^39 (x^81)+3.0228785751423783`*^39 (x^82)-3.457042980635573`*^39 (x^83)-1.8620394686484904`*^39 (x^84)+2.782074138396051`*^39 (x^85)+9.955686032267425`*^38 (x^86)-2.0488234318241322`*^39 (x^87)-4.330091511246956`*^38 (x^88)+1.3874422493651577`*^39 (x^89)+1.2042872891241555`*^38 (x^90)-8.666322990294771`*^38 (x^91)+2.054834627005084`*^37 (x^92)+5.0020561448624945`*^38 (x^93)-6.296017164290594`*^37 (x^94)-2.6698576253841837`*^38 (x^95)+5.988713295144935`*^37 (x^96)+1.3175143436323532`*^38 (x^97)-4.261221628649162`*^37 (x^98)-6.003083958693042`*^37 (x^99)+2.5703434179623315`*^37 (x^100)+2.5185756861875473`*^37 (x^101)-1.3727904150609855`*^37 (x^102)-9.682871020442067`*^36 (x^103)+6.6242551754415`*^36 (x^104)+3.383185330409613`*^36 (x^105)-2.919333168354308`*^36 (x^106)-1.0584370484237626`*^36 (x^107)+1.1823465084392653`*^36 (x^108)+2.8783172742765236`*^35 (x^109)-4.416638234351073`*^35 (x^110)-6.3270789226665985`*^34 (x^111)+1.5246472744012953`*^35 (x^112)+8.4678782348243`*^33 (x^113)-4.867309979236799`*^34 (x^114)+1.1811392665667995`*^33 (x^115)+1.4365182967182545`*^34 (x^116)-1.4333700652596112`*^33 (x^117)-3.914266964979374`*^33 (x^118)+6.823286348496825`*^32 (x^119)+9.822161020440124`*^32 (x^120)-2.4701264986730964`*^32 (x^121)-2.2604614184306657`*^32 (x^122)+7.594168078291722`*^31 (x^123)+4.740264536529469`*^31 (x^124)-2.061438058462888`*^31 (x^125)-8.962634529274323`*^30 (x^126)+5.0278733215109514`*^30 (x^127)+1.4997873009177175`*^30 (x^128)-1.1113473704743124`*^30 (x^129)-2.1394445611237497`*^29 (x^130)+2.2351386133890532`*^29 (x^131)+2.359705390264676`*^28 (x^132)-4.095016670298385`*^28 (x^133)-1.2418164494346677`*^27 (x^134)+6.827912383960108`*^27 (x^135)-2.607675032212359`*^26 (x^136)-1.0330668259741669`*^27 (x^137)+1.0749417218984672`*^26 (x^138)+1.4109633684773806`*^26 (x^139)-2.419196538672023`*^25 (x^140)-1.7250516873107984`*^25 (x^141)+4.24294801147553`*^24 (x^142)+1.8621911054383117`*^24 (x^143)-6.274691212143268`*^23 (x^144)-1.7322178036476358`*^23 (x^145)+8.045071215991147`*^22 (x^146)+1.3195799448161297`*^22 (x^147)-9.034972420716871`*^21 (x^148)-7.105177462363822`*^20 (x^149)+8.901595599670263`*^20 (x^150)+7.01869043905244`*^18 (x^151)-7.660178531385164`*^19 (x^152)+4.268242869696347`*^18 (x^153)+5.698097339461729`*^18 (x^154)-6.749413684984842`*^17 (x^155)-3.595425268999533`*^17 (x^156)+6.768922674813969`*^16 (x^157)+1.8579671193614644`*^16 (x^158)-5.21789555439039`*^15 (x^159)-7.270435207025734`*^14 (x^160)+3.230671432269384`*^14 (x^161)+1.6344317970929676`*^13 (x^162)-1.6128232943062672`*^13 (x^163)+2.818888494392124`*^11 (x^164)+6.36628533696293`*^11 (x^165)-4.972234463341736`*^10 (x^166)-1.892509435048991`*^10 (x^167)+2.7306054778011036`*^9 (x^168)+3.7606830334656024`*^8 (x^169)-9.361472136378627`*^7 (x^170)-2.966743466419202`*^6 (x^171)+2.0849554513279996`*^6 (x^172)-74539.46304000002` (x^173)-26740.303999999975` (x^174)+2547.216` (x^175)+108.47999999999996` (x^176)-25.200000000000006` (x^177)+(x^178);

For[k=1,k<234,k++,
AppendTo[corr155th,Abs[p55[vaphn[[k]]]*Exp[-233*thouless[vaphn[[k]]]]]]];

(*ca se verifie plutot bien. On passe maintenant a l'etude du RMS*)

fiboseq[8];

s[n_,m_]:= Sum[k^2*vephn[[n,k]]*vephn[[m,k]],{k,233}];

s[1,1]

rms[t_]:= Sum[Exp[-I*(vaphn[[n]]-vaphn[[m]])*t]*vephn[[n,21]]*vephn[[m,21]]*s[n,m],{n,1,233},{m,1,233}];

to[x_,y_]:=x+y;

valsnm:=Table[s[i,j],{i,1,234},{j,1,234}];

(*avec un systeme moins grand ...*)

H12= matkn06[144,12];

H12[[144,144]]

vap12=Eigenvalues[H12];

vep12 = Eigenvectors[H12];

s12[n_,m_]:= Sum[k^2*vep12[[n,k]]*vep12[[m,k]],{k,144}];

ListPlot[vap12]

rms[t_]:=Sum[Exp[-I*(vap12[[n]]-vap12[[m]])*t]*vep12[[n,21]]*vep12[[m,21]]*s12[n,m],{n,1,144},{m,1,144}];

rms[1]

rrms[t_]:=Re[rms[t]];

rrms[1]

DiscretePlot[rrms[n],{n,50}]

DiscretePlot[Sqrt[rrms[50+n]],{n,100}]

log12[x_,k_]:=If[x==vap12[[k]],0,Log[Abs[x-vap12[[k]]]]];

thouless12[x_]:=Sum[ N[log12[x,k]/144],{k,1,144}];
alpha:=N[(1+Sqrt[5])/2]

alpha

sth[n_,m_]:=1/(alpha*Log[alpha])*Exp[-thouless12list[[n]]-thouless12list[[m]]]/(thouless12list[[n]]+thouless12list[[m]])*(1+2/(thouless12list[[n]]+thouless12list[[m]])+2/(thouless12list[[n]]+thouless12list[[m]])^2);

sth[1,2]

DiscretePlot[sth[1,n],{n,144}]

DiscretePlot[Abs[s12[1,n]],{n,144}]

rmsth[t_]:=Sum[Exp[-I*(vap12[[n]]-vap12[[m]])*t]*vep12[[n,21]]*vep12[[m,21]]*sth[n,m],{n,1,144},{m,1,144}];

rrmsth[t_]:=Re[rmsth[t]];

DiscretePlot[Sqrt[rrmsth[t]],{t,100}]

rrmsth[3]

thouless12list:={};

For[k=1,k<145,k++, AppendTo[thouless12list, thouless12[vap12[[k]]]]];

DiscretePlot[Sqrt[rrmsth[k]],{k,100}];

DiscretePlot[Sqrt[rrmsth[100+10*k]],{k,100}]

sth2[n_,m_]:=Sum[(fiboseq[k+1])^2*fiboseq[k]*Exp[-fiboseq[k+1]*(thouless12[vap12[[n]]]+thouless12[vap12[[m]]])],{k,11}];

sth2[1,1]

DiscretePlot[{sth[1,n],sth2[1,n],1000*Abs[s12[1,n]]},{n,144}]

(*il faut peut etre des systemes plus grands... Testons deja s'il y a oscillations avec la fromule sth*)
fiboseq[15]
H17  = matkn06[1597,17];

vap17 = Eigenvalues[H17];
vep17 = Eigenvectors[H17];

rmsth17[t_]:=Sum[Exp[-I*(vap17[[n]]-vap17[[m]])*t]*vep17[[n,21]]*vep17[[m,21]]*sth17[n,m],{n,1,1597},{m,1,1597}];

fiboseq[17];
log17[x_,k_]:=If[x==vap17[[k]],0,Log[Abs[x-vap17[[k]]]]];
thouless17[x_]:=Sum[ N[log17[x,k]/1597],{k,1,1597}];

sth17[n_,m_]:=Sum[(fiboseq[k+1])^2*fiboseq[k]*Exp[-fiboseq[k+1]*(thouless17[vap17[[n]]]+thouless17[vap17[[m]]])],{k,17}];

thouless17list:={};

For[k=1,k<1598,k++,AppendTo[thouless17list,thouless17[vap17[[k]]]]];

sth172[n_,m_]:=Exp[-thouless17list[[n]]-thouless17list[[m]]]/(thouless17list[[n]]+thouless17list[[m]])*(1+2/(thouless17list[[n]]+thouless17list[[m]])+2/(thouless17list[[n]]+thouless17list[[m]])^2);

rmsth172[t_]:=Sum[Exp[-I*(vap17[[n]]-vap17[[m]])*t]*vep17[[n,21]]*vep17[[m,21]]*sth172[n,m],{n,1,1597},{m,1,1597}];

sth172[1256,5]

Clear[rmsth172]

rmsth172[4]

rmsth172half[t_,n_]:=Sum[Exp[-I*(vap17[[n]]-vap17[[m]])*t]*vep17[[n,21]]*vep17[[m,21]]*sth172[n,m],{m,1,1597}];

rmsth172half[1,1]

rmsth173[t_]:=Sum[rmsth172half[t,n],{n,1,1597}];

rmsth173[4]

s17[n_,m_]:= Sum[k^2*vep17[[n,k]]*vep17[[m,k]],{k,1597}];

DiscretePlot[s17[1,10*n],{n,159}]

s17[1,1]

s17list:={};

For[k=1,k<101,k++,AppendTo[s17list,s17[1,k]]];

fiboseq[14]

corr1377dir :={};

For[k=1,k<1598,k++,AppendTo[corr1377dir,Abs[vep17[[k,1]]*vep17[[k,233]]]]];

corr1377th:={};

For[k=1,k<1598,k++,AppendTo[corr1377th,Exp[-377*thouless17[vap17[k]]]]];