# $\mathbb{Q}$ isn't a number field for SAGE

This is more a question about the weird behavior of SAGE:

sage: K.<a> = NumberField(x^3-5)
sage: O_K = K.ring_of_integers()
sage: I_K = O_K.fractional_ideal(3/7)
sage: I_K
Fractional ideal (3/7)


But SAGE insists that for QQ (which is the rationals $\mathbb{Q}$) there are no fractional ideals:

sage: reset()
sage: O_K = QQ.ring_of_integers()
sage: I_K = O_K.fractional_ideal(3/7)
AttributeError: 'sage.rings.integer_ring.IntegerRing_class' object has
no attribute 'fractional_ideal'

• When I ask sage to print type(O_K) in the first example, it tells me <class 'sage.rings.number_field.order.AbsoluteOrder_with_category'>, but in the second example, it tells me <type 'sage.rings.integer_ring.IntegerRing_class'> – pjs36 May 23 '15 at 3:45
• @pjs36: What can I do so that O_K (which is the same as ZZ) is seen as 'sage.rings.number_field.order.AbsoluteOrder_with_category'? – Ystar May 23 '15 at 3:51
• Now that I don't know. You can try typing O_K. then hit tab, to see what built-in functions exist. I see some coerce stuff, but I've never played with it myself. I'm not a CA guy, but here's some documentation that could help. – pjs36 May 23 '15 at 3:56
• – kcrisman May 23 '15 at 18:48
• See a workaround on this sage-support discussion. – Samuel Lelièvre May 24 '15 at 10:37