ij[257]

b[e[102], e[203]]

w[101,203,...]

CanonicalForm[W[102,101,101]]

diag=Diag[ar[1,3],ar[4,2]]

Expand[CanonicalForm[
Distribute[diag /. ar[i_,j_] :> 1/2PutAt[i,j, 101, 101]+PutAt[i,j, 102, 201]+1/2PutAt[i,j, 202, 202]
] /. d_Diag :> Times[
Times @@ (d /. _PutAt -> 1),
(
w= Table[0, {2Length[d]}];
d /. PutAt[i_, j_, alpha1_, alpha2_] :> (
w[[i]]= alpha1; w[[j]] = alpha2
);
W@@w
)
]
]]

UGL2[ (Diag[ar[1,2],ar[3,4]]+Diag[ar[1,3],ar[2,4]]-2 Diag[ar[1,4],ar[2,3]])]

(rels={Diag[ar[1,2],ar[3,4]]+Diag[ar[1,3],ar[2,4]]-2 Diag[ar[1,4],ar[2,3]],Diag[ar[1,2],ar[4,3]]-Diag[ar[1,3],ar[2,4]]+Diag[ar[1,4],ar[2,3]]-Diag[ar[1,4],ar[3,2]],-Diag[ar[1,3],ar[2,4]]+Diag[ar[1,4],ar[2,3]]-Diag[ar[1,4],ar[3,2]]+Diag[ar[2,1],ar[3,4]],-Diag[ar[2,1],ar[3,4]]+Diag[ar[2,3],ar[4,1]]+Diag[ar[3,1],ar[4,2]]-Diag[ar[3,2],ar[4,1]],-Diag[ar[1,2],ar[4,3]]+Diag[ar[2,3],ar[4,1]]+Diag[ar[3,1],ar[4,2]]-Diag[ar[3,2],ar[4,1]],-Diag[ar[2,1],ar[4,3]]-Diag[ar[3,1],ar[4,2]]+2 Diag[ar[3,2],ar[4,1]]}) // UGL2

rels[[3]]

rels[[3]]// UGL2

W[102,101,201] // CanonicalForm

(rels // UGL2) /. RW -> W // CanonicalForm

rels = R /@ Diagrams[R6T+1ar];

UGL2 /@ rels

diags=Diagrams[2ar]

outs=UGL2 /@ diags;

RWs=Union[Cases[outs, _RW, Infinity]]

Normal[mat = SparseArray[
Join @@ Table[
t=outs[[i]];
{i,Position[RWs, #][[1,1]]} -> Coefficient[t, #]& /@ Cases[{t}, _RW, Infinity],
{i,Length[outs]}
],
{Length[outs], Length[RWs]}
]] // MatrixForm

MatrixRank[mat]

v=Wgl[#][n,k]& /@ diags;
mat1 = Transpose[Normal[mat]]~Join~Table[
v /. {n->Random[], k-> Random[]},
{Length[v]+1}
]

MatrixRank[mat1]

NullSpace[mat1]

Length[diags]

UGL2BiAlg[diags]

rels = R /@ Diagrams[R6T+0ar];

UGL2BiAlg /@ rels

rels = R /@ Diagrams[R6T+1ar];

UGL2BiAlg /@ rels