Hello John, > I think this is a bug. In one Sage session: > > sage: F4 = GF(4) > sage: F16 = GF(16) > sage: F4.gen() in F16 > True > sage: F16.has_coerce_map_from(F4) > True > > -- all is well. But in a new session: > > sage: F4 = GF(4, names='a') > sage: F16 = GF(16, names='b') > sage: F4.gen() in F16 > False > sage: F16.has_coerce_map_from(F4) > False > > Why should the fact that I have given non-default names to the > generators (the default names are z2 and z4) stop the coercion being > dicovered?
Creating finite fields without a variable name was implemented in <https://trac.sagemath.org/ticket/17569>. If you don't specify a variable, then the field is created as a subfield of an algebraic closure, and there are canonical inclusions between such fields. Otherwise, the finite field does not have such a distinguished embedding. By the way, creating finite fields without a variable name is something that you should only do for small fields, because constructing an algebraic closure requires computing (pseudo-)Conway polynomials. > Worse than that, I tried to create my own coercion from F4 to F16 in > the second situation and it prevented me from doing so, saying there > already was one, while at the same time telling me there was no > coercion. Inconsistent! Even though there is no coercion map in this situation, simply trying to discover a coercion "taints" the target parent by registering the fact that there is no coercion. It does work if you don't call has_coerce_map() first: sage: F4 = GF(4, names='a') sage: F16 = GF(16, names='b') sage: f = F4.Hom(F16) sage: F16.register_coercion(f) You can't rely on this to work, though, because it can fail if F16 was already created in this Sage session. Peter -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to firstname.lastname@example.org. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.