#15348: "R.<a> =" syntactic sugar incorrect for EquationOrder and ZZ.extension
-----------------------------+-----------------------
   Reporter:  emassop        |            Owner:
       Type:  defect         |           Status:  new
   Priority:  minor          |        Milestone:
  Component:  number fields  |         Keywords:
  Merged in:                 |          Authors:
  Reviewers:                 |  Report Upstream:  N/A
Work issues:                 |           Branch:
     Commit:                 |     Dependencies:
   Stopgaps:                 |
-----------------------------+-----------------------
 After typing
 {{{
 sage: f = x^2+1
 sage: R.<i> = ZZ.extension(f)
 }}}
 I expect variable {{{i}}} to be the element of {{{R}}} named {{{'i'}}}.
 However, it is not. It is the element 1.

 This is due to the generators of an order in Sage being its //module//
 generators (as noted by {{{EquationOrder?}}}):
 {{{
 sage: R.gens()
 [1, i]
 sage: preparse("R.<i> = ZZ.extension(f)")
 "R = ZZ.extension(f, names=('i',)); (i,) = R._first_ngens(1)"
 }}}

 I see three ways of fixing this:
 1) redefine {{{AbsoluteOrder.gens()}}},
 2) make {{{preparse(...)}}} output {{{i = R._element_constructor('i')}}}
 instead of {{{(i,) = R._first_ngens(1)}}},
 3) disallow {{{R.<i> = }}} for {{{EquationOrder}}}.

 Way (1) might make previously good code produce wrong results, so it is
 not a good idea.
 For way (2), {{{_element_constructor}}} should have uniquitious support,
 about which I am unsure. I think way (3) might be achieved by renaming the
 argument {{{names}}} of {{{EquationOrder}}} to {{{field_names}}} or
 somesuch. (For the short term I think {{{names}}} should still be
 accepted, but with a warning.)

--
Ticket URL: <http://trac.sagemath.org/ticket/15348>
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/groups/opt_out.

Reply via email to