On Mon, 17 Jun 2019 at 13:02, chandra chowdhury <[email protected]>
wrote:

> Hi,
>   I have multi variable polynomial over integers say f(x,y,z).
> I want to define it over GF(5) efficiently.
>
> For that I am doing this:
>
>
> R=PolynomialRing(GF(5), 3, 'X')
> Z = list(R.gens())
>
> But g=R(f(Z)) is not working.
>

If you also define, say,

sage: RZ = PolynomialRing(ZZ,3,'Y')

as a parent for polynomials over the integers then Sage can coerce elements
of RZ into R directly.  For example (first assigning to the identifiers Y0,
Y1, Y2 their natural values in RZ):

sage: Y0, Y1, Y2 = Z.gens()
sage: f = RZ.random_element()
sage: f
7*Y0*Y1 + 5*Y2^2 - Y2
sage: R(f)
2*X0*X1 - X2
sage: f = RZ.random_element()
sage: f
-Y0^2 + Y0*Y2 + Y1*Y2 + 4*Y2
sage: R(f)
-X0^2 + X0*X2 + X1*X2 - X2

> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/sage-support.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-support/CAC3pSB%2B6cxwuOtKJ1EMVBZUnyrFW%3Dj2%3Dv58ZNQu9fjxfsMAEqA%40mail.gmail.com
> <https://groups.google.com/d/msgid/sage-support/CAC3pSB%2B6cxwuOtKJ1EMVBZUnyrFW%3Dj2%3Dv58ZNQu9fjxfsMAEqA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> 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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/CAD0p0K4Mxbco18db0Cckb9o6VD5WXivjfeG%3Dw1LP2K%3D1wrwwQA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to