#15348: "R.<a> =" syntactic sugar incorrect for EquationOrder and ZZ.extension
-------------------------------------+-------------------------------------
       Reporter:  emassop            |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-7.0
      Component:  number fields      |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Jeroen Demeyer     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/jdemeyer/ticket/15348            |  e857c9a484132348092e21cd1de0711686b8b7f0
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by emassop):

 Replying to [comment:20 jdemeyer]:
 > Replying to [comment:19 emassop]:
 > > Perhaps there could be `defining_generators.set(...)` that would
 > > * populate the cache if it has no value,
 > > * do nothing if the cache and the argument agree,
 > > * populate the cache with an invalid value when the argument and the
 cache disagree.
 > > The invalid value would make a call to `defining_generators` raise an
 exception.
 > I see no reason for this additional layer of complexity. I don't know of
 any cached function in Sage which does this and I don't see why
 `defining_generators` would need it.

 It seems weird if the return value of `.defining_generators` changes
 during an object's life. If the value gets set only once during an
 object's life-time (and survives pickling), then not having this
 additional complexity is okay. The proposal above is merely to enforce
 that the value does not get changed accidentally.

 > > Finally, does it make sense to define `defining_generators` in
 `category_object.pyx` as simply `gens()`, and put the override to
 `ring_generators` in `class Order`?
 > I don't really see why. Currently, `Order` is the only class with
 `ring_generators` but if a new class comes around implementing
 `ring_generators`, I guess (but this is really guessing) that it would
 make sense to use it as defining generators.

 So all other rings with generators use `gens()` for their ring generators?
 Why is `Order` different, especially given that there also is `basis()`?

 For instance
 {{{
 R.<i> = ZZ.extension(x^2+1)
 S.<x> = QQ[]

 A.<a> = QQ.extension(x^2-3)
 B.<b> = ZZ.extension(x^2-3)
 C.<c> = R.extension(x^2-3)
 D.<d> = S.extension(x^2-3)

 print A.gens(), B.gens(), C.gens(), D.gens()
 }}}
 prints `(a,) [1, b] (c,) (d,)` with B.gens() being the odd one out.

--
Ticket URL: <http://trac.sagemath.org/ticket/15348#comment:22>
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 https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to