FusionAtlas package

Version 0, May 20 2008, Scott Morrison, Emily Peters, Noah Snyder

Introduction

Implementation

Declaring subpackages

DeclarePackage["FusionAtlas`Bigraphs`",{"GradedGraph","GradedBigraph","DisplayBigraph","GraphRank","GraphEvenRank","GraphOddRank","GraphDepth","RankAtDepth","GraphAdjacencyMatrix","EvenPart","GraphIndex","DimensionOfGenerator","ReducedDimensionOfGenerator","NumericDimensionOfGenerator","DimensionsByDepth","NumericDimensionsByDepth","ReducedDimensionsByDepth","GlobalEvenDimension","DimensionAtMostQ","DimensionOfLowWeightSpace","StableLowWeightSpaceDimensions","AnnularTanglesSubgraphTest","AnnularTanglesTest","FindBigraphExtensions","FindBigraphExtensionsUpToRank","FindBigraphExtensionsUpToRankAndDepth","CanonicalizeBigraph","AnBigraph","DnBigraph","EnBigraph","trivalentBigraph","haagerupFamilyBigraph","dualHaagerupFamilyBigraph","HaagerupBigraph","DualHaagerupBigraph","IzumiStarBigraph","ExtendedDnBigraph","HexagonBigraph","DualHexagonBigraph","HaagerupAsaedaBigraph","DualHaagerupAsaedaBigraph","ExtendedEnBigraph","S4S5Bigraph", "A4A5Bigraph","A5A6Bigraph", "GraphToString","GraphFromString","ClearCachedGraphFromString","CachedGraphFromString","DepthOfBranchPoint","HasSimpleBranchQ","Truncate","BranchFactor"}];

DeclarePackage["FusionAtlas`Java`",{"FusionAtlasJavaDirectory","FusionAtlasScalaDirectory","RestartJava","GraphToScalaObject","AsScalaSet","AsScalaList","UnpackJavaLists","UnpackJavaObjects;"}];

DeclarePackage["FusionAtlas`JavaOdometer`",{"FindBigraphExtensionsUpToRankJava","FindBigraphExtensionsUpToRankAndDepthJava","FindBigraphExtensionsUpToRankAndDepthJavaIterator","FindBigraphExtensionsMatching"}];

DeclarePackage["FusionAtlas`FindAllBigraphs`",{"AlgebraicIntegerTest","PositivityTest","GHJTest","BigraphConditions","AllBigraphs","FindAllBigraphs","RequestAllBigraphs","KnownObstructions","FindAllObstructions","RequestMoreBigraphs"}]

DeclarePackage["FusionAtlas`PackageData`",
{"ValuesAsString","PackageData","MatchingValues","DefiniteValues","PackageEverything","PackageCachedRootReduce","PackageDimensions","PackageBigraphExtensions","PackageBifusionAlgebras","PackageLowWeightSpaces","PackageAlgebraicIntegerTest","PackageObstructions","PackageKnapsackTest","PackageFindGraphPartners","PackageLowestWeightEigenspaces","PackageIdempotents","PackagePairExtensions"}];

DeclarePackage["FusionAtlas`TensorSolver`",
{"FindFusionAlgebras","FindBifusionAlgebras","FusionAlgebra","BifusionAlgebra","TimeConstrainedFindBifusionAlgebras","TimeConstrainedFindFusionAlgebras","LazyFindFusionAlgebras","FindBifusionAlgebras2"}];

DeclarePackage["FusionAtlas`FindGraphPartners`",
{"FindGraphPartners","FindUnobstructedGraphPartners","LazyFindGraphPartners","FindAllGraphPartners","FindGraphPartnersTimeConstraint"}];

DeclarePackage["FusionAtlas`CyclotomicTest`",
{"CyclotomicTest"}];

DeclarePackage["FusionAtlas`KnapsackTest`",
{"KnapsackTest"}];

DeclarePackage["FusionAtlas`QuadraticTanglesTest`",
{"ParityTest","HaagerupTypeBranchTest"}];

DeclarePackage["FusionAtlas`dTest`",{"DTest"}];

DeclarePackage["FusionAtlas`Debugging`",
{"DebugEcho","DebugPrint","DebugEvaluate","SetDebugMode","SetDebugQueueInterval","SetDebugFile","DebugPrintHeld","ToStringHeld"}];

DeclarePackage["FusionAtlas`RemoteInterface`",
{"RecordObstructions","RequestObstructions","LookupObstructions","LookupCanonicalForms","ProcessObstructionsQueue","WorkOnObstructionsQueue","ClearObstructionsQueue","ObstructionsQueueLength","EstimateQueueCompletionTime","RetrieveGraphs","LookupGraphs","TakeGraphs","RecordCanonicalForms","RecordFindGraphPartners","GraphsNeedingPartners","ReapplyTestToDatabase","RecordRequestAllBigraphs","BigraphRequests","MaximalBigraphRequests","MaximalIncompleteBigraphRequests","DisplayBigraphRequests","QueueExpression"}];

DeclarePackage["FusionAtlas`GraphPairs`",{"BigraphWithDuals","DualData","OcneanuDisplay","HaagerupWithDuals","DualHaagerupWithDuals","HaagerupAsaedaWithDuals","DualHaagerupAsaedaWithDuals","TwistBigraph","FullOcneanuTest","PartialOcneanuTest","DualDataList","CompatibleDualDataList","CheckDualDimensions","GraphPairsIsomorphicQ","ClearGraphPairsCachedValues","PermuteToReduceCrossings"}];

DeclarePackage["FusionAtlas`PairOdometer`",{"FindBigraphPairExtensionsUpToDepth","FamiliesOfBigraphPairs","DisplayFamiliesOfBigraphPairs","ChooseIsomorphismRepresentatives"}];

DeclarePackage["FusionAtlas`GraphPlanarAlgebra`",{
"Vertex",
"GPAElement","GPAMatrix",
"NumberFieldGenerator","EnlargeNumberField",
"LopsidedDimension","EmptyGPAElement","GPACoefficients","GPAMultiply",
"RotateOneClick","RotateTwoClicks","CapTopLeft","CapAt","AddStrandOnRight", "AddCupOnTop","JonesWenzlIdempotent",
"LowestWeightEigenvectorConditions",
"LowestWeightEigenspace"
}]

DeclarePackage["FusionAtlas`RelativeDimensions`",{"RelativeDimensionsByDepthEquations","SolveRelativeDimensionsByDepthEquations","RelativeBranchFactor","RelativeDimensionsByDepth","RelativeDimensionsConditions","PositiveOmegaInequality"}];

DeclarePackage["FusionAtlas`TriplePointTest`",{"TriplePointObstruction","EvenTriplePointObstruction","OddTriplePointObstruction"}];

DeclarePackage["FusionAtlas`Utilities`IntersectSubspaces`",{"IntersectSubspaces"}];

Print loading statement

Print[
"Loading FusionAtlas` version 0\n",
"Read more at http://tqft.net/wiki/Atlas_of_subfactors"
]

The core package

This doesn' t actually contain much; just some common functions. Everything interesting is in a subpackage.

If[$VersionNumber<6,
BeginPackage["FusionAtlas`",{"LinearAlgebra`MatrixManipulation`"}],
BeginPackage["FusionAtlas`"]
]

FusionAtlasDirectory::usage="FusionAtlasDirectory[] should hopefully return the location the FusionAtlas` package was loaded from.";
FusionAtlasDataDirectory::usage="FusionAtlasDataDirectory[] specifies were the FusionAtlas` package should look for, and save, precomputed data.";

FusionAtlas::loading="Loading precomputed data in `1`.";

cachedRootReduce::usage="";

UnsortedUnion::usage="UnsortedUnion[list] a list of all the unique elements in list, in the order that they first appear.";

FindFirst::usage="";

RealMax::usage="";
RealMaxPosition::usage="";

NaturalQ::usage="NaturalNumberQ[n] tests if n is a non-negative integer.";

qInteger::usage="qInteger[n][q] computes the quantum integer n with the variable q; in our conventions qInteger[2][q]==q+(q^(-1))";
{qFactorial,qBinomial};

If[$VersionNumber<7,
SplitBy[x_,f_]:=Split[x,f[#1]===f[#2]&]
]

If[$VersionNumber<6,
UnitVector::usage="UnitVector[n,i] returns the i-th n-dimensional unit vector, if i is an integer between 1 and n, and the n-dimensional zero vector otherwise.";
]

If[$VersionNumber≥6,
BlockMatrix=ArrayFlatten;
ZeroMatrix[n_]:=ZeroMatrix[n,n];
ZeroMatrix[n_,m_]:=ConstantArray[0,{n,m}]
]

ZeroVector::usage="ZeroVector[n] returns the n-dimensional 0 vector.";

UnitVectorQ::usage="UnitVectorQ[v] tests if v is a unit coordinate vector.";

ZeroVectorQ::usage="ZeroVectorQ[v] tests if v is the zero vector.";

ZeroMatrixQ::usage=""

qFromd::Usage="Computes q given d=q+q^(-1)";

Begin["`Private`"];

FusionAtlasDirectory[]:=FusionAtlasDirectory[]=StringDrop[(File/.Flatten[FileInformation[ToFileName[#,"FusionAtlas"]]&/@(Reverse[$Path]/."."->Directory[])]),-12]

(*might be dangerous if FusionAtlasDirectory[] is somehow incorrect!*)
If[!MemberQ[$Path,FusionAtlasDirectory[]],AppendTo[$Path,FusionAtlasDirectory[]]]

If[StringTake[FusionAtlasDirectory[],-7]=="package",
FusionAtlasDataDirectory[]:=StringDrop[FusionAtlasDirectory[],-7]<>"data";
Print["Found precomputed data in ",FusionAtlasDataDirectory[]];
If[!MemberQ[$Path,FusionAtlasDataDirectory[]],AppendTo[$Path,FusionAtlasDataDirectory[]]],
Print["Remember to set FusionAtlasDataDirectory[] to the appropriate path, if you've downloaded precomputed data."]
];

UnsortedUnion[x_]:=Module[{f},f[y_]:=(f[y]=Sequence[];y);f/@x]

cachedRootReduce[x_]:=cachedRootReduce[x]=RootReduce[x]

NaturalQ[n_]:=NonNegative[n]&&IntegerQ[n]

FindFirst[a_,b_]:=With[{p=Position[a,b,{1},1,Heads->False]},If[Length[p]==0,-1,p[[1,1]]]]

RealMax[a_] := Max[Cases[a,x_/;Im[x]==0]]

RealMaxPosition[a_] := FindFirst[a,RealMax[a]]

If[$VersionNumber≥6.,
Unprotect[IdentityMatrix];
IdentityMatrix[0]={};
Protect[IdentityMatrix];
]

ZeroVector[n_]:=Table[0,{n}]

If[$VersionNumber<6,
(UnitVector[n_,i_Integer]/;(1≤i≤n):=Module[{z=Table[0,{n}]},z[[i]]=1;z]);
(UnitVector[n_,i_Integer]:=Table[0,{n}]),
Unprotect[UnitVector];
(UnitVector[n_,i_Integer]/;(i<1∨i>n):=(Message[UnitVector::nokun,n,i];ZeroVector[n]));
Protect[UnitVector];
]

UnitVectorQ[v_?VectorQ]:=Complement[v,{0,1}]=={}∧Count[v,1]==1

ZeroVectorQ[v_?VectorQ]:=Union[v]==={0}∨v=={}

ZeroMatrixQ[m_] := (m==ZeroMatrix@@Dimensions[m])

(* This is horribly broken: e.g. MinimalPolynomial[(Sqrt[Root[-2+12 #1-7 ((#1)^2)+((#1)^3)&,3]]),x] gives -x^3!!! *)

(* Unfortunately I can't remember why we wrote this: it must have been to speed something up. Hopefully it's just not a problem anymore to use the default implementation in Mathematica *)

(*Unprotect[MinimalPolynomial];
MinimalPolynomial[μ_,z_]/;Length[Union[Cases[μ,_Root,∞]]]==1:=Module[{roots,z0,λ,p,q,x,n,rule,matrix},
roots=Cases[μ,_Root,∞,1];
p=roots[[1,1]][λ];
n=Exponent[p,λ];
rule=(λ^(m_/;m≥n)):>Evaluate[(λ^(m-n))(-(p-Coefficient[p,λ,n](λ^n)))];
q=Table[(λ^i),{i,0,n-1}];
x=μ/.roots[[1]]->λ;
matrix=Table[Coefficient[#,λ,k],{k,0,n-1}]&/@FixedPoint[Expand[#//.rule]&,q x];
CharacteristicPolynomial[matrix,z0]/.z0->z
]
Protect[MinimalPolynomial];*)

qFromd[d_]:= RootReduce[(d+Sqrt[d^2-4])/2]

qInteger[n_][q_]:=RootReduce[Sum[q^i,{i,-n+1,n-1,2}]]

End[];

EndPackage[];