Checks on the inductive formulae for CoulombF and CoulombG

J. Manschot, B. Pioline, A.Sen, Feb 2013. Updated for CoulombHiggs 2.0, Sep 2013; updated for CoulombHiggs6.0, Dec 2020

SetDirectory[NotebookDirectory[]];
<<CoulombHiggs`

$QuiverRecursion=1;

Test formula for CoulombG

n=5;
(* randomly generates nxn scaling DSZ matrix *)
Mat=Table[Random[Integer,{-50,50}],{i,n},{j,n}];
Mat=Mat-Transpose[Mat];
Mat[[n-1,n]]=-Sum[Mat[[i,j]],{i,n-2},{j,i+1,n}];
Mat[[n,n-1]]=-Mat[[n-1,n]];

(* compare numerical search with prediction from induction formula *)
Mat//MatrixForm
{CoulombG[Mat],CoulombGNum[Mat]}

Test formula for CoulombF

n=5;
(* randomly generates nxn DSZ matrix *)
Mat=Table[Random[Integer,{-50,50}],{i,n},{j,n}];
Mat=Mat-Transpose[Mat];
Cvec=Table[Random[Integer,{-50,50}],{i,n}];
Cvec[[n]]=-Sum[Cvec[[i]],{i,n-1}];

(* compare numerical search with answer from induction formula *) 
{Mat//MatrixForm, Cvec}
{CoulombF[Mat,Cvec],CoulombFNum[Mat,Cvec]}

(* list critical values of lambda *)
Flatten[Table[-Sum[Mat[[i,i+1]],{i,k,l-1}]/Sum[Mat[[i,j]],{i,k,l-2},{j,i+2,l}],{k,n-1},{l,k+2,n}]]

Test formula for CoulombIndex

n=4;
(* randomly generates nxn DSZ matrix *)
Mat=Table[Random[Integer,{-50,50}],{i,n},{j,n}];
Mat=Mat-Transpose[Mat];
Cvec=Table[Random[Integer,{-50,50}],{i,n}];
Cvec[[n]]=-Sum[Cvec[[i]],{i,n-1}];

Nvec=ConstantArray[1,n];
Mat=RandomDSZWithLoop[n,50];
Cvec=RandomFI[Nvec];

(* compare numerical search with answer from induction formula *) 
{Mat//MatrixForm, Cvec}
A={CoulombIndex[Mat,Mat,Cvec,y],CoulombIndexNum[Mat,Mat,Cvec,y]}

Simplify[A[[1]]-Plus@@(A[[2]])]