Rank 0 DT invariants from PT/GV

ClearAll[pmax,lmax,lmax2,h1,GVTab,PTTab,DTTab];
SetDirectory[NotebookDirectory[]];
(* choose your favorite CICY *)
<<X62.m
{CY,chi,kappa,c2}

(* maximal degrees *)
bmax=Length[Transpose[GVTab]];
{bmax,Length[DTTab]-2,Length[PTTab]-2}

(* maximal genus and ch3 *)
{Length[GVTab],Map[Length,DTTab]-pmax-1,Map[Length,PTTab]-pmax-1}

(* maximal genus as found in GV table *) 
gmaxEff[b_]:=First[FirstPosition[Join[Transpose[GVTab][[b]],{0}],0]]-2;
(* conjectural maximal genus for given degree *)
gCastel[mu_]:=Floor[mu^2/(2kappa)+mu/2+1];
(* compare the two *)
Table[{gmaxEff[mu],gCastel[mu]},{mu,1,bmax}]

qmax=0;
(* compute gap above which subleading degree becomes relevant *)
Z1Leading=Series[Product[(1+q^(1-gmaxEff[b])t^b)^(Gv[gmaxEff[b],b]),{b,bmax}],{t,0,bmax}];
Z2Leading=Table[Series[Z1Leading[[3,i]],{q,0,qmax}],{i,bmax+1}];
PTLeadingPowers=Table[Flatten[Position[Map[#===0&,CoefficientList[q^pmax Normal[Z2Leading[[i]]],q]],False]]-pmax,{i,bmax+1}];
PTGap=Table[If[Length[PTLeadingPowers[[i]]]<2,0,PTLeadingPowers[[i,2]]-PTLeadingPowers[[i,1]]],{i,bmax+1}]

repDT={DT[mu_,n_]:>If[n<-mu^2/(2kappa)-mu/2,0,If[mu+2<=Length[DTTab],If[n+pmax+1<=Length[DTTab[[mu+2]]]&&n+pmax>=0,DTTab[[mu+2,n+pmax+1]],DT[mu,n]],DT[mu,n]]]};
repPT={PT[mu_,n_]:>If[n<-mu^2/(2kappa)-mu/2,0,If[mu+2<=Length[PTTab],If[n+pmax+1<=Length[PTTab[[mu+2]]]&&n+pmax>=0,PTTab[[mu+2,n+pmax+1]],PT[mu,n]],PT[mu,n]]]};
repGV={Gv[g_,m_]:>If[g>m^2/(2kappa)+m/2+1||m<=0,0,If[g+1<=Length[GVTab],If[m<=Length[GVTab[[g+1]]],GVTab[[g+1,m]],Gv[g,m]],Gv[g,m]]]};
(* valid only for m close to effective 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]}]};
(* minimal value of n for Feyzbakhsh Thm 1.2 to be applicable with M=0 *)
nMin[mu_]:=Ceiling[-(1/6)+(7/(6 kappa))+(mu/2)-(mu/kappa)+((mu^2)/(2 kappa))]+
If[kappa==1 || kappa==7|| (kappa>=8&&mu==0),1,0];
mun[mu_,n_]:=mu+(n+1)kappa;
mn[mu_,m_,n_]:=m-(n+1)mu-(kappa/2)(n+1)(n+2);
ChiO1[mu_,M_,n_]:=(kappa/2)n(n+1)+n mu-M+(kappa/6)+(c2/12);
(* answer from Soheyla's Thm 1.1, for r=1 *)
S1[mu_,M_,n_]:=((((-1))^(ChiO1[mu,M,n]+1))/(ChiO1[mu,M,n]))PT[mun[mu,n],mn[mu,M,n]];

Table[PT[mu,n],{mu,0,kappa-1},{n,-2,0}]/.repPT//MatrixForm

Table[PT[mu,n],{mu,0,kappa-1},{n,-2,0}]/.repPTApprox //MatrixForm

With[{M=0,mu=0,κ=kappa},{nMin[mu]+M,Ceiling[-(1/6)+M+(7/(6 κ))+(μ/2)-(μ/κ)+((μ^2)/(2 κ))],S1[mu,M,nMin[mu]+M],S1[mu,M,nMin[mu]+M]/.repPTApprox}]

GVTab//MatrixForm

DTTab//MatrixForm

PTTab//MatrixForm

(* check if leading polar coefficient stabilizes *)
With[{mu=0},Table[S1[mu,0,n],{n,0,nMin[mu]+2}]]/.repPTApprox

With[{mu=0},Table[S1[mu,0,n],{n,0,nMin[mu]+2}]]/.repPT

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

(* for minimal value of n *)
Table[Table[S1[mu,M,nMin[mu]+M],{M,-2,3}],{mu,0,kappa/2}]/.repPT//MatrixForm

(* for minimal value of n *)
Table[Table[S1[mu,M,nMin[mu]+M],{M,-1,3}],{mu,0,kappa/2}]/.repPTApprox//MatrixForm

(* try if n-1 already produces the correct result *)
Table[Table[S1[mu,M,nMin[mu]+M-1],{M,-2,3}],{mu,0,kappa/2}]/.repPTApprox//MatrixForm

(* try if n-2 already produces the correct result *)
Table[Table[S1[mu,M,nMin[mu]+M-2],{M,-2,3}],{mu,0,kappa/2}]/.repPTApprox//MatrixForm

CY