FusionAtlasPaths={"~/projects/fusionatlas/code/package/","~/Documents/research/fusionatlas/code/package/"};
$Path=$Path~Join~FusionAtlasPaths;
<<FusionAtlas`

GoodPrimes[polynomial_,x_,n_]:=
Module[{Discriminant=Abs[Discriminant[polynomial,x]]}, Select[Table[Prime[k],{k,1,n}],Not[Mod[Discriminant,#]==0]&]]

FactorPowersModp[polynomial_,p_Integer,x_]:=
Exponent[#[[1]],x]&/@Rest[FactorList[polynomial,Modulus->p]]

AllTheSame[a_]:=Length[Union[a]]==1

PolynomialCyclotomicTest[polynomial_,n_Integer, x_] :=
Module[{j,goodprimes=GoodPrimes[polynomial,x,n]},
If[Exponent[polynomial,x]==1,Return[True];,
For[j=1,j≤Length[goodprimes],j++,
If[Not[AllTheSame[FactorPowersModp[polynomial,goodprimes[[j]],x]]],If[j>5,Print["Polynomial Cyclotomic Test failed at step ", j];];
Return[False];
];
];
];
Return[True];
];

For[k=151 ,k≤171,k+=10, Print[k," - ",AbsoluteTiming[PolynomialCyclotomicTest[MinimalPolynomial[DimensionOfGenerator[Translate[HaagerupBigraph,k]]^2,x],200,x]]];];

TimingTest[g_,n_]:=
Module[{j,x,TotalMinPolyTime=0,TotalCycTestTime=0,TotalIndexTime=0,MinPolyTime,CycTestTime,IndexTime,MinPoly,Result,index},
For[j=0,j≤n,j++,
{IndexTime,index}=AbsoluteTiming[DimensionOfGenerator[Translate[g,j]]^2];
TotalIndexTime+=IndexTime;
{MinPolyTime,MinPoly}=AbsoluteTiming[MinimalPolynomial[index,x]];
TotalMinPolyTime+=MinPolyTime;
{CycTestTime,Result}=
AbsoluteTiming[PolynomialCyclotomicTest[MinPoly,100,x]];
Print[j," - ",Result];
TotalCycTestTime+=CycTestTime;
DimensionOfGenerator[Translate[g,j]]=.;
];
Print["IndexTime: ", TotalIndexTime,". MinPolyTime: ",TotalMinPolyTime,". CycTestTime: ",TotalCycTestTime, "."];
Print["Total Time: ", TotalMinPolyTime+TotalCycTestTime+TotalIndexTime,"."];
];

TimingTest[HaagerupBigraph,80];

TimingTest[HaagerupAsaedaBigraph,80]

Hexagon=GradedBigraph[{{1}},{{1}},{{1}},{{1},{1}},{{1,0},{0,1}},{{1,1}}]

TimingTest[Hexagon,80]

HexagonWithTail=GradedBigraph[{{1}},{{1}},{{1}},{{1},{1}},{{1,0},{0,1}},{{1,1}},{{1}},{{1}}]

DisplayBigraph[HexagonWithTail]

TimingTest[HexagonWithTail,80]