Ask Your Question

Segmentation fault when multiplying by variable

asked 2017-10-18 15:43:53 -0500

Psi gravatar image

updated 2017-10-20 04:20:24 -0500

tmonteil gravatar image

In Sage 7.5.1 I'm trying to work with unknown values in GF(3) and polynomials.

The following code gives me a segmentation fault:

P.<x> = GF(3)['x']
sigma = 2*x+ 1

What is the proper way to handle unknown GF(3) values like "a" in Sage?

edit retag flag offensive close merge delete


Seg fault confirmed with Sage 8.1.beta5; looks a real bug...

eric_g gravatar imageeric_g ( 2017-10-18 17:15:44 -0500 )edit

@eric_g Yikes, should I report it somewhere?

Psi gravatar imagePsi ( 2017-10-19 10:38:50 -0500 )edit

same error in 8.1.beta8.

mforets gravatar imagemforets ( 2017-10-19 10:47:33 -0500 )edit

Bug confirmed. I haven't been able to track it completely, but experimentally the bug happens when one multiplies a symbolic expression by a non-monic polynomial over some finite field.

You can report it on trac and/or on sage-devel.

Concerning your last question, on possibility (depending on what is your goal) is to define a multivariate polynomial ring in x and a, using for instance P.<x,a> = GF(3)[].

B r u n o gravatar imageB r u n o ( 2017-10-19 11:15:31 -0500 )edit

I've created #24072 to report the bug.

B r u n o gravatar imageB r u n o ( 2017-10-20 02:09:36 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2017-10-25 03:45:48 -0500

B r u n o gravatar image

The ticket #24072 has been positively reviewed, meaning that it will be included into the next SageMath release. The solution found by developers is to forbid to mix elements from the symbolic ring SR and elements from finite fields. The reason is that the symbolic ring is inherently a ring of characteristic $0$. Your example will not result in a segmentation fault anymore, but you'll get an exception TypeError: positive characteristic not allowed in symbolic computations.

In your case, the solution is to work with either a multivariate polynomial ring (P.<x, a> = GF(3)[]), or you may want to have rational functions in a for instance, using P.<x> = GF(3)[] and F.<a> = FractionField(P['a']).

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

1 follower


Asked: 2017-10-18 15:30:48 -0500

Seen: 139 times

Last updated: Oct 25 '17