Sharedsupport / 2015-03-14-poly-nf.sagewsOpen in CoCalc
Authors: Harald Schilly, ℏal Snyder, William A. Stein
License: GNU General Public License v3.0
Description: Examples for support purposes.
# I want to do something like this: R = PolynomialRing(QQ,'x') S.<a>=R.quotient(x^3+x+1) T.<b>=QQ[] b*a

I want to do something like this:

Error in lines 5-5 Traceback (most recent call last): File "/projects/4a5f0542-5873-4eed-a85c-a18c706e8bcd/.sagemathcloud/sage_server.py", line 875, in execute exec compile(block+'\n', '', 'single') in namespace, locals File "", line 1, in <module> File "sage/structure/element.pyx", line 1841, in sage.structure.element.RingElement.__mul__ (build/cythonized/sage/structure/element.c:17183) return coercion_model.bin_op(left, right, mul) File "sage/structure/coerce.pyx", line 850, in sage.structure.coerce.CoercionModel_cache_maps.bin_op (build/cythonized/sage/structure/coerce.c:8045) raise TypeError, arith_error_message(x,y,op) TypeError: unsupported operand parent(s) for '*': 'Univariate Polynomial Ring in b over Rational Field' and 'Univariate Quotient Polynomial Ring in a over Rational Field with modulus x^3 + x + 1'
# Instead, do this: R.<x> = QQ[] S.<a> = NumberField(x^3 + x + 1) T.<b> = QQ[] a*b
a*b
parent(a*b)
Univariate Polynomial Ring in b over Number Field in a with defining polynomial x^3 + x + 1