CyclotomicTest package

A subpackage for FusionAtlas v0.
May 20, 2008, Noah Snyder

Introduction

---text goes here---

Implementation

Start of package

Specify package dependencies:

BeginPackage["FusionAtlas`CyclotomicTest`",{"FusionAtlas`","FusionAtlas`Bigraphs`"}~Join~If[$VersionNumber<6,{"NumberTheory`AlgebraicNumberFields`"},{}]];

Usage messages

CyclotomicTest::usage="";

Internals

Begin["`Private`"];

LeadingTerm[polynomial_,x_]:=
Coefficient[polynomial,x^(Exponent[polynomial,x])]

If[$VersionNumber<6.0,
Discriminant[polynomial_,x_]:=
Together[Resultant[polynomial, D[polynomial,x],x]/LeadingTerm[polynomial,x]]
]

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]]],
Return[False];
];
];
];
Return[True];
];

CyclotomicTest[g_GradedBigraph,n_:200]:=
Module[{x,index=GraphIndex[g]},
PolynomialCyclotomicTest[MinimalPolynomial[index,x],n,x]
]

And the old version, which checked all the dimensions of the even objects.

(*CyclotomicTest[g_GradedBigraph,n_]:=
Module[{x,dimensions=Flatten[Table[DimensionsByDepth[g][[k]],{k,1,GraphDepth[g]+1,2}]],r=True},
Do[
If[!(r=PolyCyclotomicTest[MinimalPolynomial[dimensions[[i]],x],n,x]),Break[]]
,{i,1,Length[dimensions]}];
r
]*)

End

End[];

End of package

EndPackage[];