I think any number theorist would be happy with is_prime() meaning
is_prime_in_the_ring_of_integers() for both number fields (as at
present, it seems) and for QQ.  It's the pedantic algebraists who
don't like it!

At least with ZZ and QQ there are two different parents, but we do not
have a type or class for "element of the ring of integers of a number
field", unlike (for example) Magma.  I do not propose that we have
such a thing, but then we need to be flexible when we ask of a number
field element a questions which only makes sense if it is integral.

John

On 9 March 2015 at 15:45, Jeroen Demeyer <jdeme...@cage.ugent.be> wrote:
> On 2015-03-09 12:04, Jori Mantysalo wrote:
>>
>> When has this changed? Why?
>
>
> I changed this in http://trac.sagemath.org/ticket/17538
>
> The main motivation was to have an is_prime() method for elements of the
> ring of integers of a number field, such as ZZ[sqrt(-1)]. Since primality
> checking of ideals for such rings was already implemented, it made sense to
> define is_prime() also for elements.
>
> For number field elements, is_prime() *does* look at ring of integers:
>
> sage: Q.<u> = NumberField(x)
> sage: Q
> Number Field in u with defining polynomial x
> sage: Q(2).is_prime()
> True
> sage: QQ(2).is_prime()
> False
>
> This is because of
>
> sage: Q.ideal(2)
> Fractional ideal (2)
> sage: QQ.ideal(2)
> Principal ideal (1) of Rational Field
>
> Honestly, I don't know the best way to fix all this.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to