Hi! Here are two independent Sage 4.1 sessions which demonstrate that the construction of NumberField's is context dependent:
sage: K.<x> = CyclotomicField(5)[] sage: W.<a> = NumberField(x^2 + 1) sage: W Number Field in a with defining polynomial x^2 + 1 over its base field sage: W1 = NumberField(x^2+1,'a') sage: K.<x> = CyclotomicField(5)[] sage: W.<a> = NumberField(x^2 + 1) sage: W Number Field in a with defining polynomial x^2 + 1 In fact: sage: W1 is W0 True Related example, in a fresh Sage session: sage: p = x^2 + 1 sage: K.<x> = CyclotomicField(5)[] sage: q = x^2 + 1 sage: bool(p==q) True Personal analysis: p and q do not have the same ground field, but are considered as equal, because p can be coerced into q. This confuses the caching mechanism of NumberField. Can anyone familiar with NumberField confirm? Very personal interpretation: this is a strong argument for limiting as much as possible the use of coercions in equality testing. Cheers, Nicolas PS: This behavior appears with Sage 4.1, with or without the Sage-Combinat patches applied. For some reason the tests for number_field_rel trigger it in the first case, but not the second one. William: what should I do about this? I don't want to wait for a fix to release sagecombinat 4.1. Should I just ignore this? comment out the tests? -- Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net> http://Nicolas.Thiery.name/ --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---