On Fri, May 9, 2008 at 3:12 PM, John Cremona <[EMAIL PROTECTED]> wrote:
>
> Didier, I am sure you are right but I thought it best to deal with one
> matter at a time!  From Rose's posting it looked as if she was just
> trying to count instances in a list, while Tuples is a much more
> complicated function.

You're right, John. I guess I was being a little selfish: sometimes I
mix up symbolic and complex numbers and it  usually catches up to me
several lines down a computation (or gets really slow).

didier

>
> John
>
> 2008/5/9 didier deshommes <[EMAIL PROTECTED]>:
>>
>> On Fri, May 9, 2008 at 1:59 PM, Rose <[EMAIL PROTECTED]> wrote:
>> Hi Rose,
>>
>>>
>>> Second, it becomes pretty long went there are complex numbers in my
>>> Tuples (more than 30 secondes for 7 elements).
>>
>> This does take time, interestingly when the numbers are symbolic:
>>
>> {{{
>> sage: f=range(6)
>>
>> sage: %time Tuples(f,1);
>> CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
>> Wall time: 0.00
>>
>> sage: u=[CC(CC.random_element(10)+i) for _ in range(5)]
>>
>> sage: %time Tuples(u,1);
>> CPU times: user 0.48 s, sys: 0.22 s, total: 0.70 s
>> Wall time: 7.12
>> }}}
>>
>> So I'm guessing you're using symbolic numbers instead of complex
>> numbers. It's easy to get them wrong:
>> {{{
>> sage: symbol=2+I ; type(symbol)
>>  <class 'sage.calculus.calculus.SymbolicArithmetic'>
>>
>> sage: a=CC(2+I) ; type(a)
>>  <type 'sage.rings.complex_number.ComplexNumber'>
>> }}}
>>
>> Hope that helps
>>
>> didier
>>>
>>> I would like to know if there is a better way to count a Tuples of
>>> complex number.
>>>
>>> In general, it is really long when I utilize Tuples with complex
>>> number (in comparaison of doing 2 Tuples, one for real part and one
>>> for imaginary part).
>>>
>>> >
>>>
>>
>> >
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to