GV/DT/PT/D4D2D0 invariants

Accompanying notebook for the article “Quantum Geometry, Stability and Modularity” [arxiv:2301.nnnnn]
by Sergei Alexandrov, Soheyla Feyzbakhsh, Albrecht Klemm, Boris Pioline and Thorsten Schimannek

ClearAll[pmax,GVTab,DTTab,PTTab,PTTabGv,GVTabExt,GVTabExt2,h1,h1fun,h1int];
SetDirectory[NotebookDirectory[]];

(* Download from http://www.th.physik.uni-bonn.de/Groups/Klemm/data.php, and save same directory as this notebook *)
<<GVDTPTlib.m

(* Download the datafile X*.m for your favorite hypergeometric CY3 from http://www.th.physik.uni-bonn.de/Groups/Klemm/data.php *)
<<X6.m

(* maximal genus in the table of GV invariants *)
gmaxGV=Length[GVTab]-1;
(* highest genus attainable with standard boundary conditions *)
gInt=gMaxInteg[kappa,CYreg];
(* maximal degree in the table of GV invariants *)
QmaxGV=Length[Transpose[GVTab]];
(* extract Fourier coefficients in generating series of D4D2D0 invariants *)
JTab=CoefficientList[h1int,q];
(* restore leading powers of q in vector valued generating series *)
h1=Table[h1int[[mu+1]] q^(-(kappa+c2 )/24+FractionalPart[mu^2/(2kappa )+mu  /2]),{mu,0,Length[h1int]-1}];

(* CYname, Euler number, H^3, c2(TY).H, effective regulator rho, maximal attainable genus, maximal available genus *)
{CY,chi,kappa,c2,CYreg,QmaxGV,gInt,gmaxGV}

(* check CY condition and kappa value *)
{Plus@@CYwts-Plus@@CYmod,kappa-Times@@CYmod/Times@@CYwts}

(* compare polar part with naive ansatz (4.11) *)
Series[Take[h1-ZPolarNaive[kappa,c2,1,Table[0,{mu,0,kappa-1}]]/.repDT,Floor[kappa/2+1]],{q,0,0}]

(* predictions from naive ansatz (4.11) for non-polar terms *)
With[{dn=2},Take[ZPolarNaiveInt[kappa,c2,1,Table[dn,{mu,0,kappa-1}]]/.repDT,Floor[kappa/2+1]]]

(* Extra constraints for the direct integration method; increase dn until unknown coefficients appear *)
With[{dn=5},GVPrediction[kappa,CYreg,gInt+10]]

(* GV invariants saturating the Castelnuovo constraint, for degree multiple of kappa *)
Table[GVSaturating[kappa,c2,kappa k],{k,1,10}]

(* Table of GV[g,d] row=genus, column= degree; data from direct integration *)
GVTab//MatrixForm

(* Table of DT[d,n] row=degree, 1st column=nmin *)
DTTab//MatrixForm

(* Table of PT[d,n] row=degree, 1st column=nmin *)
PTTab//MatrixForm

(* Table of PT[d,n] row=degree, 1st column=nmin; computed from GVTab + unknown Gv[g,d] *)
PTTabGv//MatrixForm

(* Table of GV[g,d] row=genus, column= degree; data from GVTab + modular constraints *)
GVTabExt//MatrixForm

(*  Same as previous table, but different format; row= degree, 1st column= gMax[d]; data from direct integration + modularity *)
GVTabExt2//MatrixForm

(* check GVTabExt2 against known GV invariants *)
repGV={Gv[g_,m_]:>If[g>gMax[kappa,m]||m==0||g<0,0,If[g+1≤Length[GVTab],If[m≤Length[GVTab[[g+1]]],GVTab[[g+1,m]],Gv[g,m]],Gv[g,m]]]};
Table[Join[{m,gMax[kappa,m]},Table[If[NumericQ[GVTabExt2[[m,delta+2]]],GVTabExt2[[m,delta+2]]-Gv[gMax[kappa,m]-delta,m]/.repGV,GVTabExt2[[m,delta+2]]],{delta,0,5}]],{m,1,Length[GVTabExt2]}]/.repGV//MatrixForm

(* GVTabExt2 with 1st column=degree, and ? replaced by known GV invariants; if result depends on unknown PT, leave ? *)
repGV={Gv[g_,m_]:>If[g>gMax[kappa,m]||m==0||g<0,0,If[g+1≤Length[GVTab],If[m≤Length[GVTab[[g+1]]],GVTab[[g+1,m]],Gv[g,m]],Gv[g,m]]]};
Table[Join[{m,gMax[kappa,m]},Table[If[GVTabExt2[[m,delta+2]]==="?"||GVTabExt2[[m,delta+2]]==="",Gv[gMax[kappa,m]-delta,m]/.repGV,If[NumericQ[GVTabExt2[[m,delta+2]]],GVTabExt2[[m,delta+2]],"?"]],{delta,0,5}]],{m,1,Length[GVTabExt2]}]/.repGV//MatrixForm

Various routines, now in auxiliary file GVDTPTlib.m

(* Castelnovo upper bound on the genus of GV invariants for fixed degree *)
gMax[kappa_,mu_]:=Floor[((mu^2)/(2 kappa))+(mu/2)+1];
(* Castelnovo lower bound on the degree of GV invariants for fixed genus *)
Qmin[kappa_,g_]:=Ceiling[-kappa/2+1/2Sqrt[kappa(8(g-1)+kappa)]];
(* nb of holomorphic ambiguities at genus g, assuming Castelnuovo vanishing and GV at maximal genus *)
NbAmbiguities[kappa_,reg_,g_]:=Max[0,Floor[2(g-1)/reg]-Floor[-kappa/2+1/2Sqrt[kappa(8(g-1)+kappa)]]];
(* maximal genus attainable by direct integration, using bc and Castelnuovo vanishing + saturating data *)
gMaxInteg[kappa_,reg_]:=Module[{g},
g=Floor[kappa reg^2/2-kappa reg/2+1];
While[NbAmbiguities[kappa,reg,g]<=0,g+=1];g-1];
(* Additional conditions from GV invariants predicted by modularity *)
GVPrediction[kappa_, reg_, gm_] := Module[{gmax},
   gmax = gMaxInteg[kappa, reg];
   If[gm <= gmax, Print["No ambiguities up to genus ", gmax]; {},
    Print["Number of ambiguities up to genus ", gm, ":", 
     Table[{g, NbAmbiguities[kappa, reg, g]}, {g, gmax + 1, gm}]];
    Flatten[
     Table[
      Table[
       Ngd[g, d] -> GVTabExt[[g + 1, d]], {d, Qmin[kappa, g], 
        Qmin[kappa, g] + NbAmbiguities[kappa, reg, g] - 1 + 
         If[g==gMax[kappa,Qmin[kappa,g]], 1, 0]}], {g, gmax + 1, 
       gm}]]]
   ];
GVPredictionOld[kappa_,reg_,gm_]:=Module[{gmax},
gmax=gMaxInteg[kappa,reg];
If[gm<=gmax,Print["No ambiguities up to genus ",gmax];{},
Print["Number of ambiguities up to genus ",gm,":",Table[{g,NbAmbiguities[kappa,reg,g]},{g,gmax+1,gm}]];
Flatten[Table[Table[Ngd[g,d]->GVTabExt[[g+1,d]],{d,Qmin[kappa,g],Qmin[kappa,g]+NbAmbiguities[kappa,reg,g]-1+If[Mod[Qmin[kappa,g],kappa]==0,1,0]}],{g,gmax+1,gm}]]]
];

(* Castelnuovo bound on the D0-charge for PT invariants *)
MMin[kappa_,mu_]:=Ceiling[-((mu^2)/(2kappa))-(mu/2)];
(* action of the spectral flow *)
mun[kappa_,mu_,n_]:=mu+n kappa;
mn[kappa_,mu_,M_,n_]:=M-n mu-(kappa/2)((n^2)+n);
(* from (mu,m) to (x,alpha) *)
mumToxa[kappa_,{mu_,m_}]:={mu/kappa,-3/2m/mu};
(* from (x,alpha) to (x,delta) *)
xaToxdelta[{x_,alpha_}]:={x,-2/3 x(alpha-3/4(x+1))};
(* spectral flow action on (x,alpha) *)
xan[x_,alpha_,n_]:={n+x,((4 alpha x+3 n (1+n+2 x))/(4 (n+x)))};
(* spectral flow transformation bringing D2 brane charge to the interval [0,κ/2] *)
SFmu[kappa_,mu_]:=Module[{x= Round[mu/kappa]},If[kappa x > mu,kappa x-mu ,mu-kappa x]];
SFM[kappa_,mu_,M_]:=Module[{x= Round[mu/kappa]},If[kappa x > mu,M+mu x+(kappa/2)x(1-x)-(kappa x-mu),M+mu x+(kappa/2)x(1-x)]];

ChiO1[kappa_,mu_,M_,n_]:=(kappa/2)n(n-1)+(n-1) mu-M+(kappa/6)+(c2/12);
ChiJ[kappa_,mu_,M_]:=- mu-M+(kappa/6)+(c2/12);

(* Conditions for application of Soheyla's Theorem *)
fcon[x_]:=If[x<1, x+(1/2),If[x<(15/8),Sqrt[2x+(1/4)],If[x<(9/4),(2/3)x+(3/4),If[x<3,(1/3)x+(3/2),(1/2)x+1]]]];
Con[kappa_,mu_,M_]:=((2 mu)/3)fcon[(mu/kappa)]+M;

(* Answer from simplified version of Soheyla's Thm 1.2, for r=1 *)
S1[kappa_,mu_,M_,n_]:=((((-1))^(ChiO1[kappa,mu,M,n]+1))/(ChiO1[kappa,mu,M,n]))PT[mun[kappa,mu,n],mn[kappa,mu,M,n]];

(* Determination of the minimal value of the spectral flow parameter n *)
nMin [kappa_,mu_,M_]:=Module[{n},n=1;
While[Con[kappa,mun[kappa,mu,n],mn[kappa,mu,M,n]]>=0,n++];
n
];
(* limits of summation *)
ULmu[kappa_,mu_,M_]:=mu+((3 kappa M)/(2 mu))+(kappa/2);
ULm[kappa_,mu_,M_,mup_]:=((((mu-mup))^2)/(2 kappa))+(1/2)(mu+mup)+M;
LLm[kappa_,mup_]:=-((((mup))^2)/(2 kappa))-(1/2)mup;
(* Answer from the improved version of Soheyla's Thm 1.2 *)
S2[kappa_,mu_,M_,n_]:=Module[{Mun,Mn},Mun=mun[kappa,mu,n];Mn=mn[kappa,mu,M,n];If[Mun>0,((((-1))^(ChiO1[kappa,mu,M,n]+1))/(ChiO1[kappa,mu,M,n]))(PT[Mun,Mn]-Sum[Sum[(((-1))^(ChiO1[kappa,mu,M,n]-mup+mp+1))(ChiO1[kappa,mu,M,n]-mup+mp)PT[mup,mp] J[SFmu[kappa,Mun-mup],SFM[kappa,Mun-mup,Mn-mp+mup]],{mp,Ceiling[LLm[kappa,mup]],Floor[ULm[kappa,Mun,Mn,mup]]}],{mup,1,Floor[ULmu[kappa,Mun,Mn]]}])
]];
(* Answer from the improved version of Soheyla's Thm 1.2, including Lemma 4.1 *)
S2Lemma[kappa_,mu_,M_,n_]:=Module[{Mun,Mn},Mun=mun[kappa,mu,n];Mn=mn[kappa,mu,M,n];If[Mun>0,((((-1))^(ChiO1[kappa,mu,M,n]+1))/(ChiO1[kappa,mu,M,n]))(PT[Mun,Mn]-If[Mun==4kappa&&Mn==-2Mun,1/2 ChiO[kappa,c2,2](ChiO[kappa,c2,2]-1),0]-Sum[Sum[(((-1))^(ChiO1[kappa,mu,M,n]-mup+mp+1))(ChiO1[kappa,mu,M,n]-mup+mp)PT[mup,mp] J[SFmu[kappa,Mun-mup],SFM[kappa,Mun-mup,Mn-mp+mup]],{mp,Ceiling[LLm[kappa,mup]],Floor[ULm[kappa,Mun,Mn,mup]]}],{mup,1,Floor[ULmu[kappa,Mun,Mn]]}])
]];
(* Answer for PT invariants from the improved version of Soheyla's Thm 1.2 *)
SJ[kappa_,mu_,M_]:=Sum[Sum[(((-1))^(ChiJ[kappa,mu,M]-mup+mp+1))(ChiJ[kappa,mu,M]-mup+mp)PT[mup,mp] J[SFmu[kappa,mu-mup],SFM[kappa,mu-mup,M-mp+mup]],{mp,Ceiling[LLm[kappa,mup]],Floor[ULm[kappa,mu,M,mup]]}],{mup,0,Floor[ULmu[kappa,mu,M]]}];

(* Conditions and the spectral flow parameter for the old version of Thm 1*)
Con1[kappa_,mu_,M_]:=(mu^2)+((8 (mu^3))/kappa)-9 (M^2);
Con2[kappa_,mu_,M_]:=((mu^2)/(3 kappa))+((2 mu)/3)+M;
Con3[kappa_,mu_,M_]:=((mu^2)/(2 kappa))+mu((1/2)-(1/kappa))+M+(1/kappa)+1;
Con4[kappa_,mu_,M_]:=((mu^2)/(2 kappa))+2mu+(3/4)kappa+(9/4)(((M^2)kappa)/(mu^2))+((3M kappa)/mu)+(5/2)M;
nMinOld [kappa_,mu_,M_]:=Module[{n},n=1;
While[Con1[kappa,mun[kappa,mu,n],mn[kappa,mu,M,n]]>=0||Con2[kappa,mun[kappa,mu,n],mn[kappa,mu,M,n]]>=0 ||Con3[kappa,mun[kappa,mu,n],mn[kappa,mu,M,n]]>=0 || Con4[kappa,mun[kappa,mu,n],mn[kappa,mu,M,n]]>=0,n++];
n
];

(* determine allowed values of (r,c) in Lemma 2.1 *)
Rankm1WC0[{x_,alpha_}]:=Module[{b1,b2,rmax,Li,r01max,xmin},
(* follows reasoning in proof of Lemma 2.1 *)
b1=alpha-Sqrt[alpha^2-2x];
b2=alpha+Sqrt[alpha^2-2x];
rmax=Floor[b1/(b2-b1)];
r01max=Floor[b2/(b2-b1)];
Li=Drop[Flatten[Table[Table[{r,c},{c,Ceiling[b2 r],Floor[b1(1+r)]}],{r,0,rmax}],1],1];
If[Length[Li]<8,Li,999]
];
(* for each (r,c), further determine allowed (r0,r1) *)
Rankm1WC[{x_,alpha_}]:=Module[{b1,b2,rmax,Li,r01max,xmin},
If[alpha^2<2x,Print["The BMT line does not intersect the parabola"]];
If[alpha^2==2x,Print["The BMT line is tangent to parabola"]];
b1=alpha-Sqrt[alpha^2-2x];
b2=alpha+Sqrt[alpha^2-2x];
Print["(b1,b2)=",N[{b1,b2}]];
If[alpha>fcon[x],Print["Satisfies Thm 1.1"]];
rmax=Floor[b1/(b2-b1)];
r01max=Floor[b2/(b2-b1)];
Li=Drop[Flatten[Table[Table[{r,c},{c,Ceiling[b2 r],Floor[b1(1+r)]}],{r,0,rmax}],1],1];
Print["Allowed (r,c):", Li];
Table[
Print["(r,c)=",Li[[i]],": E0:",Li[[i]],", E1:",{-1,0}-Li[[i]]];
Do[If[r0+r1>=1&& r0+r1<=r01max&&r1-1-Li[[i,1]]>=0,
xmin=-b2^2/2+1/2(b2^2-b1^2)(r0+r1);
Print["{{r0',r0},{r1',r1}=",{{Li[[i,1]]+r0,r0},{r1-1-Li[[i,1]],r1}},", x<=",N[xmin]]];
,{r0,0,r01max},{r1,0,r01max}];
,{i,Length[Li]}];
];
(* arithmetic genus chi(O(rD)) *)
ChiO[kappa_,c2_,r_]:=1/6 kappa r^3 +c2/12 r;
(* Euler characteristic of divisor *)
ChiD[kappa_,c2_,r_]:=kappa r^3+c2 r;
(* exponent Delta_mu *)
Deltamu[kappa_,c2_,p_,mu_]:=(kappa*p^3+c2*p)/24-((mu^2/(kappa*p)+mu*p)/2-Floor[(mu^2/(kappa*p)+mu*p)/2]);
(* number of polar terms *)
PolarP[kappa_,c2_,p_]:=Sum[Ceiling[Deltamu[kappa,c2,p,mu]],{mu,0,Ceiling[(kappa*p-1)/2]}];
(* GV saturating Castelnuovo bound for mu=0 mod kappa *)
GVSaturating[kappa_,c2_,mu_]:=Module[{n},If[Mod[mu,kappa]!=0,"?",n=mu/kappa;If[n>=(7-kappa)/6/kappa+2,(-1)^(kappa n(n-1)/2)(1/2 kappa n(n-1)+ChiO[kappa,c2,1])ChiO[kappa,c2,1],"?"]]];
(* dimension of space of VV modular forms *)
Dimh[kappa_,c2_,p_]:=Plus@@{Sum[Deltamu[kappa,c2,p,mu],{mu,0,Ceiling[(kappa*p-1)/2]}]+7/24*Ceiling[(kappa*p+1)/2],-1/4*(-1)^(1/6kappa*p^3+c2*p/12)*(KroneckerDelta[0,Mod[kappa*p,4]]+KroneckerDelta[1,Mod[kappa*p,4]]),1/3*(KroneckerDelta[2,Mod[kappa*p,6]]+KroneckerDelta[3,Mod[kappa*p,6]])};
ZPolarNaive[kappa_,c2_,r_,Ord_]:=Module[{L},L=kappa r^3/6+c2 r/12;Normal[Table[Series[Sum[
If[(L-n-r mu)>0,(-1)^(n+r mu+L+1)(L-n- r mu)DT[mu,n]q^(-(kappa r^3+c2 r)/24+n+mu^2/(2kappa r)+mu r /2),0],{n,-DTTab[[mu+1,1]],(kappa r^3+c2 r)/24-mu^2/(2kappa r)-mu r /2+Ord[[mu+1]]}],{q,0,Ord[[mu+1]]+If[IntegerQ[-(kappa r^3+c2 r)/24+mu^2/(2kappa r)+mu r /2],-1,0]}],{mu,0,Length[Ord]-1}]]];
ZPolarNaiveInt[kappa_,c2_,r_,Ord_]:=Module[{L},L=kappa r^3/6+c2 r/12;Normal[Table[q^((kappa r^3+c2 r)/24-mu^2/(2kappa r)-mu r /2)Series[Sum[
If[(L-n-r mu)>0,(-1)^(n+r mu+L+1)(L-n- r mu)DT[mu,n]q^(-(kappa r^3+c2 r)/24+n+mu^2/(2kappa r)+mu r /2),0],{n,-DTTab[[mu+1,1]],(kappa r^3+c2 r)/24-mu^2/(2kappa r)-mu r /2+Ord[[mu+1]]}],{q,0,Ord[[mu+1]]+If[IntegerQ[-(kappa r^3+c2 r)/24+mu^2/(2kappa r)+mu r /2],-1,0]}],{mu,0,Length[Ord]-1}]]];
ZPolarNaive[kappa_,c2_,r_]:=ZPolarNaive[kappa,c2,r,Table[0,{mu,0,r kappa/2}]];
(* table of CY, chi,kappa, c2, type, reg *)
LiCY={{"X5",-200,5,50,"F",5},{"X6",-204,3,42,"F",6},{"X8",-296,2,44,"F",8},{"X10",-288,1,34,"F",10},{"X43",-156,6,48,"F",3},{"X44",-144,4,40,"K",4},{"X62",-256,4,52,"C",6},{"X64",-156,2,32,"F",4},{"X66",-120,1,22,"K",6},{"X33",-144,9,54,"K",3},{"X42",-176,8,56,"C",4},{"X322",-144,12,60,"C",4},{"X2222",-128,16,64,"M",2},{"RodlandGrassmannian",-98,42,84,"?",1},{"RodlandPfaffian",-98,14,56,"?",1},{"ReyeCongrX",-50,35,50,"?",1},{"ReyeCongrY",-50,10,40,"?",1}};

(* rules for substitution of invariants *)
repGV={Gv[g_,m_]:>If[g>gMax[kappa,m]||m==0||g<0,0,If[g+1≤Length[GVTab],If[m≤Length[GVTab[[g+1]]],GVTab[[g+1,m]],Gv[g,m]],Gv[g,m]]]};
repPT={PT[mu_,n_]:>If[n<MMin[kappa,mu],0,If[mu+1<=Length[PTTab],If[n-MMin[kappa,mu]+2<=Length[PTTab[[mu+1]]],PTTab[[mu+1,n-MMin[kappa,mu]+2]],PT[mu,n]],PT[mu,n]]]};
repPTGv={PT[mu_,n_]:>If[n<MMin[kappa,mu],0,If[mu+1<=Length[PTTabGv],If[n-MMin[kappa,mu]+2<=Length[PTTabGv[[mu+1]]],PTTabGv[[mu+1,n-MMin[kappa,mu]+2]],PT[mu,n]],PT[mu,n]]]};repDT={DT[mu_,n_]:>If[n<MMin[kappa,mu],0,If[mu+1<=Length[DTTab],If[n-MMin[kappa,mu]+2<=Length[DTTab[[mu+1]]],DTTab[[mu+1,n-MMin[kappa,mu]+2]],DT[mu,n]],DT[mu,n]]]};


repJ={J[mu_,n_]:>If[n<MMin[kappa,mu],0,If[mu+1<=Length[JTab]&& n+1<=Length[JTab[[mu+1]]]+MMin[kappa,mu],JTab[[mu+1,n-MMin[kappa,mu]+1]],J[mu,n]]]};
repPTfromJ={PT[mu_,n_]:>If[n<MMin[kappa,mu],0,If[mu+1<=Length[PTTab]&& n-MMin[kappa,mu]+2<=Length[PTTab[[mu+1]]],PTTab[[mu+1,n-MMin[kappa,mu]+2]],If[Con[kappa,mu,n]<0 , SJ[kappa,mu,n],PT[mu,n]]]]};

(* valid only for m close to Castelnuovo bound *)
repPTApprox={PT[b_,m_]:>Sum[Binomial[2g-2,g-1-m]Gv[g,b],{g,1,Floor[b^2/(2kappa)+b/2+1]}]/.repGV};
(* same but do not evaluate GV invariants *)
repPTApprox0={PT[b_,m_]:>Sum[Binomial[2g-2,g-1-m]Gv[g,b],{g,1,Floor[b^2/(2kappa)+b/2+1]}]};

Ch[mu_,M_,n_]:=Module[{Mun,Mn},Mun=mun[kappa,mu,n];Mn=mn[kappa,mu,M,n];If[(-((3 Mn)/(2 Mun)))^2>2((Mun/kappa)),{(Mun/kappa),-((3 Mn)/(2 Mun))},{}]];

The following routines are NOT YET in auxiliary file GVDTPTlib.m

(* D4D2D0 indices with r=2 *)
(* low limit for D2-brane charge of the constituents *)
LBmu[kappa_,mu_,M_,n_]:=((kappa((n+1)mu-3M+kappa(4- (n^2))))/(2(mu+2kappa(n+2))));
(* χ((Subscript[O, X])(-n),v) *)
ChiO[kappa_,c_,mu_,M_,n_]:=kappa n(n+2)+n mu-M+(4/3)kappa+(c/6);
(* prefactor *)
Fac[kappa_,c_,mu_,M_,n_]:=((((-1))^(ChiO[kappa,c,mu,M,n]+1))/(ChiO[kappa,c,mu,M,n]));
(* coefficients in the sum *)
Chi[kappa_,c_,mu_,mu2_,M2_,n_]:=(n+2)mu2-mu-M2+(c/12)+((kappa )/6)+(kappa/2)(n-1)(n+2);

(* different contributions from Soheyla's Thm 1.2 for r=2 corresponding to 0≤(∑_(i=1)^N)(Subscript[k, i])≤2 *)
(* contribution with N=0 *)
SPT0[kappa_,c_,mu_,M_,n_]:=Fac[kappa,c,mu,M,n]PT[mu+2kappa(n+2),M-(n+2)mu-kappa(n+2)(n+4)];

(* contribution with N=1 and (Subscript[k, 1])=1 *)
(* upper bound on D0-brane charge *)
UBm1[kappa_,mu_,M_,mu2_,n_]:=M+(1/(2kappa))(((mu-mu2))^2)+(3/2)(mu-mu2);
(* the contribution *)
SPT1[kappa_,c_,mu_,M_,n_]:=Fac[kappa,c,mu,M,n]Sum[Sum[(((-1))^(Chi[kappa,c,mu,mu2,M2,n]))Chi[kappa,c,mu,mu2,M2,n] J[mu2,M2]PT[mu-mu2+kappa(n+2),M-M2-(n+1)(mu-mu2)-(kappa/2)(n+2)(n+3)],{M2,Ceiling[(kappa/8)],Floor[UBm1[kappa,mu,M,mu2,n]]}],{mu2,Ceiling[LBmu[kappa,mu,M,n]],Floor[mu+kappa(n+2)]}];
(* the contribution after spectral flow *)
SPT1sf[kappa_,c_,mu_,M_,n_]:=Fac[kappa,c,mu,M,n]Sum[Sum[(((-1))^(Chi[kappa,c,mu,mu2,M2,n]))Chi[kappa,c,mu,mu2,M2,n] J[SFmu[kappa,mu2],SFM [kappa,mu2,M2]]PT[mu-mu2+kappa(n+2),M-M2-(n+1)(mu-mu2)-(kappa/2)(n+2)(n+3)],{M2,Ceiling[(kappa/8)],Floor[UBm1[kappa,mu,M,mu2,n]]}],{mu2,Ceiling[LBmu[kappa,mu,M,n]],Floor[mu+kappa(n+2)]}];

(* contribution with N=1 and (Subscript[k, 1])=2 *)
(* upper bound on D0-brane charge *)
UBm2[kappa_,mu_,M_,mu2_,n_]:=(1/2)M+(1/(4kappa))(((mu-2mu2))^2)+((3-2n)/4)(mu-2mu2)-((kappa n)/2);
(* the contribution *)
SPT2[kappa_,c_,mu_,M_,n_]:=Fac[kappa,c,mu,M,n]Sum[Sum[(((Chi[kappa,c,mu,mu2,M2,n] J[mu2,M2]))^2)PT[mu-2mu2+kappa,M-2M2-n(mu-2mu2)-kappa(n+1)],{M2,Ceiling[(kappa/8)],Floor[UBm2[kappa,mu,M,mu2,n]]}],{mu2,Ceiling[LBmu[kappa,mu,M,n]],Floor[(mu/2)+(kappa/2)]}];
(* the contribution after spectral flow *)
SPT2sf[kappa_,c_,mu_,M_,n_]:=Fac[kappa,c,mu,M,n]Sum[Sum[(((Chi[kappa,c,mu,mu2,M2,n] J[SFmu[kappa,mu2],SFM [kappa,mu2,M2]]))^2)PT[mu-2mu2+kappa,M-2M2-n(mu-2mu2)-kappa(n+1)],{M2,Ceiling[(kappa/8)],Floor[UBm2[kappa,mu,M,mu2,n]]}],{mu2,Ceiling[LBmu[kappa,mu,M,n]],Floor[(mu/2)+(kappa/2)]}];

(* contribution with N=2 and (Subscript[k, 1])=(Subscript[k, 2])=1 *)
(* the coefficients in the sum *)
Chi1[kappa_,c_,mu_,mu2_,M2_,mu3_,n_]:=If[mu2≤mu3,(n+2)mu2-mu-M2+(c/12)+((kappa )/6)+(kappa/2)(n-1)(n+2),(n+1)mu2+mu3-mu-M2+(c/12)+((kappa )/6)+(kappa/2)(n-1)(n+2)];
Chi2[kappa_,c_,mu_,mu2_,mu3_,M3_,n_]:=If[mu2≤mu3,(n+2)mu3-mu-M3+(c/12)+((kappa )/6)+(kappa/2)(n-1)(n+2),(n+1)mu3+mu2-mu-M3+(c/12)+((kappa )/6)+(kappa/2)(n-1)(n+2)];
(* upper bound on D0-brane charge *)
UBm11[kappa_,mu_,M_,mu2_,mu3_,n_]:=M+(1/kappa)(((mu-mu2-mu3))^2)+((3-2n)/2)(mu-mu2-mu3)-kappa n;
(* the contribution *)
SPT11[kappa_,c_,mu_,M_,n_]:=Fac[kappa,c,mu,M,n]Sum[Sum[Sum[Sum[(((-1))^(Chi1[kappa,c,mu,mu2,M2,mu3,n]+Chi2[kappa,c,mu,mu2,mu3,M3,n]))Chi1[kappa,c,mu,mu2,M2,mu3,n]Chi2[kappa,c,mu,mu2,mu3,M3,n]J[mu2,M2]J[mu3,M3]PT[mu-mu2-mu3+kappa,M-M2-M3-n(mu-mu2-mu3)-kappa(n+1)],{M2,Ceiling[(kappa/8)],Floor[UBm11[kappa,mu,M,mu2,mu3,n]]-M3}],{M3,Ceiling[(kappa/8)],Floor[UBm11[kappa,mu,M,mu2,mu3,n]]-Ceiling[(kappa/8)]}],{mu2,Ceiling[LBmu[kappa,mu,M,n]],Floor[mu+kappa]-mu3}],{mu3,Ceiling[LBmu[kappa,mu,M,n]],Floor[mu+kappa]-Ceiling[LBmu[kappa,mu,M,n]]}];
(* the contribution after spectral flow *)
SPT11sf[kappa_,c_,mu_,M_,n_]:=Fac[kappa,c,mu,M,n]Sum[Sum[Sum[Sum[(((-1))^(Chi1[kappa,c,mu,mu2,M2,mu3,n]+Chi2[kappa,c,mu,mu2,mu3,M3,n]))Chi1[kappa,c,mu,mu2,M2,mu3,n]Chi2[kappa,c,mu,mu2,mu3,M3,n]J[SFmu[kappa,mu2],SFM [kappa,mu2,M2]]J[SFmu[kappa,mu3],SFM [kappa,mu3,M3]]PT[mu-mu2-mu3+kappa,M-M2-M3-n(mu-mu2-mu3)-kappa(n+1)],{M2,Ceiling[(kappa/8)],Floor[UBm11[kappa,mu,M,mu2,mu3,n]]-M3}],{M3,Ceiling[(kappa/8)],Floor[UBm11[kappa,mu,M,mu2,mu3,n]]-Ceiling[(kappa/8)]}],{mu2,Ceiling[LBmu[kappa,mu,M,n]],Floor[mu+kappa]-mu3}],{mu3,Ceiling[LBmu[kappa,mu,M,n]],Floor[mu+kappa]-Ceiling[LBmu[kappa,mu,M,n]]}];

Determination of PT and DT invariants from GV invariants

Qmax=Min[QmaxGV,Qmin[kappa,gmaxGV]-1]

NMax=100;
(* generating function of PT invariants *)
ZPTnew[QMax_,q_,y_]:=Exp[Sum[Sum[(((-1))^(g+1))GVTab[[g+1,Q]]Sum[(1/k)(q^((1-g)k)) (y^(Q k))(((1-(q^k)))^(2g-2)),{k,1,QMax}],{g,0,gMax[kappa,Q]}],{Q,1,QMax}]]/.q->-q;
(* y-expand the generating function of PT invariants *)
ZPTexpy=Simplify[Series[ZPTnew[Qmax,q,y],{y,0,Qmax}]];

(* q-expand each coefficient in y, after multiplying by the power of q corresponding to the Castelnuovo bound *)
ZPTexp=Table[Series[(q^(-MMin[kappa,i-1]))ZPTexpy[[3,i]],{q,0,NMax}],{i,1,Length[ZPTexpy[[3]]]}];
(* extract the coefficients of the expansion *)
PTTabsh=CoefficientList[ZPTexp,q];
(* add zeros to the first row to complete to a square table *)
PTTabsh[[1]]=Join[PTTabsh[[1]],Array[0 &,NMax]];
(* adds the first column encoding the shifts of the D0-charge *)
PTTab=Transpose[Join[{Table[-MMin[kappa,mu],{mu,0,Qmax}]},Transpose[PTTabsh]]];
MatrixForm[PTTab]

(* same for DT invariants *)
MacMahon[NMax_,q_]:=Product[1/(1-q^k)^k,{k,NMax}];
ZDTexp=Table[Series[MacMahon[NMax,-q]^chi (q^(-MMin[kappa,i-1]))ZPTexpy[[3,i]],{q,0,NMax}],{i,1,Length[ZPTexpy[[3]]]}];
(* extract the coefficients of the expansion *)
DTTabsh=CoefficientList[ZDTexp,q];
(* adds the first column encoding the shifts of the D0-charge *)
DTTab=Transpose[Join[{Table[-MMin[kappa,mu],{mu,0,Qmax}]},Transpose[DTTabsh]]];
MatrixForm[DTTab]

(* extending the table of GV invariants by unknown entries *)
GVtemp=Array[Gv[#1-1,#2] &, {Length[GVTab]+20,Length[Transpose[GVTab]]+10}];
GVtemp[[1;;Length[GVTab],1;;Length[Transpose[GVTab]]]]=GVTab;
Qmax=Qmax+2;
NMax=20;
(* generating function of PT invariants *)
ZPTnew[QMax_,q_,y_]:=Exp[Sum[Sum[(((-1))^(g+1))GVtemp[[g+1,Q]]Sum[(1/k)(q^((1-g)k)) (y^(Q k))(((1-(q^k)))^(2g-2)),{k,1,QMax}],{g,0,gMax[kappa,Q]}],{Q,1,QMax}]]/.q->-q;

(* y-expand the generating function of PT invariants *)
ZPTexpy=Simplify[Series[ZPTnew[Qmax,q,y],{y,0,Qmax}]];

(* q-expand each coefficient in y, after multiplying by the power of q corresponding to the Castelnuovo bound *)
ZPTexp=Table[Series[(q^(-MMin[kappa,i-1]))ZPTexpy[[3,i]],{q,0,NMax}],{i,1,Length[ZPTexpy[[3]]]}];
(* extract the coefficients of the expansion *)
PTTabsh=CoefficientList[ZPTexp,q];
(* add zeros to the first row to complete to a square table *)
PTTabsh[[1]]=Join[PTTabsh[[1]],Array[0 &,NMax]];
(* adds the first column encoding the shifts of the D0-charge *)
PTTabGv=Transpose[Join[{Table[-MMin[kappa,mu],{mu,0,Qmax}]},Transpose[PTTabsh]]];
MatrixForm[PTTabGv]

Determination of J invariants from modular generating functions at rank 1

(* the generating function is h1fun in X.m *)
h1fun

(* definition of modular functions - now part of GVDTPTlib.m *)
NMax=100;
E2[q_]:=1-24 Sum[n q^n/(1-q^n),{n,NMax}];
E4[q_]:=1+240 Sum[n^3 q^n/(1-q^n),{n,NMax}];
E6[q_]:=1-504 Sum[n^5q^n/(1-q^n),{n,NMax}];
eta[q_]:=q^(1/24)*(1+Sum[(((-1))^n)(q^(n(3n-1)/2)+q^(n(3n+1)/2)),{n,1,NMax}]);
Th[r_,kappa_,mu_,q_]:=Sum[(-1)^(kappa r^2n)q^(kappa r n^2/2),{n,-NMax-1+r/2+mu/(kappa r),NMax+r/2+mu/(kappa r)}];
dTh[r_,kappa_,mu_,q_]:=Sum[(kappa n/I) (-1)^(kappa r^2n)q^(kappa r n^2/2),{n,-NMax-1+r/2+mu/(kappa r),NMax+r/2+mu/(kappa r)}];

DThTab={Table[Series[If[EvenQ[kappa],Th[1,kappa,k,q],dTh[1,kappa,k,q]],{q,0,NMax}],{k,0, kappa-1}]};
wTheta=If[EvenQ[kappa],1/2,3/2];
Do[
AppendTo[DThTab,Series[q D[Last[DThTab],q]-wTheta/12 E2[q]Last[DThTab],{q,0,NMax}]];
wTheta+=2,{l,lmax}];

h1ser=Assuming[q>0,Series[ReplaceAll[h1fun,{Eta->eta[q],e4->E4[q],e6->E6[q],DdTh[p_]:>DThTab[[p+1]],DTh[p_]:>DThTab[[p+1]]}],{q,0,NMax}]];

(* removing fractional part of the powers of q *)
h1int=If[kappa==1,{q^((kappa +c2 )/24) h1ser},Array[q^((kappa +c2 )/24-FractionalPart[(#-1)^2/(2kappa )+(#-1) /2]) h1ser[[#]] &,kappa]]

(* check eta-product formula for mu=0, ell=0 *)
Assuming[q>0,Series[DThTab[[1,1]]/If[Mod[kappa,2]==0,2(-1)^(kappa/2)eta[q^(2kappa)]^2/eta[q^kappa],(-1)^((kappa-1)/2)kappa eta[q^kappa]^3],{q,0,NMax}]]

Compute D4D2D0 invariants with r=1 from Soheyla’s thm 1.1

(* Minimal values of the spectral flow parameter n *)
NTab=Array[nMin [kappa,#1-1,#2-1+MMin[kappa,#1-1]]&,{IntegerPart[kappa/2]+1,10}];
(* adds the first column encoding the shifts of the D0-charge *)
 NTab=Transpose[Join[{Table[-MMin[kappa,mu],{mu,0,IntegerPart[kappa/2]}]},Transpose[NTab]]];
MatrixForm[NTab]

(* D4D2D0 indices for minimal legal value of n *)
DTs=Table[Table[S2[kappa,mu,M,nMin[kappa,mu,M]],{M,MMin[kappa,mu],12+MMin[kappa,mu]}],{mu,0,kappa/2}]/.repPT;
DTs//MatrixForm
DTs/.repJ//MatrixForm

(* try if n-1 already produces the correct result *)
DTs1=Table[Table[S2Lemma[kappa,mu,M,nMin[kappa,mu,M]-1],{M,MMin[kappa,mu],12+MMin[kappa,mu]}],{mu,0,kappa/2}]/.repPT;
DTs1//MatrixForm
Simplify[DTs1/.repJ]//MatrixForm

(* table of charges for n-1 *)
Charges1=Table[Table[mumToxa[kappa,{mu,M},nMin[kappa,mu,M]-1],{M,MMin[kappa,mu],12+MMin[kappa,mu]}],{mu,0,kappa/2}];
Charges1//MatrixForm

(* check if coefficients stabilize *)
Table[Table[Table[S1[kappa,mu,M,n],{n,1,nMinOld[kappa,mu,M]+1}],{M,MMin[kappa,mu],3+MMin[kappa,mu]}],{mu,0,kappa/2}]/.repPTGv

(* coefficients for the minimal value of n *)
Table[Table[S1[kappa,mu,M,nMinOld[kappa,mu,M]],{M,MMin[kappa,mu],4+MMin[kappa,mu]}],{mu,0,kappa/2}]/.repPT//MatrixForm
(* try if n-1 already produces the correct result *)
Table[Table[S1[kappa,mu,M,nMinOld[kappa,mu,M]-1],{M,MMin[kappa,mu],4+MMin[kappa,mu]}],{mu,0,kappa/2}]/.repPT//MatrixForm
(* try if n-2 already produces the correct result *)
Table[Table[S1[kappa,mu,M,nMinOld[kappa,mu,M]-2],{M,MMin[kappa,mu],4+MMin[kappa,mu]}],{mu,0,kappa/2}]/.repPT//MatrixForm

(* to be omitted *)
Do[Print[{n,{PT[kappa n,-kappa/2n(n+1)]/.repPTfromJ0,PT[kappa n,-kappa/2n(n+1)]/.repPT},{PT[kappa n,-kappa/2n(n+1)+1]/.repPTfromJ0,PT[kappa n,-kappa/2n(n+1)+1]/.repPT}}/.PT[0,0]->1/.PT[0,1]->0/.repJ],{n,1,5}]

Compare modular prediction with Soheyla’s thm with n-dn units of spectral flow; construct scatter plot

Rpointx={};Wpointx={};

(* result for n-dn *)
dn=1;mmax=15;
DTs=Table[Table[S2Lemma[kappa,mu,M,nMin[kappa,mu,M]-dn],{M,MMin[kappa,mu],mmax+MMin[kappa,mu]}],{mu,0,kappa/2}]/.repPT;
JDT=DTs/.repJ//MatrixForm
JTab[[1;;IntegerPart[kappa/2]+1,1;;mmax]]//MatrixForm

Rpoint={};
Wpoint={};
For[mu=0,mu<=kappa/2,For[M=MMin[kappa,mu],M<=mmax+MMin[kappa,mu],(*Print[{mu,M}];*)
If[NumericQ[JDT[[1,mu+1,M-MMin[kappa,mu]+1]]],If[JDT[[1,mu+1,M-MMin[kappa,mu]+1]]==JTab[[mu+1,M-MMin[kappa,mu]+1]],
AppendTo[Rpoint,mumToxa[kappa,{mun[kappa,mu,nMin[kappa,mu,M]-dn],mn[kappa,mu,M,nMin[kappa,mu,M]-dn]}]],AppendTo[Wpoint,mumToxa[kappa,{mun[kappa,mu,nMin[kappa,mu,M]-dn],mn[kappa,mu,M,nMin[kappa,mu,M]-dn]}]]
]];M++];mu++];

Rpointx=Union[Flatten[Append[{Rpointx},Rpoint],1]];
Wpointx=Union[Flatten[Append[{Wpointx},Wpoint],1]];

{Length[Rpointx],Length[Wpointx]}

(* plot in (x,\alpha) plane - green line is Castelnuovo bound, orange line is when BMT line is tangent to parabola *)
Pl=Plot[{fcon[x],Sqrt[2x],3/4(x+1)},{x,0,5},Epilog->{PointSize[0.02],Blue,Point[Rpointx],Red,Point[Wpointx]},PlotRange->{1,4}];
Show[Pl,Table[ParametricPlot[xan[x,0,n],{n,0,4},PlotStyle->Dotted],{x,0,4,1/2}]]

(* plot in (x,\alpha) plane - green line is Castelnuovo bound, orange line is when BMT line is tangent to parabola *)
Pl=Plot[{fcon[x],x/2+1,3/4(x+1)},{x,0,5},Epilog->{PointSize[0.02],Blue,Point[Rpointx],Red,Point[Wpointx]},PlotRange->{1,4},AxesLabel->{Style[x,14],Style[α,14]},Ticks->{{1,2,3,4},{1,2,3,4}}];
Show[Pl,Table[ParametricPlot[xan[x,0,n],{n,0,4},PlotStyle->Dotted],{x,0,4,1/2}]]

SetDirectory[NotebookDirectory[]];Export["../ScatterX5.png",Pl]

(* plot in (x,delta) plane - orange line is when BMT line is tangent to parabola *)Pl=Plot[{1/2x(x+1)-2/3x fcon[x],-2/3 x(Sqrt[2x]-3/4(x+1)),1/6x(x-1)},{x,0,4.5},Epilog->{PointSize[0.02],Blue,Point[xaToxdelta/@Rpointx],Red,Point[xaToxdelta/@Wpointx]},PlotRange->{0,4},AxesLabel->{Style[x,14],Style[δ,14]},Ticks->{{1,2,3,4},{1,2,3,4}}]

SetDirectory[NotebookDirectory[]];Export["../ScatterX5d.png",Pl]

GV invariants from D4-D2-D0 with r=1

(* approximately the minimal genus that can be treated by our method *)
gMin[kappa_,Q_]:=Floor[((Q^2)/(3 kappa))+((2Q)/3)+1];
(* the maximal degree which gives rise to the genus satisfying the Castelnuovo bound *)
QmaxGVg=Qmin[kappa,gmaxGV]

QMax=QmaxGVg+5;
dM=2;
ZGV[QMax_,x_,y_]:=Sum[((MoebiusMu[k])/k)Log[1+Sum[Sum[(PT[Q,M]/.repPTfromJ/.repJ/.repPT) (((-1))^M)(((-x))^(k M)) (y^(k Q)),{M,MMin[kappa,Q],Floor[-((Q^2)/(3 kappa))-((2 Q)/3)]+2dM}],{Q,1,QMax}]],{k,1,QMax}]
(* y-expand the generating function of PT invariants *)
ZGVexpy=Simplify[Series[ ZGV[QMax,x,y],{y,0,QMax}]];

GVTabExt=Array[0 &, {gMax[kappa,QMax]+1,QMax}];
GVTabExt2=Array["" &, {QMax,gMax[kappa,QMax]+2}];
Do[ZGVexp=ZGVexpy[[3,Q]];
GVTabExt2[[Q,1]]=gMax[kappa,Q];
Do[If[g>=Max[gMin[kappa,Q]-dM,0],
GVTabExt[[g+1,Q]]=Limit[(x^(g-1)) ZGVexp,x->0];
ZGVexp=Series[ZGVexp-GVTabExt[[g+1,Q]](x^(1-g))(((1+x))^(2(g-1))),{x,0,gMax[kappa,QMax]}],
GVTabExt[[g+1,Q]]="?"];GVTabExt2[[Q,gMax[kappa,Q]-g+2]]=GVTabExt[[g+1,Q]],{g,gMax[kappa,Q],0,-1}],{Q,1,QMax}];
MatrixForm[GVTabExt]
MatrixForm[GVTabExt2]

(* the same without using known GV invariants except those saturating the bound -- Attempt *)
repPTfromJ0={PT[mu_,n_]:>If[n<MMin[kappa,mu],0,If[n==MMin[kappa,mu]&&Mod[mu,kappa]==0,GVSaturating[kappa,c2,mu],If[Con[kappa,mu,n]<0,SJ[kappa,mu,n],PT[mu,n]]]]};QMax=5;
dM=2;
ZGV[QMax_,x_,y_]:=Sum[((MoebiusMu[k])/k)Log[1+Sum[Sum[(PT[Q,M]/.repPTfromJ0) (((-1))^M)(((-x))^(k M)) (y^(k Q)),{M,MMin[kappa,Q],Floor[-((Q^2)/(3 kappa))-((2 Q)/3)]+2dM}],{Q,1,QMax}]],{k,1,QMax}]
(* y-expand the generating function of PT invariants *)
ZGVexpy=Simplify[Series[ ZGV[QMax,x,y],{y,0,QMax}]];

GVTabExt=Array[0 &, {gMax[kappa,QMax]+1,QMax}];
GVTabExt2=Array["" &, {QMax,gMax[kappa,QMax]+2}];
Do[ZGVexp=ZGVexpy[[3,Q]];
GVTabExt2[[Q,1]]=gMax[kappa,Q];
Do[If[g>=Max[gMin[kappa,Q]-dM,0],
GVTabExt[[g+1,Q]]=Limit[(x^(g-1)) ZGVexp,x->0];
ZGVexp=Series[ZGVexp-GVTabExt[[g+1,Q]](x^(1-g))(((1+x))^(2(g-1))),{x,0,gMax[kappa,QMax]}],
GVTabExt[[g+1,Q]]="?"];GVTabExt2[[Q,gMax[kappa,Q]-g+2]]=GVTabExt[[g+1,Q]],{g,gMax[kappa,Q],0,-1}],{Q,1,QMax}];
MatrixForm[GVTabExt]
MatrixForm[GVTabExt2]

PT and DT invariants from D4-D2-D0 with r=1

muMax=Length[PTTab]+8;
NMax=-MMin[kappa,muMax]+10;
PTTab1=Array[0 &, {muMax+1,NMax+1}];
PTTab2=Array["" &, {muMax+1,NMax+2}];
Do[PTTab2[[mu+1,1]]=-MMin[kappa,mu];
Do[PTTab1[[mu+1,n+1]]=PT[mu,n+MMin[kappa,muMax]]/.repPTfromJ/.repJ/.repPT;
PTTab2[[mu+1,n+2]]=PT[mu,n+MMin[kappa,mu]]/.repPTfromJ/.repJ/.repPT,{n,0,NMax}],{mu,0,muMax}];
MatrixForm[PTTab1]
MatrixForm[PTTab2]

Take[PTTab2,{1,Length[PTTab2]},{1,7}]//MatrixForm

Compute D4D2D0 invariants with r=2 from Soheyla’s thm 1.2

(* evalutation of DT invariant *)
DTr2=With[{mu=0,M=1,n=1},
SPT0[kappa,c2,mu,M,n]+SPT1sf[kappa,c2,mu,M,n]+SPT2sf[kappa,c2,mu,M,n]+SPT11sf[kappa,c2,mu,M,n]];
DTr2J=DTr2/.repPTfromJ/.repPTfromJ
DTr2J/.repJ

Growth of GV/DT/PT invariants

Following “Black holes and large order geometry” [arXiv:0704.2440]

Check eqs 3.2, 3.20 for the coeffs b0, b1, p0

ClearAll[SS,m,Q,d,m];
SS=2Pi Sqrt[Q^3-m^2]+Pi c2/8(6/kappa)^(1/3)(1/Q+m^2/(3Q^4)) Sqrt[Q^3-m^2];
Simplify[Series[(SS/.{Q->(2/9/kappa)^(1/3)d})/d^(3/2),{d,Infinity,3}],{d>0,kappa>0}]
Simplify[Series[(SS-(SS/.m->0)/.{Q->(2/9/kappa)^(1/3)d})d^(3/2)/m^2,{d,Infinity,0}],{d>0,kappa>0}]

Asymptotics of GV invariants - expect  d^(2g-3)Log[d]^(2g-2) exp[2pi d Imz(\mu)]

QmaxGVg=Qmin[kappa,gmaxGV]-1

g=0;

Li=Table[If[GVTab[[g+1,d]]>0&&d>1,Log[GVTab[[g+1,d]]/(d^(2g-3)Log[d]^(2g-2))]/(2Pi d)],{d,1,QmaxGVg}];
ListPlot[Li]

(* first logarithmic Richardson transform - not clear why it should work  *)
Li1=Table[(Li[[k+1]]Log[k+1]-Li[[k]]Log[k])/(Log[k+1]-Log[k]),{k,Length[Li]-1}];
(* second logarithmic Richardson transform *)
Li2=Table[(Li1[[k+1]]Log[k+1]-Li1[[k]]Log[k])/(Log[k+1]-Log[k]),{k,Length[Li1]-1}];
(* third logarithmic Richardson transform *)
Li3=Table[(Li2[[k+1]]Log[k+1]-Li2[[k]]Log[k])/(Log[k+1]-Log[k]),{k,Length[Li2]-1}];
ListPlot[{Li1,Li2,Li3}]

N[{Last[Li],Last[Li1],Last[Li2],Last[Li3]}]

Asymptotics of BH index, m=0

b0=4Pi/3/Sqrt[2kappa];
b1=Pi c2/4/Sqrt[2kappa];
BHTab=With[{m=0},Table[Sum[Binomial[2g+2,m+g+1]GVTab[[g+1,d]],{g,0,gMax[kappa,d]}],{d,QmaxGVg}]];
fTab=Table[N[Log[BHTab[[d]]]/d^(3/2)],{d,QmaxGVg}];
fTab1=Table[d(fTab[[d]]-b0),{d,QmaxGVg}];
Richardsonf[n_]:=Table[Sum[fTab[[d+k]](d+k)^n(-1)^(k+n)/k!/(n-k)!,{k,0,n}],{d,QmaxGVg-n}]/b0;
Richardsonf1[n_]:=Table[Sum[fTab1[[d+k]](d+k)^n(-1)^(k+n)/k!/(n-k)!,{k,0,n}],{d,QmaxGVg-n}]/b1;

(* leading coefficient *)
Richardsonf[4]

ListPlot[{fTab,Richardsonf[1],Richardsonf[2],Richardsonf[3]}]

(* plot last term as a function of order of Richardson transform *)
ListPlot[Table[Last[Richardsonf[n]],{n,1,QmaxGVg-1}]]

(* subleading coefficient *)
Richardsonf1[4]

ListPlot[{fTab1,Richardsonf1[1],Richardsonf1[2],Richardsonf1[3]}]

(* plot last term as a function of order of Richardson transform *)ListPlot[Table[Last[Richardsonf1[n]],{n,1,QmaxGVg-1}]]

b1 Last[Richardsonf1[3]]

Asymptotics of BH index, m>0

BHTab1=With[{m=1},Table[Sum[Binomial[2g+2,m+g+1]GVTab[[g+1,d]],{g,0,gMax[kappa,d]}],{d,QmaxGVg}]];
fTabm=Table[N[Log[BHTab[[d]]/BHTab1[[d]]]d^(3/2)],{d,QmaxGVg}];
p0=3Pi Sqrt[kappa/2];
Richardsonfm[n_]:=Table[Sum[fTabm[[d+k]](d+k)^n(-1)^(k+n)/k!/(n-k)!,{k,0,n}],{d,QmaxGVg-n}]/p0;

Richardsonfm[1]

(* This plot doesn't seem to converge to 1 ! *) 
ListPlot[{Richardsonfm[1],Richardsonfm[2],Richardsonfm[3]}]

(* plot last term as a function of order of Richardson transform *)ListPlot[Table[Last[Richardsonfm[n]],{n,1,5}]]

Asymptotics of DT invariants, m=0

(* Log[PT[mu,0]] vs mu *)
DTTab0=Table[DTTab[[mu+1,-MMin[kappa,mu]+2]],{mu,1,QmaxGVg}];
fTab=Table[N[Log[DTTab0[[d]]]],{d,3,QmaxGVg}];

QmaxGVg

(* this plot looks pretty linear !*)
ListPlot[fTab]

(* Log[Log[DT[mu,0]]]/Log[mu] vs mu *)fTabDT=Table[N[Log[Log[DTTab0[[d]]]]/Log[d]],{d,3,QmaxGVg}];
RichardsonfDT[n_]:=Table[Sum[fTabDT[[d+k]](d+k)^n(-1)^(k+n)/k!/(n-k)!,{k,0,n}],{d,Length[fTabDT]-n}]
ListPlot[{fTabDT,RichardsonfDT[1],RichardsonfDT[2]}]

Asymptotics of PT invariants, m=0

(* Log[PT[mu,0]] vs mu *)
PTTab0=Table[PTTab[[mu+1,-MMin[kappa,mu]+2]],{mu,1,QmaxGVg}];
fTab=Table[N[Log[PTTab0[[d]]]],{d,3,QmaxGVg}]

ListPlot[fTab]

(* Log[Log[PT[mu,0]]]/Log[mu] vs mu *)
fTab=Table[N[Log[Log[PTTab0[[d]]]]/Log[d]],{d,3,QmaxGVg}];
ListPlot[fTab]