# Revision history [back]

One possibility to implement the algebra $H_4$ from loc. cit., the one where we also use the relations $x^2=0$, $g^2=1$, $gx+xg=0$ (and there is no need for an inverse, since $g^{-1}=g$) would be:

A.<X,G> = FreeAlgebra(QQ, 2)    # or over QQbar
F = A.monoid()
X, G = F.gens()
monomials = [F(1), X, G, X*G]
MS = MatrixSpace(QQ, len(monomials))    # or respectively over QQbar

matrices = [
# matrix showing the action of the first generator, X, on the monomials
MS([0, 1, 0, 0,    # X*1 = X
0, 0, 0, 0,    # X*X = 0
0, 0, 0, 1,    # X*G = XG
0, 0, 0, 0,    # X*XG = (XX)G = 0
]),
# matrix showing the action of the second generator, G, on the monomials
MS([0,  0, 1,  0,    # G*1 = G
0,  0, 0, -1,    # G*X = -XG
1,  0, 0,  0,    # G*G = 1
0, -1, 0,  0,    # G*XG = (GX)G = (-XG)G=-X(GG)=-X
]),
]

H4.<x,g> = A.quotient(monomials, matrices)

Then we have for instance:

sage: (x+g)^2
1
sage: (1+x*g)^2
1
sage: (1+x+g)^10
512 + 512*x + 512*g

Note: It would be interesting to have a full working algebraic setting for the Hopf algebra $H_4$ (including $S$ and $\Delta$). Well, posting as anonymous is not a good idea in general, but ok, here is the state of the art so far.