Processing math: 100%

First time here? Check out the FAQ!

Ask Your Question
1

how to evaluate a polynomial in a quotient ring ?

asked 4 years ago

andriam gravatar image

updated 4 years ago

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?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 4 years ago

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
Preview: (hide)
link

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 ( 4 years ago )

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: 4 years ago

Seen: 1,187 times

Last updated: Jul 21 '20