First time here? Check out the FAQ!

Ask Your Question
0

syntex error

asked 8 years ago

this post is marked as community wiki

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

[this line is inserted to help code formatting]

p=(2^3)
print "Prime field P=",p
F.<a> = GF(p);F
K.<b> = F.extension(x^2+(a^2+a+1)*x +a^2) ;K

when i run the code following error obtained on my macbook sage terminal and sage math cloud

Prime field P= 8
Finite Field in a of size 2^3

Error in lines 4-4
Traceback (most recent call last):
  File "/projects/sage/sage-7.3/local/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 957, in execute
    exec compile(block+'\n', '', 'single') in namespace, locals
  File "", line 1, in <module>
  File "sage/rings/finite_rings/finite_field_base.pyx", line 1193, in sage.rings.finite_rings.finite_field_base.FiniteField.extension (/projects/sage/sage-7.3/src/build/cythonized/sage/rings/finite_rings/finite_field_base.c:12767)
    E = Field.extension(self, modulus, name=name, embedding=embedding)
  File "sage/rings/ring.pyx", line 1486, in sage.rings.ring.CommutativeRing.extension (/projects/sage/sage-7.3/src/build/cythonized/sage/rings/ring.c:13322)
    poly = poly.polynomial(self)
  File "sage/rings/polynomial/multi_polynomial.pyx", line 449, in sage.rings.polynomial.multi_polynomial.MPolynomial.polynomial (/projects/sage/sage-7.3/src/build/cythonized/sage/rings/polynomial/multi_polynomial.c:6868)
    raise ValueError("var must be one of the generators of the parent polynomial ring.")
***ValueError: var must be one of the generators of the parent polynomial ring.**
Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 8 years ago

nbruin gravatar image

You didn't define "x", so your result depends on what its value happens to be. What the error indicates (although perhaps not so clearly) is that you need:

 Fx.<x>=F[]

before the definition of K.

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 8 years ago

Seen: 334 times

Last updated: Sep 16 '16