#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:17 mmezzarobba]:
 > > > 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 think everyone agrees that absolute number fields should have unique
 representation. My question was whether Q[i] should ''be'' an absolute
 number field in this sense, or if it should be a “special” object such
 that people could work with both Q[i]-as-a-subset-of-complex-numbers and
 Q[i]-as-a-number field, possibly at the same time. I'd prefer a single
 object as well, but I am sure I have missed some of the implications, so
 if anyone has arguments in favor of the other option, I would be
 interested in hearing them.

 I would be interested in working with '''any''' number field seeing them
 as a subfield of the real or complex numbers! Not only `QQi` and it makes
 sense to ask whether we need a dedicated class for that. For both parent
 and elements.

 Note that it is already partly possible to play with element of number
 fields as real numbers (especially with quadratic fields)
 {{{
 sage: K.<sqrt2> = QuadraticField(2)
 sage: 1 < sqrt2 < 3/2
 True
 sage: sqrt2.n()
 1.41421356237310
 sage: sqrt2 + CC(0,1)
 1.41421356237310 + 1.00000000000000*I
 sage: sage: cos(sqrt2)
 cos(sqrt(2))
 sage: sqrt2.continued_fraction()
 [1; (2)*]
 }}}

 About having methods `.cos()`, `.sin()`, `.exp()`, it is already something
 which I found dangerous with integers for which the method `.sqrt()` might
 return an answer with a different parent
 {{{
 sage: 4.sqrt()  # answer is a Sage integer
 2
 sage: 2.sqrt()  # answer is symbolic
 sqrt(2)
 }}}
 Which is very different from
 {{{
 sage: R.<x> = ZZ[]
 sage: ((x+1)**2 * (x-2)**4).sqrt()
 x^3 - 3*x^2 + 4
 sage: R(2).sqrt()
 Traceback (most recent call last):
 ...
 TypeError: Polynomial is not a square. You must specify
 the name of the square root when using the default extend = True
 }}}

 At the time Sage would support embedding of number fields into p-adic
 fields, I think it might be worse to have that dedicated class! But in the
 meantime, I have no strong opinion.

 Vincent

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