[sage-support] Is there a solution ?

2016-01-03 Thread HG
Hi,
I got this balanced ternary file from rosetta, it works fine in python2 but 
not completly in sage : b variable which convert number in ternary is 
failing, a problem of conversion but I don't know how to correct it ?
Any help ?
Thanks
Kind regards
Henri

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


ternarypy.ipynb
Description: Binary data


Re: [sage-support] For loop difference between sage in the cloud and local instalation

2016-01-03 Thread Kazimierz Kurz
Thank You, for explanation! It would be very convenient, especially when You 
use sage for some document/illustration preparation to have loop working as I 
have tried to do. But then I have to manage other way, probably by use 
sagemathcloud.
Thank You! 
Kazek 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Is there a solution ?

2016-01-03 Thread Volker Braun
The code uses explicit isinstance(.., int) checks, which is rather bad 
style. If you don't want to change that then you'll have to pass in a 
Python int:  BalancedTernary(int(10))


On Sunday, January 3, 2016 at 10:01:15 AM UTC+1, HG wrote:
>
> Hi,
> I got this balanced ternary file from rosetta, it works fine in python2 
> but not completly in sage : b variable which convert number in ternary is 
> failing, a problem of conversion but I don't know how to correct it ?
> Any help ?
> Thanks
> Kind regards
> Henri
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Is there a solution ?

2016-01-03 Thread Volker Braun
PS: Since this was a recent improvement, the Sage numeric type now register 
with the pep3141 abstract numbers class so you can (and should) do test like

sage: import numbers
sage: isinstance(5, numbers.Integral)
True
sage: isinstance(5, numbers.Number)
True
sage: isinstance(5/1, numbers.Integral)
False
sage: isinstance(22/7, numbers.Rational)
True
sage: isinstance(1.3, numbers.Real)
True
sage: isinstance(CC(1.3), numbers.Real)
False
sage: isinstance(CC(1.3 + I), numbers.Complex)
True
sage: isinstance(RDF(1.3), numbers.Real)
True
sage: isinstance(CDF(1.3, 4), numbers.Complex)
True
sage: isinstance(AA(sqrt(2)), numbers.Real)
True
sage: isinstance(QQbar(I), numbers.Complex)
True





On Sunday, January 3, 2016 at 11:01:39 AM UTC+1, Volker Braun wrote:
>
> The code uses explicit isinstance(.., int) checks, which is rather bad 
> style. If you don't want to change that then you'll have to pass in a 
> Python int:  BalancedTernary(int(10))
>
>
> On Sunday, January 3, 2016 at 10:01:15 AM UTC+1, HG wrote:
>>
>> Hi,
>> I got this balanced ternary file from rosetta, it works fine in python2 
>> but not completly in sage : b variable which convert number in ternary is 
>> failing, a problem of conversion but I don't know how to correct it ?
>> Any help ?
>> Thanks
>> Kind regards
>> Henri
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: Is there a solution ?

2016-01-03 Thread Henri Girard

Thanks works fine :)

Le 03/01/2016 11:07, Volker Braun a écrit :
PS: Since this was a recent improvement, the Sage numeric type now 
register with the pep3141 abstract numbers class so you can (and 
should) do test like


sage: import numbers
sage: isinstance(5, numbers.Integral)
True
sage: isinstance(5, numbers.Number)
True
sage: isinstance(5/1, numbers.Integral)
False
sage: isinstance(22/7, numbers.Rational)
True
sage: isinstance(1.3, numbers.Real)
True
sage: isinstance(CC(1.3), numbers.Real)
False
sage: isinstance(CC(1.3 + I), numbers.Complex)
True
sage: isinstance(RDF(1.3), numbers.Real)
True
sage: isinstance(CDF(1.3, 4), numbers.Complex)
True
sage: isinstance(AA(sqrt(2)), numbers.Real)
True
sage: isinstance(QQbar(I), numbers.Complex)
True





On Sunday, January 3, 2016 at 11:01:39 AM UTC+1, Volker Braun wrote:

The code uses explicit isinstance(.., int) checks, which is rather
bad style. If you don't want to change that then you'll have to
pass in a Python int:  BalancedTernary(int(10))


On Sunday, January 3, 2016 at 10:01:15 AM UTC+1, HG wrote:

Hi,
I got this balanced ternary file from rosetta, it works fine
in python2 but not completly in sage : b variable which
convert number in ternary is failing, a problem of conversion
but I don't know how to correct it ?
Any help ?
Thanks
Kind regards
Henri

--
You received this message because you are subscribed to the Google 
Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to sage-support+unsubscr...@googlegroups.com 
.
To post to this group, send email to sage-support@googlegroups.com 
.

Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Display methods of gap object

2016-01-03 Thread Peter Mueller
Consider this example code from the docs:

sage: n = gap(20062006); n
20062006
sage: n.parent()
Gap
sage: fac = n.Factors(); fac
[ 2, 17, 59, 73, 137 ]

I would expect that dir(n) should list the available methods of n, and if I 
remember right, this worked except for the last few versions of Sage. In 
particular, it does not work in 6.9 and 6.10 anymore:

sage: 'Factors' in dir(n)
False

This is particularly annoying when looking up the grouptheoretic methods 
from Gap for sage groups g converted to gap groups gap(g).

-- Peter Mueller

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Error Installing sage-6.10-OSX_10.11.2-x86_64.app.dmg

2016-01-03 Thread Gustavo Mercier
Hi!

I am running a Mac Book Pro OS X 10.11.2 (El Capitan with all update). I 
attempted to install the app version of sage 6.10 for this system, as 
recommended by the developers. MD5 checksum ok. Transferred to Applications 
folders ok. Upon double clicking the app icon to start the program, it 
fails to load with the error statement listed below. There is an 
ImportError complaining of an undefined symbol in a dynamic library, 
operator.so, from python.

Any thoughts on how to resolve this problem?

Thanks!

GMercier

Last login: Sat Jan  2 10:10:07 on ttys003

gusmcpro2:~ gamercier$ 
'/Applications/SageMath-6.10.app/Contents/Resources/sage'/sage --notebook

RecursionError: maximum recursion depth exceeded during compilation

Traceback (most recent call last):

  File 
"/Applications/SageMath-6.10.app/Contents/Resources/sage/src/bin/sage-notebook",
 
line 7, in 

import argparse

  File 
"/Applications/SageMath-6.10.app/Contents/Resources/sage/local/lib/python/argparse.py",
 
line 85, in 

import collections as _collections

  File 
"/Applications/SageMath-6.10.app/Contents/Resources/sage/local/lib/python/collections.py",
 
line 9, in 

from operator import itemgetter as _itemgetter, eq as _eq

ImportError: 
dlopen(/Applications/SageMath-6.10.app/Contents/Resources/sage/local/lib/python2.7/lib-dynload/operator.so,
 
2): Symbol not found: __PyUnicodeUCS4_AsDefaultEncodedString

  Referenced from: 
/Applications/SageMath-6.10.app/Contents/Resources/sage/local/lib/python2.7/lib-dynload/operator.so

  Expected in: flat namespace

 in 
/Applications/SageMath-6.10.app/Contents/Resources/sage/local/lib/python2.7/lib-dynload/operator.so

gusmcpro2:~ gamercier$ 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Problem solving an ode system

2016-01-03 Thread Frédéric Feyel
Hi everyone, I wish you all a happy new year.

I have a (certainly trivial) problem while solving a differential system of 
equations :

-(2^(r^3)*r^5*D[0](p)(r, th, ph) + 3*(6*a^3*mu*r^9*log(2)^2 - 
8*a^3*mu*r^6*log(2) - 2*a^3*mu*r^3 - 
(a^3*mu - a*mu*r^2)*2^(r^3))*U_0*cos(th) + (2^(r^3)*gg*r^5*rho + 
2^(r^3)*r^5)*cos(th))*2^(-r^3)/r^5 == 0

and



-(2^(r^3 + 1)*r^4*D[1](p)(r, th, ph) + (6*a^3*mu*r^6*log(2) - 8*a^3*mu*r^3 + 
(a^3*mu + 3*a*mu*r^2)*2^(r^3))*U_0*sin(th) 
- (2^(r^3 + 1)*gg*r^5*rho + 2^(r^3 + 1)*r^5)*sin(th))*2^(-r^3 - 1)/r^5 == 0

where p is a function of 3 variables (two in fact, as ph does not play any 
role).

I am trying to solve the first one using :

desolve(first_expr==0,dvar=p,ivar=r)

and I get the following error :

AttributeError: 'NewSymbolicFunction' object has no attribute 'operator'

Could someone help me a bit ? My strategy is rather trivial : solve the very 
simple first equation using an unknown _f(th) function; then solve the second 
equation.


Best regards,

Frederic.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Error Installing sage-6.10-OSX_10.11.2-x86_64.app.dmg

2016-01-03 Thread Volker Braun
Did you run sage before moving it to /Applications? This is not supported, 
once you start it the paths are fixed. If you drag it directly from the DMG 
to /Applications and then start it there it'll work.





On Sunday, January 3, 2016 at 9:56:39 PM UTC+1, Gustavo Mercier wrote:
>
> Hi!
>
> I am running a Mac Book Pro OS X 10.11.2 (El Capitan with all update). I 
> attempted to install the app version of sage 6.10 for this system, as 
> recommended by the developers. MD5 checksum ok. Transferred to Applications 
> folders ok. Upon double clicking the app icon to start the program, it 
> fails to load with the error statement listed below. There is an 
> ImportError complaining of an undefined symbol in a dynamic library, 
> operator.so, from python.
>
> Any thoughts on how to resolve this problem?
>
> Thanks!
>
> GMercier
>
> Last login: Sat Jan  2 10:10:07 on ttys003
>
> gusmcpro2:~ gamercier$ 
> '/Applications/SageMath-6.10.app/Contents/Resources/sage'/sage --notebook
>
> RecursionError: maximum recursion depth exceeded during compilation
>
> Traceback (most recent call last):
>
>   File 
> "/Applications/SageMath-6.10.app/Contents/Resources/sage/src/bin/sage-notebook",
>  
> line 7, in 
>
> import argparse
>
>   File 
> "/Applications/SageMath-6.10.app/Contents/Resources/sage/local/lib/python/argparse.py",
>  
> line 85, in 
>
> import collections as _collections
>
>   File 
> "/Applications/SageMath-6.10.app/Contents/Resources/sage/local/lib/python/collections.py",
>  
> line 9, in 
>
> from operator import itemgetter as _itemgetter, eq as _eq
>
> ImportError: 
> dlopen(/Applications/SageMath-6.10.app/Contents/Resources/sage/local/lib/python2.7/lib-dynload/operator.so,
>  
> 2): Symbol not found: __PyUnicodeUCS4_AsDefaultEncodedString
>
>   Referenced from: 
> /Applications/SageMath-6.10.app/Contents/Resources/sage/local/lib/python2.7/lib-dynload/operator.so
>
>   Expected in: flat namespace
>
>  in 
> /Applications/SageMath-6.10.app/Contents/Resources/sage/local/lib/python2.7/lib-dynload/operator.so
>
> gusmcpro2:~ gamercier$ 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.