bug comparing trivial dirichlet characters

12 views
Skip to first unread message

Jonathan Bober

unread,
Mar 5, 2012, 8:59:18 PM3/5/12
to sage-nt
Hi all,

I just came across a small but annoying bug ( http://trac.sagemath.org/sage_trac/ticket/12632 ). Is it easy for someone to figure out what is going wrong here? It is some problem with coercion, I think, and I think that it may take me a long time to figure out exactly what is going wrong, so I'm hoping someone else can figure it out easily.

Copy and paste from the trac ticket:

{{{
sage: G1 = DirichletGroup(4)
sage: G2 = DirichletGroup(1)
sage: G2[0] == G1[0].primitive_character()
[...]
ZeroDivisionError: Inverse does not exist.
}}}

(The answer should be {{{True}}}.)

What happens, I think, is that {{{G1[0].primitive_character().parent().base_ring()}}} is not the same as {{{G2.base_ring()}}} and something somewhere tries to do some coercion, and fails:

{{{
sage: G1[0].primitive_character().parent().base_ring()
Cyclotomic Field of order 2 and degree 1
sage: G2.base_ring()
Cyclotomic Field of order 1 and degree 1
}}}

daveloeffler

unread,
Mar 6, 2012, 4:08:23 AM3/6/12
to sag...@googlegroups.com
On Tuesday, 6 March 2012 01:59:18 UTC, Jonathan Bober wrote:
Hi all,

I just came across a small but annoying bug ( http://trac.sagemath.org/sage_trac/ticket/12632 ). Is it easy for someone to figure out what is going wrong here? It is some problem with coercion, I think, and I think that it may take me a long time to figure out exactly what is going wrong, so I'm hoping someone else can figure it out easily.

Yup, this is a bug in the coercion code for cyclotomic fields. Patch is up on trac.

David

Jonathan Bober

unread,
Mar 6, 2012, 4:20:43 AM3/6/12
to sag...@googlegroups.com
Nice! Expect a positive review shortly...

Thanks.

--
You received this message because you are subscribed to the Google Groups "sage-nt" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/sage-nt/-/rtFzz4TLC_YJ.
To post to this group, send an email to sag...@googlegroups.com.
To unsubscribe from this group, send email to sage-nt+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sage-nt?hl=en-GB.

Reply all
Reply to author
Forward
0 new messages