Opened 12 years ago

Closed 12 years ago

#8721 closed defect (fixed)

Residue fields for relative number fields broken (again)

Reported by: David Loeffler Owned by: David Loeffler
Priority: major Milestone: sage-4.6.2
Component: number fields Keywords:
Cc: Merged in: sage-4.6.2.alpha4
Authors: David Loeffler Reviewers: Marco Streng
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


sage: L.<a, b> = NumberField([x^2 - 3, x^2 - 5])
sage: L.ideal(a).residue_field()
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (921, 0))

ValueError                                Traceback (most recent call last)

/home/masiao/<ipython console> in <module>()

/storage/masiao/sage-4.4.alpha0/local/lib/python2.6/site-packages/sage/rings/number_field/number_field_ideal.pyc in residue_field(self, names)
   2372         if not self.is_prime():
   2373             raise ValueError, "The ideal must be prime"
-> 2374         return self.number_field().residue_field(self, names = names)
   2376     def residue_class_degree(self):

/storage/masiao/sage-4.4.alpha0/local/lib/python2.6/site-packages/sage/rings/number_field/number_field.pyc in residue_field(self, prime, names, check)
   4171             raise ValueError, "%s is not a prime ideal"%prime
   4172         from sage.rings.residue_field import ResidueField
-> 4173         return ResidueField(prime, names = names, check = False)
   4175     def signature(self):

/storage/masiao/sage-4.4.alpha0/local/lib/python2.6/site-packages/sage/rings/ in sage.rings.residue_field.ResidueField (sage/rings/residue_field.c:4132)()

/storage/masiao/sage-4.4.alpha0/local/lib/python2.6/site-packages/sage/rings/number_field/number_field_ideal.pyc in __call__(self, x)
   2476         # Write back in terms of K
   2477         z = w * self.__M_OK_map
-> 2478         return self.__OK(z.list())
   2480     def __repr__(self):

/storage/masiao/sage-4.4.alpha0/local/lib/python2.6/site-packages/sage/rings/number_field/order.pyc in __call__(self, x)
   1399         """
-> 1401         x = self._K(x)
   1402         abs_order = self._absolute_order
   1403         to_abs = abs_order._K.structure()[1]

/storage/masiao/sage-4.4.alpha0/local/lib/python2.6/site-packages/sage/structure/ in sage.structure.parent.Parent.__call__ (sage/structure/parent.c:6161)()

/storage/masiao/sage-4.4.alpha0/local/lib/python2.6/site-packages/sage/structure/ in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (sage/structure/coerce_maps.c:3109)()

/storage/masiao/sage-4.4.alpha0/local/lib/python2.6/site-packages/sage/structure/ in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (sage/structure/coerce_maps.c:3011)()

/storage/masiao/sage-4.4.alpha0/local/lib/python2.6/site-packages/sage/rings/number_field/number_field.pyc in _element_constructor_(self, x)
   1019                  self.base_ring().has_coerce_map_from(x.parent().base_ring())):
   1020             if len(x) != self.relative_degree():
-> 1021                 raise ValueError, "Length must be equal to the degree of this number field"
   1022             result = x[0]
   1023             for i in xrange(1,self.relative_degree()):

ValueError: Length must be equal to the degree of this number field

We've had problems with similar issues before -- see #6463 -- and the doctest I added back then shows that not all relative residue fields are broken; but this one seems to be!

Attachments (1)

trac_8721-residue_field_lifting_bug.patch (1.9 KB) - added by David Loeffler 12 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 12 years ago by David Loeffler

Authors: David Loeffler
Status: newneeds_review

Here's a patch.

Changed 12 years ago by David Loeffler

comment:2 Changed 12 years ago by Marco Streng

Reviewers: Marco Streng
Status: needs_reviewpositive_review

fixes at least this example, all tests pass, and everything I tried worked

comment:3 Changed 12 years ago by Jeroen Demeyer

Merged in: sage-4.6.2.alpha4
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.