#7557: conversion of complex numbers in symbolic expressions to maxima broken
---------------------------------+------------------------------------------
       Reporter:  burcin         |         Owner:  burcin                       
    
           Type:  defect         |        Status:  positive_review              
    
       Priority:  major          |     Milestone:  sage-5.6                     
    
      Component:  symbolics      |    Resolution:                               
    
       Keywords:  interfaces     |   Work issues:                               
    
Report Upstream:  N/A            |     Reviewers:  Volker Braun, Karl-Dieter 
Crisman
        Authors:  Burcin Erocal  |     Merged in:                               
    
   Dependencies:                 |      Stopgaps:                               
    
---------------------------------+------------------------------------------
Changes (by kcrisman):

  * status:  needs_work => positive_review
  * reviewer:  Volker Braun => Volker Braun, Karl-Dieter Crisman


Old description:

> Reported on sage-support:
>
> {{{
> var('y', domain='real')
> assume(y, 'real')
>
> abs(exp(y*I)).simplify()
>     1
>
> abs(exp(1.1*y*I)).simplify()
>     e^(1.1*I*y)
>
> The last result is incorrect. It seems simplify() doesn't like
> floating point?
> }}}
>
> In this thread:
>
> http://groups.google.com/group/sage-
> support/browse_thread/thread/c6d4c757cef8cc4a
>

> More evidence:
>
> {{{
> sage: t = abs(exp(y*I)); t
> abs(e^(I*y))
> sage: t._maxima_init_()
> 'abs(exp((y)*(0+%i*1)))'
>
> sage: u = abs(exp(1.1*y*I)); u
> abs(e^(1.10000000000000*I*y))
> sage: u._maxima_init_()
> 'abs(exp((y)*(1.1000000000000001*I)))'
> }}}
>
> This might be the reason:
>
> {{{
> sage: t.operands()[0].operands()[0].operands()[1].pyobject()
> I
> sage: type(t.operands()[0].operands()[0].operands()[1].pyobject())
> <type
> 'sage.rings.number_field.number_field_element_quadratic.NumberFieldElement_quadratic'>
>
> sage: u.operands()[0].operands()[0].operands()[1].pyobject()
> 1.10000000000000*I
> sage: type(u.operands()[0].operands()[0].operands()[1].pyobject())
> <type 'sage.rings.complex_number.ComplexNumber'>
> }}}

New description:

 Reported on sage-support:

 {{{
 var('y', domain='real')
 assume(y, 'real')

 abs(exp(y*I)).simplify()
     1

 abs(exp(1.1*y*I)).simplify()
     e^(1.1*I*y)

 The last result is incorrect. It seems simplify() doesn't like
 floating point?
 }}}

 In this thread:

 http://groups.google.com/group/sage-
 support/browse_thread/thread/c6d4c757cef8cc4a


 More evidence:

 {{{
 sage: t = abs(exp(y*I)); t
 abs(e^(I*y))
 sage: t._maxima_init_()
 'abs(exp((y)*(0+%i*1)))'

 sage: u = abs(exp(1.1*y*I)); u
 abs(e^(1.10000000000000*I*y))
 sage: u._maxima_init_()
 'abs(exp((y)*(1.1000000000000001*I)))'
 }}}

 This might be the reason:

 {{{
 sage: t.operands()[0].operands()[0].operands()[1].pyobject()
 I
 sage: type(t.operands()[0].operands()[0].operands()[1].pyobject())
 <type
 
'sage.rings.number_field.number_field_element_quadratic.NumberFieldElement_quadratic'>

 sage: u.operands()[0].operands()[0].operands()[1].pyobject()
 1.10000000000000*I
 sage: type(u.operands()[0].operands()[0].operands()[1].pyobject())
 <type 'sage.rings.complex_number.ComplexNumber'>
 }}}

 '''Apply'''
 [attachment:trac_7557-maxima_complex_number_conversion.2.patch]

--

Comment:

 I think this one should work?

 Patchbot, apply trac_7557-maxima_complex_number_conversion.2.patch

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7557#comment:12>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to