# How to define algebra via generators and relations? Anonymous

Say I want to implement Sweedler's Hopf algebra, just as an algebra, over an algebraically closed field.

I would define the free algebra on the generators, then the ideal by which I want to quotient, and the quotient should behave like I want to.

F.<x,g,ginv> = FreeAlgebra(QQbar)
I = F*[ x^2, g^2 - 1, g*ginv - 1, g*x + x*g ]*F
H = F.quo(I)


But if I now do

H(x*g + g*x)


the output is

xbar*gbar + gbar*xbar


instead of 0.

How do I get sage to actually use the relations? The docs are not helpful here.

edit retag close merge delete

Essentially you are asking for a rewriting system for the algebra H.

Not sure Sage has that. Even g*x + x*g in I results in a "not implemented" error.

Sort by » oldest newest most voted

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.

more