On Wed, Nov 24, 2010 at 1:40 PM, John Cremona <john.crem...@gmail.com> wrote:
> I never use these canonical embeddings, and cannot think of a reason
> for defining one field twice in this way...
>
> Now this would be more useful:
>
> sage: K.<a> = NumberField(x^2+3)
> sage: L.<w> = NumberField(x^2+x+1)
> sage: K.has_coerce_map_from(L)
> False
> sage: L.has_coerce_map_from(K)
> False
> sage: K.is_isomorphic(L)
> True
> sage: K.embeddings(L)
> [
> Ring morphism:
>  From: Number Field in a with defining polynomial x^2 + 3
>  To:   Number Field in w with defining polynomial x^2 + x + 1
>  Defn: a |--> 2*w + 1,
> Ring morphism:
>  From: Number Field in a with defining polynomial x^2 + 3
>  To:   Number Field in w with defining polynomial x^2 + x + 1
>  Defn: a |--> -2*w - 1
> ]
>
> to turn into a coercion!

And it is easy to do so:

sage: phi = K.embeddings(L)
sage: phi[0].register_as_coercion()
sage: a + w
3*w + 1

William

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to