Print["Loading Phi..."]

ComputeZInfinity[expr_] := Module[
  {t},
  t=CCReduce[expr /. g_Graph :> (-1)^Count[g,_C2]*g];
  t=AMergeColors[t,C3,C2,C2];
  AMergeColors[t,C2,C1,C1]
]

ComputePhi[expr_] := Module[
  {l,res,n,t},
  l=List @@ expr;
  Sum[
    Print["Doing #",n," of ",Length[l]];
    {t,res}=Timing[A3Multiply[l[[n]]]];
    Print["#",n," took ",t,"s."];
    Put[res,"Phi/"~StringJoin~ToString[n]];
    res,
    {n,65,Length[l]}
  ]
]

SuggestBasis[type_] := Module[
  {basis},
  basis=Complement[
    Range[Length[GraphsOfType[type]]],
     SubspaceBasis[RelationsForType[type]] //.
       {v_Plus :> First[v], c_.*BasisVector[i_] :> i}
  ];
  GraphsOfType[type][[basis]]
]
