[sage-support] Using multifactorial function in Sage/Eclipse

2013-08-22 Thread Asad Akhlaq
Hi, After a long struggle I am able to run my sage code in Eclipse. But I am getting few errors when I run my code that runs without any error in sage notebook. For example using for loop, gives me error if I write for k in [0..10] , I need to change it to for k in range(0,11) ... (I

[sage-support] error: setupterm: could not find terminal

2013-08-22 Thread Martin Albrecht
Hi all, with Sage 5.12.beta3 I get: sage: os.environ[TERM] 'xterm' sage: ZZ? snip /opt/sage-5.12/local/lib/python/curses/__init__.pyc in initscr() 31 # instead of calling exit() in error cases. 32 setupterm(term=_os.environ.get(TERM, unknown), --- 33

Re: [sage-support] arrays in Sage's cython

2013-08-22 Thread Daniel Krenn
Am 2013-08-22 01:12, schrieb Robert Bradshaw: Using a Python list is probably the fastest way to iterate over an array of Python objects--it's a PyObject** under the hood and Cython uses the C API calls to get at it. Ok, thanks for the clearification. Your check might be the bottleneck,

[sage-support] Re: error: setupterm: could not find terminal

2013-08-22 Thread Volker Braun
The change is because we switched to ncurses instead of termcap. Are you on OSX? Your TERM should be set to xterm-new or, even better, xterm-256color https://code.google.com/p/iterm2/issues/detail?id=1956 On Thursday, August 22, 2013 1:56:09 PM UTC+1, Martin Albrecht wrote: Hi all,

Re: [sage-support] arrays in Sage's cython

2013-08-22 Thread John Cremona
On 22 August 2013 14:10, Daniel Krenn kr...@aon.at wrote: Am 2013-08-22 01:12, schrieb Robert Bradshaw: Using a Python list is probably the fastest way to iterate over an array of Python objects--it's a PyObject** under the hood and Cython uses the C API calls to get at it. Ok, thanks for

[sage-support] Re: Re: error: setupterm: could not find terminal

2013-08-22 Thread Martin Albrecht
Hi all, I am running Linux here. I found that link as well and played with my TERM settings, but nothing is working so far: sage: osos.environ[TERM] 'xterm-new' sage: ZZ? WARNING: terminal is not fully functional - (press RETURN) ... and then I am back in the 90s with more. Cheers, Martin

[sage-support] Re: Re: error: setupterm: could not find terminal

2013-08-22 Thread Volker Braun
Your Python managed to build the _curses extension? Mine didn't, which is presumably why it Python can't get itself confused: building '_curses' extension gcc -pthread -fPIC -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -I/home/vbraun/opt/ sage-5.12.beta3/local/include -I. -IInclude

[sage-support] Re: Re: Re: error: setupterm: could not find terminal

2013-08-22 Thread Martin Albrecht
Hi all, yep, looks like it succeeded ... funny that this would present a problem. building '_curses' extension gcc -pthread -fPIC -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall - I/opt/sage-5.12.beta3/local/include -I. -IInclude -I./Include - I/usr/include/x86_64-linux-gnu

[sage-support] Re: Re: Re: error: setupterm: could not find terminal

2013-08-22 Thread Volker Braun
Whats the output of sage -sh strace python -c 'import curses; curses.initscr()' | grep xterm with TERM=xterm and xterm-256color? And ldd $SAGE_ROOT/local/lib/python2.7/lib-dynload/_curses.so -- You received this message because you are subscribed to the Google Groups sage-support

[sage-support] Convolution Polynomial Ring

2013-08-22 Thread Santanu Sarkar
Dear all, Is convolution polynomial ring implemented in Sage? I want to implement NTRU public key cryptosystem. Hence I need modular inverse of a polynomial also in the ring. With regards, Santanu -- You received this message because you are subscribed to the Google Groups sage-support

[sage-support] Re: Re: Re: Re: error: setupterm: could not find terminal

2013-08-22 Thread Martin Albrecht
Hi Volker, On Thursday 22 August 2013 08:31:26 you wrote: sage -sh strace python -c 'import curses; curses.initscr()' | grep xterm with TERM=xterm it's empty. and xterm-256color? it's also empty. ldd $SAGE_ROOT/local/lib/python2.7/lib-dynload/_curses.so $ ldd

[sage-support] Re: Re: Re: Re: error: setupterm: could not find terminal

2013-08-22 Thread Volker Braun
Can you post the whole trace? sage -sh strace python -c 'import curses; curses.initscr()' output.log On Thursday, August 22, 2013 6:23:48 PM UTC+1, Martin Albrecht wrote: Hi Volker, On Thursday 22 August 2013 08:31:26 you wrote: sage -sh strace python -c 'import curses;

Re: [sage-support] arrays in Sage's cython

2013-08-22 Thread Nils Bruin
On Thursday, August 22, 2013 6:21:13 AM UTC-7, John Cremona wrote: Then use srange() which yields Integers. John The appropriate answer should be: use xsrange, unless you explicitly need the integers as a list. The extra memory footprint of srange will probably be detrimental to

[sage-support] Re: Re: Re: Re: Re: error: setupterm: could not find terminal

2013-08-22 Thread Volker Braun
ncurses didn't install the terminfo database on your system... there is apparently no /opt/sage-5.12.beta3/local/share/terminfo Can you post your ncurses build log? On Thursday, August 22, 2013 7:07:17 PM UTC+1, Martin Albrecht wrote: Hi Volker, here it is. Thanks! Cheers, Martin

[sage-support] Re: Convolution Polynomial Ring

2013-08-22 Thread Santanu Sarkar
How to define polynomial ring like Z[x]/(x^10-1) Z_5[x]/(x^10-1) in Sage? On 22 August 2013 12:37, Santanu Sarkar sarkar.santanu@gmail.comwrote: Dear all, Is convolution polynomial ring implemented in Sage? I want to implement NTRU public key cryptosystem. Hence I need modular

[sage-support] Re: Convolution Polynomial Ring

2013-08-22 Thread Stefan van Zwam
On Thursday, August 22, 2013 4:06:22 PM UTC-4, Santanu wrote: How to define polynomial ring like Z[x]/(x^10-1) Z_5[x]/(x^10-1) in Sage? sage: R1.a = PolynomialRing(ZZ) sage: R.x = R1.quotient(a^10 - 1) sage: R2.b = PolynomialRing(GF(5)) sage: S.y = R2.quotient(b^10 - 1) Now you can do:

Re: [sage-support] Re: Convolution Polynomial Ring

2013-08-22 Thread Santanu Sarkar
Thanks. But in this ring, I can not find gcd. N=7 p=3 R2.b = PolynomialRing(GF(p)) S.x = R2.quotient(b^N - 1) f=x^6-x^4+x^3+x^2-1 g=x^6+x^4-x^2-x print gcd(f,g),xgcd(f,g) Traceback (click to the left of this block for traceback) ... TypeError: unable to find gcd On 23 August 2013 03:10,