-
-
Notifications
You must be signed in to change notification settings - Fork 673
Description
The problem is the following code in sage.libs.singular.ring.singular_ring_new
:
elif PY_TYPE_CHECK(base_ring, FiniteField_generic):
if base_ring.characteristic() <= 2147483629:
characteristic = -base_ring.characteristic() # note the negative characteristic
else:
raise TypeError, "characteristic must be <= 2147483629."
# TODO: This is lazy, it should only call Singular stuff not MPolynomial stuff
k = MPolynomialRing_libsingular(base_ring.prime_subfield(), 1, base_ring.variable_name(), 'lex')
minpoly = base_ring.polynomial()(k.gen())
is_extension = True
elif PY_TYPE_CHECK(base_ring, NumberField) and base_ring.is_absolute():
characteristic = 1
k = MPolynomialRing_libsingular(RationalField(), 1, base_ring.variable_name(), 'lex')
minpoly = base_ring.polynomial()(k.gen())
is_extension = True
Hence, a multivariate libsingular polynomial ring is constructed without using the (cached) polynomial ring constructor. The comment should rather not be "This is lazy,..." but "This is dangerous, it should only call polynomial ring constructor stuff, not MPolynomial stuff".
I am trying to find an example in unpatched Sage where this is actually a problem. However, while working at #10667, the non-unique parents led to several hundred doctest errors in elliptic curves.
Depends on #11339
CC: @malb
Component: coercion
Keywords: non-unique polynomial ring number field
Author: Simon King
Reviewer: Martin Albrecht, David Loeffler
Merged: sage-5.0.beta1
Issue created by migration from https://trac.sagemath.org/ticket/11780