getData[dir_]:=Dataset[With[{data=Import[#],metadata=ToExpression/@Rest[StringSplit[FileBaseName[#],"_"]]},<|"n"->metadata[[1]],"β0"->metadata[[2]],"βf"->metadata[[3]],"nβ"->metadata[[4]],"As"->Rest[data]/First[First[data]]|>]&/@FileNames[FileNameJoin[{dir,"probs_*.dat"}]]]

c[βi_,βj_][A_]:=2(((((βi)^2)+((βj)^2)))/(((βi-βj))^2))((InverseErfc[A])^2)

Ts[dat_]:=Range[dat["β0"],dat["βf"],(dat["βf"]-dat["β0"])/(dat["nβ"]-1)]

Cstmp[dat_]:=With[{ts=Ts[dat]},{{#,#+ts[[2]]-ts[[1]]}&/@ts,Last/@dat["As"]}]

Cs[dat_]:=With[{ts=Ts[dat]},MapThread[{Mean[{#1[[1]],#1[[2]]}],c[#1[[1]],#1[[2]]][#2]}&,{{#,#+ts[[2]]-ts[[1]]}&/@Most[ts],Last/@dat["As"]}]]

ΔSs[dat_]:=With[{ts=1/Ts[dat],cs=Cs[dat]},{Mean[1/#1],((#2(#1[[1]]-#1[[2]]))/(Mean[#1]))}&@@@Thread[{Rest@Rest[FoldList[{#1[[2]],#2}&,{0,0},ts]],Cs[dat][[All,2]]}]]

Ss[dat_]:=With[{ss=ΔSs[dat]},Thread[{ss[[All,1]],Accumulate[ss[[All,2]]]}]]

d=getData["~/doc/research/hadamard/code/"];

ListPlot[d[SortBy["n"],With[{L=((#n)^2)},{#1,#2/L}&@@@Ss[#]]&],Joined->True,PlotRange->All]

ListPlot[d[SortBy["n"],With[{L=((#n)^2)},{#1,#2/L}&@@@Cs[#]]&],Joined->True,PlotRange->All]

a=Import["~/doc/research/hadamard/code/energies_32_0.250000_16.000000_64.dat"];

ListPlot[a]

16/64//N