On Nov 18, 6:28 pm, Dima Pasechnik <dimp...@gmail.com> wrote:

> if I understand it right, if we define the minimal parent of
> elements of GF(p^k) and QQ to be GF(p^k), then we get all this for free.

Yes, but the problem is that there is NOT a natural morphism QQ ->
GF(p^k); only a partial map. I don't know how much code breaks if
coercions exist, but fail on particular applications. I'd err towards
mathematical correctness and rigour on this one.

Anyway, if you really want to, you can have it anyway.

sage: F=GF(5)
sage: F.register_coercion(QQ)
sage: F(2)*1/2
1
sage: F(2)*1/5
ZeroDivisionError: Inverse does not exist.

There was orginally an idea to have a context manager to temporarily
install more controversial coercions, a la:

with coercion(F.convert_map_from(QQ)):
    <do something that needs special coercions>

I don't know whether that has ever happened, but it would strike the
perfect balance for situations like this: Convenience when you want
it, without breaking mathematical rigour by default.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
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.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.


Reply via email to