# Quotienting a ring of integers

I was trying to play within the ring of integers of a number field, when I decided to quotient by an ideal. It raised an "IndexError: the number of names must equal the number of generators" exception, which was quite unexpected ; here is an example:

K=NumberField(x**2+1,x)
O=K.ring_of_integers()
O.quo(O.ideal(3))


as you see, I'm using the same ring to define the ideal I want to quotient with, so there is mathematically no problem... so I think either I found a bug or something needs to be documented better. How does one work in a quotient of a ring of integers?

edit retag close merge delete

( 2012-11-23 03:28:08 +0100 )edit

Sort by ยป oldest newest most voted

Does this do what you want?

sage: K.<i> = QuadraticField(-1)
sage: F.<j> = K.residue_field(3)
sage: F.order()
9
sage: j.charpoly()
x^2 + 1

more

Ah, this "residue_field" method is a nice catch, I hadn't seen it -- but the problem is that for the examples I have in mind, the number field might not be quadratic, and the ideals might not be prime ; the first isn't a problem with residue_field, while the second point is a no-go. I like your answer but it doesn't solve what I want. :-(

( 2012-11-23 07:25:06 +0100 )edit
1

For quotients by non-prime ideals, the problem with what you had (using quo or its synonyms quotient and quotient_ring) was that you didn't give a name to the generator of the quotient ring. Thus R = O.quo(O.ideal(3), 'a') and R = O.quo(O.ideal(5), 'a') both work. But at present Sage cannot do much with these rings. For example, R.is_finite() gives rise to a NotImplementedError()

( 2012-11-23 18:29:03 +0100 )edit

Ah, yes! That definitely helps! If you edit your answer to include that, I'll gladly accept it as a valid answer. Thanks!

( 2012-11-29 03:18:18 +0100 )edit