# 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.

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.Maybe sagbi can help? Ask Sage query: sagbi.