I just got burned by this, so I thought I should report. However, I'm not
sure if this can be called a bug, and if so what exactly the bug is.
{{{
sage: K.<a> = CyclotomicField(4)
sage: P.<x> = PolynomialRing(QQ)
sage: L.<b> = K.extension(x^2-x+1)
sage: u = L.unit_group().gen()
sage: a in [u^i for i in range(12)]
False
sage: a in [L(u)^i for i in range(12)]
True
sage: L(a) in [u^i for i in range(12)]
True
}}}
The trick here is that u is not an element of L:
{{{
sage: parent(u)
Unit group with structure C12 x Z of Number Field in b with defining
polynomial x^2 - x + 1 over its base field
}}}
Nonetheless, I would have expected a and u to be coerced to L for purposes
of comparison. And in fact, this came up in some legacy code (last tested
in Sage 4.8) in which this was handled correctly!
Kiran
--
You received this message because you are subscribed to the Google Groups
"sage-nt" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-nt.
For more options, visit https://groups.google.com/d/optout.