Suite à discussion avec Maya Mohsin Ahmed:

Invariants primaires pour les graphes orientés sans boucles sur 3
sommets (degrés 1,2,2,2,3,3)

o((x12+x13)  )
o((x12+x13)^2)
o((x12+x13)^3)
o((x12*x21)  )
o((x21+x31)^2)
o((x21+x31)^3)

package("../PerMuVAR"):
PerMuVAR::useLinBox:=FALSE:
// Nodes
n := 3:
nodes := [ $1..3 ];

// Edges
m := n*(n-1):
edges := [ [i,j] $j in [$1..i-1, $i+1..n] $ i=1..n ];

// Tools to enumerate the edges
[rank, unrank] := combinat::rankers::fromList(edges):
rank([1,3]), unrank(3);

// Induced action on the edges of a permutation of the nodes
OnEdges :=
proc(p: combinat::permutations)
begin
    [ rank(map(unrank(i), j->p[j])) $ i=1..nops(edges) ];
end:
OnEdges([1,2,3]);
OnEdges([2,1,3]);

// Group of permutation of the edges. It's generated by the
// permutations induced by the transposition (1,2) and the cycle (1,2,3)
G := Dom::PermutationGroup(m, [OnEdges([2,1,3]), OnEdges([2,3,1])]);

// Invariant ring of this permutation group
IG := Dom::PermutationGroupInvariantRing(Dom::Rational, G);

// Hilbert series
IG::HilbertSeries(z);

// Generating series of the secondary invariants
IG::secondaryInvariantsSeries(z);

// By default, taking primary invariants of degree 1,...,6, we get
// secondary invariants whose degrees are given by the following
// generating series
p:=expr(IG::secondaryInvariantsSeries(z));

// Let us play out with this series:
factor(p * (1-z^2)/(1-z^4) * (1-z^2)/(1-z^5) * (1-z^3) / (1-z^6));

// This suggests that there exists primary invariants of degrees
// 1,2,2,2,3,3
IG::setPrimaryInvariantsDegrees([1,2,2,2,3,3]):
expr(IG::secondaryInvariantsSeries(t));

// Indeed, you can take the following primary invariants:
// o((x12+x13)  )
// o((x12+x13)^2)
// o((x12+x13)^3)
// o((x12*x21)  )
// o((x21+x31)^2)
// o((x21+x31)^3)
//
// Exercise: prove it by hand!

Here is a minimal generating set, computed via
IG::minimalGeneratingSet()

table(
  4 = [o(x12*x13*x23*x32), o(x12*x21*x13*x32), o(x12*x21*x13*x31), o(x12^2\
*x31*x32)],
  3 = [o(x12*x31*x23), o(x12*x21*x31), o(x12*x13*x23), o(x12*x21*x13), o(x\
12^2*x31)],
  2 = [o(x12 x32), o(x12 x23), o(x12 x21), o(x12 x13)],
  1 = [o(x12)]
)
