Ask Your Question
1

Coefficient overflow in PolynomialRing()

asked 2025-07-04 13:14:36 +0200

ThePirate42 gravatar image

I'm trying to create a multivariate polynomial, whose coefficients are elements of Integers(2**256).

The problem is that trying to set any coefficient larger than 2**63 raises OverflowError: Python int too large to convert to C long. I think this is because of the underlying interface to singular, even though singular apparently supports bigints. Is there any workaround to this?

edit retag flag offensive close merge delete

Comments

1
Max Alekseyev gravatar imageMax Alekseyev ( 2025-07-04 16:27:54 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2025-07-05 11:28:31 +0200

rburing gravatar image

A workaround (which is probably not efficient) is:

sage: A = Zmod(2**256)
sage: R.<x,y> = PolynomialRing(A, implementation='generic')
sage: R(2**64)
18446744073709551616
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-07-04 13:14:36 +0200

Seen: 27 times

Last updated: Jul 05