#4190: division of number field order elements doesn't check for membership
---------------------------+------------------------------------------------
Reporter: davidloeffler | Owner: was
Type: defect | Status: new
Priority: major | Milestone: sage-3.1.3
Component: number theory | Keywords:
---------------------------+------------------------------------------------
I think this just about says it all:
{{{
sage: OK = NumberField(x^2 - x + 2, 'w').ring_of_integers()
sage: w = OK.ring_generators()[0]
sage: 1/w in OK
True
}}}
I tested this for cubic fields as well, and the same problem comes up. I
can't work out why this happens -- it must be something weird in the
coercion framework, as there isn't a specific method for division or
inversion of elements of orders: it falls back to
NumberFieldElement.__invert__ and then somehow coerces the result back to
an OrderElement without doing any checks along the way.
I discovered this when trying to find out whether one element of OK was
divisible by another -- "x.divides(y)" raises an error, and "y/x in OK"
always returns True, which isn't very helpful; the best I could find was
"y in x*OK" which seems to give the right results.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4190>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---