id summary reporter owner description type status priority milestone component resolution keywords cc merged author reviewer upstream work_issues branch commit dependencies stopgaps
11780 Creating a polynomial ring over a number field results in a non-unique polynomial ring over the rationals SimonKing robertwb "The problem is the following code in `sage.libs.singular.ring.singular_ring_new`:
{{{
#!python
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." defect closed major sage-5.0 coercion fixed non-unique polynomial ring number field malb sage-5.0.beta1 Simon King Martin Albrecht, David Loeffler N/A #11339