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

{g1,g2}={GradedBigraph[{{1}},{{1}},{{1}},{{1}},{{1}},{{1},{1}},{{1,0},{0,1}},{{1,1},{1,0},{0,1}},{{0,0,1}},{{1}},{{1}},{{1}}],GradedBigraph[{{1}},{{1}},{{1}},{{1}},{{1}},{{1},{1}},{{1,0},{1,0}},{{1,0},{1,0},{0,1},{0,1}},{{0,0,0,1}},{{1}},{{1}},{{1}}]};

DisplayBigraph[g1]

m=GraphAdjacencyMatrix[g1];

#.#&/@(#/#[[1]]&/@DeleteCases[Eigensystem[m.m][[2]][[All,{1,3,5,7,8,11,12,13,15,17}]],{0..}])

Simplify[%]

FusionAtlas`dTest`Private`dNumberQ/@%

Simplify[GlobalEvenDimension[g1]]

g=EvenPart[g1]

d=ReducedDimensionsByDepth[g];
Z[1,a_,b_]:=If[a==b,1,0];
Z[a_,1,b_]:=If[a==b,1,0];
fV[g0_,k0_]:=Module[{k=k0,depth=0},
While[k>RankAtDepth[g0,depth],k-=RankAtDepth[g0,depth++]];
V[depth,k]
];
Z[a_,2,b_]:=Module[{Va,Vb},
Va=fV[g,a];
Vb=fV[g,b];
Switch[Vb[[1]]-Va[[1]],
1,g[[2,Va[[1]]+1,Vb[[2]],Va[[2]]]],
0,g[[1,Va[[1]]+1,Vb[[2]],Va[[2]]]],
-1,g[[2,Va[[1]],Va[[2]],Vb[[2]]]],
_,0]
];
ZZ=Table[Z[a,b,c],{a,1,GraphRank[g]},{b,1,GraphRank[g]},{c,1,GraphRank[g]}];
eq=DeleteCases[Union[#==0&/@Flatten[ZZ.ZZ-Transpose[Transpose[ZZ,{1,3,2}].Transpose[ZZ,{2,3,1}],{1,4,2,3}]]],True];
deq=Union[DeleteCases[
Thread[Flatten[ZZ.Flatten[d]]==Flatten[Table[d[[fV[g,i][[1]]+1,fV[g,i][[2]]]]d[[fV[g,j][[1]]+1,fV[g,j][[2]]]],{i,1,GraphRank[g]},{j,1,GraphRank[g]}]]]
,True]];
deq2=Cases[ZZ,(z:Z[_,_,c_]/;Flatten[d][[c]]==1):>z≤1,∞];

eq

deq

positive=Thread[Union[Cases[eq,_Z,∞]]≥0];

Reduce[eq~Join~deq~Join~deq2~Join~positive,Union[Cases[eq,_Z,∞]]]

Length[eq]

Reduce[Take[eq,100]]

Cases[Reduce[Take[eqs,1200]],(z_Z==l:(-_Z)):>(z=0)]

Cases[Reduce[Take[eqs,1200]],(z_Z==l:HoldPattern[Plus[((α_?Negative) _Z)..]]):>(z=0)]

Cases[eqs,(z_Z==n_Integer):>(z=n)]

Cases[eqs,(z_Z==y_Z):>(z=y)]

Cases[eqs,(z1_Z+z2_Z==0):>(z1=0;z2=0;)]

Cases[Reduce[Take[eqs,1250]],(z_Z==y_Z):>(z=y)]

eqs=Simplify[SortBy[Union[eqs],Count[#,_Z,∞]&]];

Length[eqs]

eqs//TableForm

List@@Reduce[eqs,Union[Cases[eqs,_Z,∞]]]/.(a_==b_):>(a=b)

Simplify[eqs]

Simplify[deq]

Simplify[deq2]

Reduce[Thread[Flatten[Table[Z[a,b,c],{a,1,10},{b,1,10},{c,1,10}]]≥0]]

Z[5,5,5]=4;

Table[Z[a,b,c],{a,1,10},{b,1,10},{c,1,10}]

Take[eq,{116,120}]

SetDebugMode[True];SetDebugQueueInterval[1.];

FindFusionAlgebras[EvenPart[g1]]