#16509: bug in .as_finite_field_element() when minimal=True
-------------------------------------+-------------------------------------
       Reporter:  vdelecroix         |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.3
      Component:  finite rings       |   Resolution:
       Keywords:  bug                |    Merged in:
        Authors:  Peter Bruin        |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/pbruin/16509-as_finite_field_element|  
5572837f991d5ed6a1674e009de8c38e0c3bbc7c
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by pbruin):

 Replying to [comment:2 vdelecroix]:
 > I would prefer that the following works...
 > {{{
 > sage: K = GF(5).algebraic_closure()
 > sage: K3 = K.subfield(3)[0]
 > sage: K6 = K.subfield(6)[0]  # not used
 > sage: K3.gen()
 > z3
 > sage: K6(K3.gen())
 > Traceback (most recent call last):
 > ...
 > TypeError: unable to coerce from a finite field other than the prime
 subfield
 > }}}
 In my opinion, from a mathematical perspective this should ''not'' be
 expected to work.  The first component of the tuple returned by
 `subfield()` method is just the abstract field, and there is no canonical
 map between non-trivial "stand-alone" finite fields.  Either stay inside
 the algebraic closure, or otherwise use the `inclusion()` method to obtain
 a map that you can use outside of it:
 {{{
 sage: K = GF(5).algebraic_closure()
 sage: K3 = K.subfield(3)[0]
 sage: f = K.inclusion(3, 6)
 sage: f(K3.gen())
 4*z6^5 + z6^4 + 4*z6^3 + 4*z6^2 + 3*z6 + 3
 sage: f.codomain() is K.subfield(6)[0]
 True
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/16509#comment:4>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" 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 http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to