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'
  • $\begingroup$ 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'> $\endgroup$
    – pjs36
    May 23 '15 at 3:45
  • $\begingroup$ @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'? $\endgroup$
    – Ystar
    May 23 '15 at 3:51
  • $\begingroup$ 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. $\endgroup$
    – pjs36
    May 23 '15 at 3:56
  • 1
    $\begingroup$ Related: ask.sagemath.org/question/26914/fractional-ideals-for-mathbbz $\endgroup$
    – kcrisman
    May 23 '15 at 18:48
  • 1
    $\begingroup$ See a workaround on this sage-support discussion. $\endgroup$ May 24 '15 at 10:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.