Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to define algebra via generators and relations?

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.