Ask Your Question
0

Multiplication in Polynomial Rings

asked 2025-08-11 03:16:38 +0200

ant_farmer628 gravatar image

updated 2025-08-11 07:16:47 +0200

I am attempting to use substitute elements in a quotient ring into a formula and then multiply the results together, but I keep getting error messages. Here is my code:

R.<x> = QQ[x]

I = R.ideal(cyclotomic_polynomial(27)(x))

R27.<a> = R.quotient(I)

f(y) = (1-y)-(1-y)^2/2+(1-y)^3/3

f(a)*f(a^2)*f(a^4)*f(a^5)

The error message that I get is this:

no canonical coercion from Univariate Quotient Polynomial Ring in a over Rational Field with modulus x^18 + x^9 + 1 to Callable function ring with argument y.

Any suggestions on where I am going wrong and how to fix this?

edit retag flag offensive close merge delete

Comments

Define f as Python function:

f = lambda y: (1-y)-(1-y)^2/2+(1-y)^3/3
Max Alekseyev gravatar imageMax Alekseyev ( 2025-08-12 14:11:47 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2025-08-11 07:22:34 +0200

One approach is to do this:

R.<x> = QQ[x]
I = R.ideal(cyclotomic_polynomial(27)(x))
R27.<a> = R.quotient(I)
S.<y> = R27[]

At this point, S is the polynomial ring with coefficients in R27, variable y. Then you can do

f = (1-y)-(1-y)^2/2+(1-y)^3/3 # note: don't use f(y) on the left-hand side
# you're defining a polynomial f into which ring elements can be substituted for y:
f(a)*f(a^2)*f(a^4)*f(a^5)
edit flag offensive delete link more

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: 2025-08-11 03:16:38 +0200

Seen: 1,336 times

Last updated: Aug 11