Avoid using symbolic expressions together with real algebra. This works fine:
sage: Fq.<a> = GF(3^10) sage: (2*a^9 + 2*a^8 + a^4 +1)/(a^5+2*a+2) a^9 + a^8 + a^7 + a^5 + 2*a^4 + a^3 + 2*a^2 + 2*a The a here was defined in the first line to be the generator of your field: sage: type(a) <type 'sage.rings.finite_rings.element_givaro.FiniteField_givaroElement'> sage: a.parent() Finite Field in a of size 3^10 On 14 June 2014 06:49, Lian Liu <csliul...@gmail.com> wrote: > I created a finite field > > Fq.<a> = GF(3^10) > > there is a symbolic expression, for example, > ex = (2*a^9 + 2*a^8 + a^4 +1)/(a^5+2*a+2) > and we have > type(ex) = <type 'sage.symbolic.expression.Expression'> > > how can we convert the symbolic expression ex so that it is evaluated as an > element in Fq, > That is, > eval = a^9 + a^8 + a^7 + a^5 + 2*a^4 + a^3 + 2*a^2 + 2*a > such that > type(eval) = <type > 'sage.rings.finite_rings.element_givaro.FiniteField_givaroElement'>? > > I tried to use AA(ex) and algebraic(ex, Fq), but they both gave errors. > Please help. > Thank you. > > -- > You received this message because you are subscribed to the Google Groups > "sage-support" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sage-support+unsubscr...@googlegroups.com. > To post to this group, send email to sage-support@googlegroups.com. > Visit this group at http://groups.google.com/group/sage-support. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.