Can you explain a little more about what does not work? When I try to 
replicate your example, everything works as expected:

sage: n=2
....: F = GF(7)
....: Rx=PolynomialRing(F,n,'x')
....: X=Rx.gens()
sage: f=X[0]+X[1]
sage: f(x0=1)
x1 + 1
sage: f(x0=1,x1=1)
2

Alternatively you can evaluate using positional arguments: in a polynomial 
ring there is a clear implied order on the generators, so the following is 
unambiguous (and accepted):

sage: f(1,1) #gives values for x0 and x1 in order
2
On Friday, 29 April 2022 at 04:33:36 UTC-7 Ha wrote:

> Hi,
> I need to create a polynomial ring with arbitrary number of variables [n] 
> and 
> at some point during computation should be able to substitute values
> for a subset of variables.   I can use the following method to generate
> my ring:
> ##--------------------------------------------
> n=2
> F = GF(7)
> Rx=PolynomialRing(F,n,'x')
> X=Rx.gens()
> ##----------------------------------------------
> But if I take an element f = x0+x1 then how to substitute values for x0 
> and x1?
> In general I could use f(x0 = 1, x1 = 1) but with above method this 
> doesnot seem to work. 
>
> Any help is highly appreciated....
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/4e03c52d-f5a8-44fb-a794-886edde344afn%40googlegroups.com.

Reply via email to