#18036: I.parent() should not be the symbolic ring
---------------------------------+------------------------
       Reporter:  vdelecroix     |        Owner:
           Type:  defect         |       Status:  new
       Priority:  major          |    Milestone:  sage-6.6
      Component:  number fields  |   Resolution:
       Keywords:                 |    Merged in:
        Authors:                 |    Reviewers:
Report Upstream:  N/A            |  Work issues:
         Branch:                 |       Commit:
   Dependencies:                 |     Stopgaps:
---------------------------------+------------------------

Comment (by vdelecroix):

 Replying to [comment:14 mmezzarobba]:
 > Replying to [comment:13 vdelecroix]:
 > > Anyway this will be instantiated at startup so why not keeping one
 instance `QQi` in `sage.rings.number_field.number_field`? (like we have
 for `ZZ`, `QQ`, etc).
 >
 > If I remember right, currently, just adding `QQi = ...()` in the module
 currently doesn't work due to import order constraints. For now I just
 kept the creation of QQ[i] happening at the same time as it used to. But
 that's certainly something we should try to improve after this first
 draft.

 Here we can probably cheat with
 {{{
 _QQi = None
 def NumberFieldQQi():
     if _QQi is None:
         # build it once for all
         ...
     return _QQi
 }}}

 > > Then you can test identity when testing coercions.
 >
 > Yes. Having a separate class would also be natural if we want
 `I.parent()` to display something less frightening than “Number Field in
 `I` with defining polynomial `x^2 + 1`”, and more generally to implement
 features specific to QQ[i]. But I can't really think of anything that
 makes sense for this field and not for embedded quadratic number fields in
 general, so perhaps it is better to encourage people to always implement a
 more general version?

 Yes! Having a custom representation should be done in the main class. It
 is already possible:
 {{{
 sage: K = QuadraticField(2)
 sage: K.rename('It's me')
 sage: K
 It's me
 sage: K.rename(None)
 sage: K
 Number Field in a with defining polynomial x^2 - 2
 }}}

 > A related question is whether `QQi is NumberField(x^2+1, 'I',
 embedding=CC.0)` should be true, or if there should be two separate
 parents.
 >
 > What do you think?

 More generally, do we want unique representation for (absolute) number
 fields? I would tend to say yes. And the natural keys would be:
  - the polynomial
  - the variable name (not of the polynomial!)
  - the embedding

 Vincent

--
Ticket URL: <http://trac.sagemath.org/ticket/18036#comment:16>
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