### Symbolic calculations in finite field extension

Hello,

Please consider the following code snippet:

```
P_GF2.<X> = PolynomialRing(GF(2))
GF23.<x> = P_GF2.quotient_ring(X^3+X+1)
def f(val):
return val**3
```

This works as expected, when `val`

is something like $1+x+x^2$. What I wanted to do is to calculate the value of $f$, but using a *generic* element of $GF(2^3)$, e.g. $a_2x^2+a_1x+a_0$. The idea is to have the result expressed in terms of the $a_i$. Is this possible in Sagemath?

I have tried to do it using symbolic variables, but they always belong to the Symbolic Ring, which (as far as I can tell) does not mix with other rings. Because this example is small, I was able to do the computations by hand; the value of having SAGE doing it is of course, to apply it to cases that are infeasible to do without a computer.

Thank you very much in advance.