# how to run fraction elenment in Multivariate Polynomial Ring in over Finite Field ring This post is a wiki. Anyone with karma >750 is welcome to improve it.

edit retag close merge delete

Sort by » oldest newest most voted

to me, it seems that you have defined the fraction field but have not defined the "variables". You should do

F.<x,y>=Frac(k['x,y'])

or

F=Frac(k['x,y']) x,y=F.gens()

more

Let's take this one step at a time. If you put lots of commands on one line then it is hard to see which one gives the error. The was to define GF(27) is

sage: k=GF(27, 'a')
sage: a=k.gen()


or more concisely

sage: k.<a>=GF(27)


Since it is not a prime field, Sage needs to know what name to give its generator, and also you need to define a variable whose value is that generator. Now

sage: F=Frac(k['xy'])
sage: F
Fraction Field of Univariate Polynomial Ring in xy over Finite Field in a of size 3^3


shows that you have defined a function field in one variable called 'xy', not in two variables. I think you meant this:

sage: F=Frac(k['x','y'])
sage: F
Fraction Field of Multivariate Polynomial Ring in x, y over Finite Field in a of size 3^3


Now for the rest of your input to work, you still need to define variables called x and y ( so far you have only told Sage to use 'x' and 'y' to output elements of F):

sage: x,y = F.gens()


Now the rest works ok -- but x/y is an element of F, there is no need to write F(x/y).

more This post is a wiki. Anyone with karma >750 is welcome to improve it.

sorry,I try 3 times to format it ,but still blue,I donot know why,I copy it to save as a .txt file,but copy back still bule......

below "y" cannot run

F=Frac(k['x,y']);F;F(3x/4);F(7x/2-3);F(y)/F(y^2+3)

NameError: name 'y' is not defined

more

1

To format a piece of code, add 4 spaces before each line. Alternatively, select the code and click on the 101/010 button. This post is a wiki. Anyone with karma >750 is welcome to improve it.

thank you very much!I try it!OK!

k=GF(27, 'a');a=k.gen();F=Frac(k['x','y']);x,y = F.gens()

F(y)/F(y^2+3);F(y)/(y^2+3);F(y-x^3)/F(y^2+3+x)

1/y 1/y (-x^3 + y)/(y^2 + x)

more