That looks like a bug to me: we should not see that error message!

Incidentally, if you insert  I=QQbar(I)  at the top then you should
not need most of the subsequent explicit QQbar() calls:

sage: I=QQbar(I)
sage: v1 = sqrt(QQbar(3))
sage: v2 = 999/1000*I
sage: v3 = (1 + v1)/2 + v2*(-3 - v1)/2
sage: v4 = (3 - v1)/2 + v2*(1 - v1)/2
sage: v5 = v3*(1/2) + v4*(500/999*I)
sage: v6 = v3*(1/2) + v4*(-500/999*I)
sage: v7 = -(v5/v6).conjugate() - (v5.abs())/v5/v6.conjugate()*I
sage: v8 = -(v5/v6).conjugate() + (v5.abs())/v5/v6.conjugate()*I
sage: v9 = v8.abs()
sage: v10 = v7.abs()
sage: v11 = (v7 - v8 + (v9*v9)*v7 - (v10*v10)*v8)/ (v8.conjugate()*v7
- v7.conjugate()*v8)
sage: v12 = (v11*I - (-I)*v11.conjugate())/2/I
sage: v13 = v12.abs()
sage: v14 = (1 - (1 - 1/(v13*v13)).sqrt())*v12
sage: time v14.real()
CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
Wall time: 0.00 s
-0.5773508481209188?

This also caused the error message to go away.  Note that in your code
I was a symbolic object, so you were mixing symbolic and algebraic
objects in an unnecessary (and probably inefficient) way.

John



2010/1/5 Håkan Granath <[email protected]>:
> Hi,
>
> It seems computations in QQbar is sometimes much slower in Sage
> 4.3 than in the previous version. Here is an example (I am sorry
> if it is too convoluted):
>
> v1 = sqrt(QQbar(3))
> v2 = QQbar(999/1000*I)
> v3 = (1 + v1)/2 + v2*(-3 - v1)/2
> v4 = (3 - v1)/2 + v2*(1 - v1)/2
> v5 = v3*(1/2) + v4*QQbar(500/999*I)
> v6 = v3*(1/2) + v4*QQbar(-500/999*I)
> v7 = -(v5/v6).conjugate() - QQbar(abs(v5))/v5/v6.conjugate()*QQbar(I)
> v8 = -(v5/v6).conjugate() + QQbar(abs(v5))/v5/v6.conjugate()*QQbar(I)
> v9 = abs(v8)
> v10 = abs(v7)
> v11 = (v7 - v8 + QQbar(v9*v9)*v7 - QQbar(v10*v10)*v8)/\
>      (v8.conjugate()*v7 - v7.conjugate()*v8)
> v12 = (v11*QQbar(I) - QQbar(-I)*v11.conjugate())/2/QQbar(I)
> v13 = abs(v12)
> v14 = QQbar(1 - sqrt(1 - 1/(v13*v13)))*v12
> time real(v14)
>
> In Sage 4.3 I get the output:
>
> Exception TypeError: TypeError('Unable to convert number to real
> interval.',) in 'sage.symbolic.pynac.py_is_real' ignored
> CPU times: user 67.94 s, sys: 0.30 s, total: 68.23 s
> Wall time: 68.68 s
> -0.5773508481209188?
>
> In Sage 4.2.1 on the same computer I get the output:
>
> CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
> Wall time: 0.00 s
> -0.5773508481209188?
>
> Should this be considered a bug?
>
> /Håkan
>
> --
> To post to this group, send an email to [email protected]
> To unsubscribe from this group, send an email to 
> [email protected]
> For more options, visit this group at 
> http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org
>

-- 
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to