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
}}}