#9752: sorting of number field elements is broken
-----------------------------+----------------------------------------------
Reporter: was | Owner: davidloeffler
Type: defect | Status: new
Priority: major | Milestone: sage-4.5.3
Component: number fields | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
-----------------------------+----------------------------------------------
The design of number field elements (and other aspects of sage) assumes
that cmp defines a total ordering, which of course doesn't respect the
algebraic field structure. Unfortunately, the actual implementation (in
number_field_element.pyx) is buggy and doesn't define a total ordering.
Look at the code and you'll see. Or just look at this example:
{{{
sage: L.<b> = NumberField(x^3-10001)
sage: b+1 < L(1667)
False
sage: L(1667) < b+1
False
}}}
I think the best correct implementation of cmp should be one that is
efficient and *also* agrees with the lexicographic ordering of elements
based on their representation as a polynomial in the generator of the
number field. I did implement this as part of the patch bomb #9541. The
point of the present ticket is to "backport" something like this out of
#9541, or implement a new fix from scratch. This is motivated by #9400.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9752>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.