Ask Your Question
1

how to evaluate a polynomial in a quotient ring ?

asked 2020-07-21 05:22:20 -0500

andriam gravatar image

updated 2020-07-21 10:02:29 -0500

slelievre gravatar image

I define a polynomial ring and its quotient by an ideal:

sage: F = ZZ.quo(3*ZZ); F
Ring of integers modulo 3
sage: A.<X, Y, Z> = PolynomialRing(F); A
Multivariate Polynomial Ring in X, Y, Z
over Ring of integers modulo 3
sage: R.<x, y, z> = A.quotient(ideal(X^2 - 1, Y^2 - 1, Z^2 - 1)); R
Quotient of Multivariate Polynomial Ring in X, Y, Z
over Ring of integers modulo 3
by the ideal (X^2 + 2, Y^2 + 2, Z^2 + 2)

I define an element in this quotient ring:

sage: f = x*y*z; f
x*y*z
sage: f.parent()
Quotient of Multivariate Polynomial Ring in X, Y, Z
over Ring of integers modulo 3
by the ideal (X^2 + 2, Y^2 + 2, Z^2 + 2)

I want to evaluate this element at $(x, y, z) = (2, 3, 4)$.

I tried this, and got this error message:

sage: f(2, 3, 4)
Traceback (most recent call last)
...
TypeError: 'QuotientRing_generic_with_category.element_class' object is not callable

How can I calculate f(2, 3, 4) with Sage?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2020-07-21 10:05:25 -0500

slelievre gravatar image

Polynomials in the polynomial ring A can be called as functions.

Elements in the quotient ring R cannot.

So one solution is to lift to A and then to evaluate.

sage: F = f.lift(); F
X*Y*Z

sage: r = F(2, 3, 4); r
0

sage: r.parent()
Ring of integers modulo 3
edit flag offensive delete link more

Comments

Thank you very much for editing the questions, codes and for your reply to the question. I didn't know the "lift" fuinction before and this is what I need !

andriam gravatar imageandriam ( 2020-07-21 11:15:59 -0500 )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

1 follower

Stats

Asked: 2020-07-21 05:22:20 -0500

Seen: 133 times

Last updated: Jul 21