| 1 | initial version |
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.
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.