Ask Your Question
0

NumberField NotImplemented Error

asked 2020-02-25 12:54:32 +0200

Erratis gravatar image

updated 2020-02-25 20:24:39 +0200

Hello!

I am currently trying to use NumberFields but I am getting random errors when using them. I am trying to construct a NumberField by using

K=NumberField(x^2 +x+ 1, 'y')

or

K.<y> = NumberField(x^2+x+1)

Sometimes it works out just fine and other times i just get this NotImplemented Error:

Traceback (most recent call last):
  File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 1234, in execute flags=compile_flags), namespace, locals)
  File "", line 1, in <module>
  File "sage/modules/free_module_element.pyx", line 2023, in sage.modules.free_module_element.FreeModuleElement.__pow__ (build/cythonized/sage/modules/free_module_element.c:14871)
    raise NotImplementedError
NotImplementedError

And after that I can't make it work anymore. I tried resetting variables but that doesn't seem to be the problem. Does anybody might have an idea what causes this issue?

Cheers

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-02-25 15:56:25 +0200

rburing gravatar image

Both definitions of K are valid when x is a generator of a polynomial ring (or symbolic).

The error says that __pow__ is not implemented, because (in this case) your x is somehow an element of a free module, so it doesn't make sense to raise it to a power.

So you must have used the name x for something else. So don't do that and/or (re)define it as x = polygen(QQ) or R.<x> = QQ[] or R.<x> = PolynomialRing(QQ) (or var('x') to make it symbolic), etc.

edit flag offensive delete link more

Comments

Hello rburing.

I will try this solution and if the error gets raised again I will report the issue. Thank you for your quick reply.

Erratis gravatar imageErratis ( 2020-02-25 16:53:17 +0200 )edit

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2020-02-25 12:54:32 +0200

Seen: 637 times

Last updated: Feb 25 '20