[sage-support] Re: nitpicking on README.txt

2011-05-27 Thread Keshav Kini
Post a trac ticket, and add a patch. In current development versions of sage 
there is a Mercurial repository in which README.txt is tracked, so you can 
generate a patch against this repository using Mercurial queues. Or I can do 
it for you if you like.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: nitpicking on README.txt

2011-05-27 Thread Keshav Kini
I did it anyway :P http://trac.sagemath.org/sage_trac/ticket/11387



Join us in #sagemath on irc.freenode.net !

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Error: Converting from p-adics to rationals.

2011-05-27 Thread JamesHDavenport
I know very little about SAGE, but surely the point is that this is
not well-defined:
what rational were you expecting? You can only guarantee to get a
number with (num,den)
sqrt(p^k/2), and there isn't one, as 1 itself doesn't work.
Did you wnat to convert to integer?
On May 26, 1:53 am, Mel chemmyg...@gmail.com wrote:
 Specifically, there are certain p-adic numbers that I cannot convert
 to rationals. As an example, if 1+7^3+O(7^5) is a 7-adic integer with
 capped relative precision 5, I cannot convert it to a rational. I get
 the error ValueError: Rational reconstruction of 344 (mod 16807) does
 not exist.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Import Ellipse module?

2011-05-27 Thread Rajeev Singh
On Thu, May 26, 2011 at 10:26 PM, Mel chemmyg...@gmail.com wrote:

 Do I need to download/load something before I can import the ellipse
 module?

 When I type
from sage.plot.ellipse import Ellipse
 I get ImportError: No module named ellipse

 Thanks!

 --
 To post to this group, send email to sage-support@googlegroups.com
 To unsubscribe from this group, send email to
 sage-support+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/sage-support
 URL: http://www.sagemath.org


I don't get any error when I execute the above line with sage-4.6.2 on
debian.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Segfault while creating finite field homomorphism

2011-05-27 Thread Jean-Pierre Flori
On my computer I get a segfault just doing :
--
| Sage Version 4.7.rc1, Release Date: 2011-04-30 |
| Type notebook() for the GUI, and license() for information.|
--
**
**
* Warning: this is a prerelease version, and it may be unstable. *
**
**
sage: K = GF(116,'a'); L = GF(132,'b')
sage: K.Hom(L)[0]
Finite Field in a of size 2^16
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libcsage.so(print_backtrace
+0x31)[0x7f86df446df2]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libcsage.so(sigdie+0x14)
[0x7f86df446e24]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/
libcsage.so(sage_signal_handler+0x1d3)[0x7f86df446a39]
/lib/libpthread.so.0(+0xef60)[0x7f86e48b2f60]
/lib/libc.so.6(gsignal+0x35)[0x7f86e3eeb165]
/lib/libc.so.6(abort+0x180)[0x7f86e3eedf70]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libcsage.so(init_csage+0x0)
[0x7f86df4478ac]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libntl.so(_ZN3NTL5ErrorEPKc
+0x1f)[0x7f86dec3d35f]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/
libntl.so(_ZN3NTL5buildERNS_12GF2XArgumentERKNS_4GF2XERKNS_11GF2XModulusEl
+0xb4)[0x7f86deb66b74]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/
libntl.so(_ZN3NTL13ProjectPowersERNS_4GF2XERKS0_lS3_RKNS_11GF2XModulusE
+0xab)[0x7f86deb677ab]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/
libntl.so(_ZN3NTL12DoMinPolyModERNS_4GF2XERKS0_RKNS_11GF2XModulusElS3_
+0x37)[0x7f86deb68117]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/
libntl.so(_ZN3NTL12IrredPolyModERNS_4GF2XERKS0_RKNS_11GF2XModulusEl
+0x53)[0x7f86deb685f3]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/python2.6/site-packages/
sage/rings/finite_rings/element_ntl_gf2e.so(+0xe7f3)[0x7f86ca3897f3]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyObject_Call+0x53)[0x7f86e4b0acf3]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/python2.6/site-packages/
sage/rings/finite_rings/element_ntl_gf2e.so(+0xf706)[0x7f86ca38a706]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyObject_Call+0x53)[0x7f86e4b0acf3]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/python2.6/site-packages/
sage/rings/finite_rings/finite_field_base.so(+0xdbbd)[0x7f86cffc5bbd]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyObject_Call+0x53)[0x7f86e4b0acf3]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/python2.6/site-packages/
sage/rings/morphism.so(+0xf09f)[0x7f86d597609f]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(+0xa10b8)[0x7f86e4b610b8]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyObject_Call+0x53)[0x7f86e4b0acf3]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyEval_EvalFrameEx+0x3a79)[0x7f86e4ba16a9]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyEval_EvalCodeEx+0x879)[0x7f86e4ba4839]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(+0x70c12)[0x7f86e4b30c12]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyObject_Call+0x53)[0x7f86e4b0acf3]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(+0x5794f)[0x7f86e4b1794f]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyObject_Call+0x53)[0x7f86e4b0acf3]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(+0xa54ec)[0x7f86e4b654ec]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyObject_Call+0x53)[0x7f86e4b0acf3]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyEval_CallObjectWithKeywords+0x47)[0x7f86e4b9d637]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/python2.6/site-packages/
sage/structure/parent.so(+0x13e60)[0x7f86dbf36e60]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyObject_Call+0x53)[0x7f86e4b0acf3]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyEval_CallObjectWithKeywords+0x47)[0x7f86e4b9d637]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(+0x6069a)[0x7f86e4b2069a]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyObject_Call+0x53)[0x7f86e4b0acf3]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/python2.6/site-packages/
sage/structure/parent_gens.so(+0x7753)[0x7f86d9273753]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyEval_EvalFrameEx+0x4ef5)[0x7f86e4ba2b25]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyEval_EvalFrameEx+0x5a8a)[0x7f86e4ba36ba]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyEval_EvalCodeEx+0x879)[0x7f86e4ba4839]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(+0x70b26)[0x7f86e4b30b26]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.

[sage-support] Segfault while inverting q-adic number with fixed modulus precision

2011-05-27 Thread Jean-Pierre Flori
sage: R.t = Zq(8,2,'fixed-mod')
sage: 1/t
(t^2 + 1) + (t^2 + 1)*2 + O(2^2)
sage: 1/(t+t^2)
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libcsage.so(print_backtrace
+0x31)[0x7f3d2a9afdf2]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libcsage.so(sigdie+0x14)
[0x7f3d2a9afe24]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/
libcsage.so(sage_signal_handler+0x1d3)[0x7f3d2a9afa39]
/lib/libpthread.so.0(+0xef60)[0x7f3d2fe1bf60]
/lib/libc.so.6(gsignal+0x35)[0x7f3d2f454165]
/lib/libc.so.6(abort+0x180)[0x7f3d2f456f70]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libcsage.so(init_csage+0x0)
[0x7f3d2a9b08ac]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libntl.so(_ZN3NTL5ErrorEPKc
+0x1f)[0x7f3d2a1a635f]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/
libntl.so(_ZN3NTL11PlainDivRemERNS_5ZZ_pXES1_RKS0_S3_RNS_5ZZVecE+0x33b)
[0x7f3d2a1320db]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/
libntl.so(_ZN3NTL11IterHalfGCDERNS_11ZZ_pXMatrixERNS_5ZZ_pXES3_l+0x156)
[0x7f3d2a13c7e6]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/
libntl.so(_ZN3NTL8XHalfGCDERNS_11ZZ_pXMatrixERNS_5ZZ_pXES3_l+0x3a1)
[0x7f3d2a13d171]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/
libntl.so(_ZN3NTL4XGCDERNS_5ZZ_pXES1_S1_RKS0_S3_+0x11d)
[0x7f3d2a13d69d]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/
libntl.so(_ZN3NTL6InvModERNS_5ZZ_pXERKS0_S3_+0x75)[0x7f3d2a133055]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/
libntl.so(_ZN3NTL8PowerModERNS_5ZZ_pXERKS0_RKNS_2ZZERKNS_12ZZ_pXModulusE
+0x1f7)[0x7f3d2a138797]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/python2.6/site-packages/
sage/rings/padics/padic_ZZ_pX_FM_element.so(+0x87ed)[0x7f3d1711f7ed]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/python2.6/site-packages/
sage/structure/element.so(+0x39489)[0x7f3d26e20489]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(+0x461af)[0x7f3d3006f1af]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyNumber_Divide+0x1e)[0x7f3d300714ee]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/python2.6/lib-dynload/
operator.so(+0x56cd)[0x7f3d2ea0a6cd]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyObject_Call+0x53)[0x7f3d30073cf3]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyEval_CallObjectWithKeywords+0x47)[0x7f3d30106637]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/python2.6/site-packages/
sage/structure/coerce.so(+0x17a51)[0x7f3d26bc2a51]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/python2.6/site-packages/
sage/structure/element.so(+0x3959f)[0x7f3d26e2059f]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(+0x461af)[0x7f3d3006f1af]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyNumber_Divide+0x1e)[0x7f3d300714ee]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyEval_EvalFrameEx+0x29c0)[0x7f3d301095f0]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyEval_EvalCodeEx+0x879)[0x7f3d3010d839]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyEval_EvalCode+0x32)[0x7f3d3010d932]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyEval_EvalFrameEx+0x4ccb)[0x7f3d3010b8fb]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyEval_EvalCodeEx+0x879)[0x7f3d3010d839]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyEval_EvalFrameEx+0x5364)[0x7f3d3010bf94]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyEval_EvalCodeEx+0x879)[0x7f3d3010d839]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyEval_EvalFrameEx+0x5364)[0x7f3d3010bf94]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyEval_EvalFrameEx+0x5a8a)[0x7f3d3010c6ba]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyEval_EvalCodeEx+0x879)[0x7f3d3010d839]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyEval_EvalFrameEx+0x5364)[0x7f3d3010bf94]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyEval_EvalCodeEx+0x879)[0x7f3d3010d839]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyEval_EvalFrameEx+0x5364)[0x7f3d3010bf94]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyEval_EvalCodeEx+0x879)[0x7f3d3010d839]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyEval_EvalFrameEx+0x5364)[0x7f3d3010bf94]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyEval_EvalCodeEx+0x879)[0x7f3d3010d839]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyEval_EvalCode+0x32)[0x7f3d3010d932]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyRun_FileExFlags+0xb0)[0x7f3d3012fd10]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.
1.0(PyRun_SimpleFileExFlags+0xdf)[0x7f3d3013074f]
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/libpython2.6.so.1.0(Py_Main
+0xb23)[0x7f3d3013da03]
/lib/libc.so.6(__libc_start_main+0xfd)[0x7f3d2f440c4d]
python[0x4006a1]


Unhandled SIGABRT: An abort() occurred in Sage.
This 

[sage-support] Re: Segfault while creating finite field homomorphism

2011-05-27 Thread Simon King
Hi Jean-Pierre,

On 27 Mai, 14:08, Jean-Pierre Flori jpfl...@gmail.com wrote:

 I'm using sage 4.7.rc1 on debian amd64, gcc 4.6.
 Can anybody reproduce that behavior, so we should open a trac ticket ?
 I could not find anything similar here or on trac.
 I'll continue investigating it anyway.

I confirm the error with 4.7.rc2. So, it should be a ticket, IMO. Can
you open it?

Would people mind to make it a blocker? Segfaults are evil...

Cheers,
Simon

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Segfault while creating finite field homomorphism

2011-05-27 Thread Jean-Pierre Flori
I'll take care of it with a fix hopefully.
The value 16 is of course related to FF implementation.
From 16 it uses NTL and GF2X.
There's something nasty occuring in charpoly() or deeper.

On 27 mai, 14:27, Simon King simon.k...@uni-jena.de wrote:
 Hi Jean-Pierre,

 On 27 Mai, 14:08, Jean-Pierre Flori jpfl...@gmail.com wrote:

  I'm using sage 4.7.rc1 on debian amd64, gcc 4.6.
  Can anybody reproduce that behavior, so we should open a trac ticket ?
  I could not find anything similar here or on trac.
  I'll continue investigating it anyway.

 I confirm the error with 4.7.rc2. So, it should be a ticket, IMO. Can
 you open it?

 Would people mind to make it a blocker? Segfaults are evil...

 Cheers,
 Simon

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Segfault while creating finite field homomorphism

2011-05-27 Thread Simon King
Hi Jean-Pierre,

On 27 Mai, 14:31, Jean-Pierre Flori jpfl...@gmail.com wrote:
 I'll take care of it with a fix hopefully.

It turns out that the error occurs in the list() method of a homset,
which starts with

sage: K = GF(116,'a'); L = GF(132,'b')
sage: self = K.Hom(L)
sage: D = self.domain()
sage: C = self.codomain()
sage: f = D.modulus()
sage: g = C['x'](f)
sage: r = g.roots()

Now, the following works:
sage: for a,_ in r:
: print a
: t = D.hom(a,C)
:

But this segfaults!!
sage: for a,_ in r:
: t = D.hom(a,C)
:

In other words, printing the elements `a` seems to initialise some
data, and without printing them data are missing, resulting in a
segfault. Or put differently, the initialisation of finite field
elements is incomplete.

By the way, the elements `a` have a custom __repr__ method - shouldn't
it be _repr_ with a single underscore?

Cheers,
Simon

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Segfault while creating finite field homomorphism

2011-05-27 Thread Jean-Pierre Flori
Putting sig_on/sig_off around:
sig_on()
cdef GF2X_c r = GF2X_IrredPolyMod(GF2E_rep(self.x),
GF2E_modulus())
sig_off()
I get:
/home/jp/boulot/sage/sage-4.7.rc1/local/lib/python2.6/site-packages/
sage/rings/finite_rings/element_ntl_gf2e.so in
sage.rings.finite_rings.element_ntl_gf2e.FiniteField_ntl_gf2eElement.minpoly
(sage/rings/finite_rings/element_ntl_gf2e.cpp:11156)()

RuntimeError: build GF2XArgument: bad args

What is also strange is that it only happens for the second element...

On 27 mai, 14:49, Simon King simon.k...@uni-jena.de wrote:
 Hi Jean-Pierre,

 On 27 Mai, 14:31, Jean-Pierre Flori jpfl...@gmail.com wrote:

  I'll take care of it with a fix hopefully.

 It turns out that the error occurs in the list() method of a homset,
 which starts with

 sage: K = GF(116,'a'); L = GF(132,'b')
 sage: self = K.Hom(L)
 sage: D = self.domain()
 sage: C = self.codomain()
 sage: f = D.modulus()
 sage: g = C['x'](f)
 sage: r = g.roots()

 Now, the following works:
 sage: for a,_ in r:
 :     print a
 :     t = D.hom(a,C)
 :

 But this segfaults!!
 sage: for a,_ in r:
 :     t = D.hom(a,C)
 :

 In other words, printing the elements `a` seems to initialise some
 data, and without printing them data are missing, resulting in a
 segfault. Or put differently, the initialisation of finite field
 elements is incomplete.

 By the way, the elements `a` have a custom __repr__ method - shouldn't
 it be _repr_ with a single underscore?

 Cheers,
 Simon

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Segfault while creating finite field homomorphism

2011-05-27 Thread Jean-Pierre Flori
Adding

(FiniteField_ntl_gf2eself._parent).F.restore()
before calling
cdef GF2X_c r = GF2X_IrredPolyMod(GF2E_rep(self.x),GF2E_modulus())
fixes everything.
Not sure yet why it does not get called before in that situation...

On 27 mai, 15:03, Jean-Pierre Flori jpfl...@gmail.com wrote:
 Putting sig_on/sig_off around:
         sig_on()
         cdef GF2X_c r = GF2X_IrredPolyMod(GF2E_rep(self.x),
 GF2E_modulus())
         sig_off()
 I get:
 /home/jp/boulot/sage/sage-4.7.rc1/local/lib/python2.6/site-packages/
 sage/rings/finite_rings/element_ntl_gf2e.so in
 sage.rings.finite_rings.element_ntl_gf2e.FiniteField_ntl_gf2eElement.minpoly
 (sage/rings/finite_rings/element_ntl_gf2e.cpp:11156)()

 RuntimeError: build GF2XArgument: bad args

 What is also strange is that it only happens for the second element...

 On 27 mai, 14:49, Simon King simon.k...@uni-jena.de wrote:







  Hi Jean-Pierre,

  On 27 Mai, 14:31, Jean-Pierre Flori jpfl...@gmail.com wrote:

   I'll take care of it with a fix hopefully.

  It turns out that the error occurs in the list() method of a homset,
  which starts with

  sage: K = GF(116,'a'); L = GF(132,'b')
  sage: self = K.Hom(L)
  sage: D = self.domain()
  sage: C = self.codomain()
  sage: f = D.modulus()
  sage: g = C['x'](f)
  sage: r = g.roots()

  Now, the following works:
  sage: for a,_ in r:
  :     print a
  :     t = D.hom(a,C)
  :

  But this segfaults!!
  sage: for a,_ in r:
  :     t = D.hom(a,C)
  :

  In other words, printing the elements `a` seems to initialise some
  data, and without printing them data are missing, resulting in a
  segfault. Or put differently, the initialisation of finite field
  elements is incomplete.

  By the way, the elements `a` have a custom __repr__ method - shouldn't
  it be _repr_ with a single underscore?

  Cheers,
  Simon

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Segfault while creating finite field homomorphism

2011-05-27 Thread Jean-Pierre Flori
I must admit that I do not know what that method call exactly does,
but calling it resolve the mentionned bug.
Moreover it is called in different places all over the file in a
similar manner so I have the feeling that it could be an acceptable
fix.
I'll open a trac ticket with that fix and a doctest hoping that
someone with a better understanding of ntl and gf2x will confirm that
it is ok or provide a correct fix.

Cheers,

On 27 mai, 15:22, Jean-Pierre Flori jpfl...@gmail.com wrote:
 Adding

         (FiniteField_ntl_gf2eself._parent).F.restore()
 before calling
 cdef GF2X_c r = GF2X_IrredPolyMod(GF2E_rep(self.x),GF2E_modulus())
 fixes everything.
 Not sure yet why it does not get called before in that situation...

 On 27 mai, 15:03, Jean-Pierre Flori jpfl...@gmail.com wrote:







  Putting sig_on/sig_off around:
          sig_on()
          cdef GF2X_c r = GF2X_IrredPolyMod(GF2E_rep(self.x),
  GF2E_modulus())
          sig_off()
  I get:
  /home/jp/boulot/sage/sage-4.7.rc1/local/lib/python2.6/site-packages/
  sage/rings/finite_rings/element_ntl_gf2e.so in
  sage.rings.finite_rings.element_ntl_gf2e.FiniteField_ntl_gf2eElement.minpoly
  (sage/rings/finite_rings/element_ntl_gf2e.cpp:11156)()

  RuntimeError: build GF2XArgument: bad args

  What is also strange is that it only happens for the second element...

  On 27 mai, 14:49, Simon King simon.k...@uni-jena.de wrote:

   Hi Jean-Pierre,

   On 27 Mai, 14:31, Jean-Pierre Flori jpfl...@gmail.com wrote:

I'll take care of it with a fix hopefully.

   It turns out that the error occurs in the list() method of a homset,
   which starts with

   sage: K = GF(116,'a'); L = GF(132,'b')
   sage: self = K.Hom(L)
   sage: D = self.domain()
   sage: C = self.codomain()
   sage: f = D.modulus()
   sage: g = C['x'](f)
   sage: r = g.roots()

   Now, the following works:
   sage: for a,_ in r:
   :     print a
   :     t = D.hom(a,C)
   :

   But this segfaults!!
   sage: for a,_ in r:
   :     t = D.hom(a,C)
   :

   In other words, printing the elements `a` seems to initialise some
   data, and without printing them data are missing, resulting in a
   segfault. Or put differently, the initialisation of finite field
   elements is incomplete.

   By the way, the elements `a` have a custom __repr__ method - shouldn't
   it be _repr_ with a single underscore?

   Cheers,
   Simon

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Segfault while creating finite field homomorphism

2011-05-27 Thread Jean-Pierre Flori
This is now Trac #11390.

On 27 mai, 15:41, Jean-Pierre Flori jpfl...@gmail.com wrote:
 I must admit that I do not know what that method call exactly does,
 but calling it resolve the mentionned bug.
 Moreover it is called in different places all over the file in a
 similar manner so I have the feeling that it could be an acceptable
 fix.
 I'll open a trac ticket with that fix and a doctest hoping that
 someone with a better understanding of ntl and gf2x will confirm that
 it is ok or provide a correct fix.

 Cheers,

 On 27 mai, 15:22, Jean-Pierre Flori jpfl...@gmail.com wrote:







  Adding

          (FiniteField_ntl_gf2eself._parent).F.restore()
  before calling
  cdef GF2X_c r = GF2X_IrredPolyMod(GF2E_rep(self.x),GF2E_modulus())
  fixes everything.
  Not sure yet why it does not get called before in that situation...

  On 27 mai, 15:03, Jean-Pierre Flori jpfl...@gmail.com wrote:

   Putting sig_on/sig_off around:
           sig_on()
           cdef GF2X_c r = GF2X_IrredPolyMod(GF2E_rep(self.x),
   GF2E_modulus())
           sig_off()
   I get:
   /home/jp/boulot/sage/sage-4.7.rc1/local/lib/python2.6/site-packages/
   sage/rings/finite_rings/element_ntl_gf2e.so in
   sage.rings.finite_rings.element_ntl_gf2e.FiniteField_ntl_gf2eElement.minpoly
   (sage/rings/finite_rings/element_ntl_gf2e.cpp:11156)()

   RuntimeError: build GF2XArgument: bad args

   What is also strange is that it only happens for the second element...

   On 27 mai, 14:49, Simon King simon.k...@uni-jena.de wrote:

Hi Jean-Pierre,

On 27 Mai, 14:31, Jean-Pierre Flori jpfl...@gmail.com wrote:

 I'll take care of it with a fix hopefully.

It turns out that the error occurs in the list() method of a homset,
which starts with

sage: K = GF(116,'a'); L = GF(132,'b')
sage: self = K.Hom(L)
sage: D = self.domain()
sage: C = self.codomain()
sage: f = D.modulus()
sage: g = C['x'](f)
sage: r = g.roots()

Now, the following works:
sage: for a,_ in r:
:     print a
:     t = D.hom(a,C)
:

But this segfaults!!
sage: for a,_ in r:
:     t = D.hom(a,C)
:

In other words, printing the elements `a` seems to initialise some
data, and without printing them data are missing, resulting in a
segfault. Or put differently, the initialisation of finite field
elements is incomplete.

By the way, the elements `a` have a custom __repr__ method - shouldn't
it be _repr_ with a single underscore?

Cheers,
Simon

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: error installing Kash

2011-05-27 Thread John H Palmieri


On Thursday, May 26, 2011 9:47:19 PM UTC-7, John H Palmieri wrote:

 On Thursday, May 26, 2011 5:41:24 PM UTC-7, jtyard wrote:

 Hi, 

 I'm having trouble installing the optional kash package with 
 sage-4.7.  I'm using a recent issue macbook pro running 10.6.7.  Any 
 help would be appreciated.  


 It certainly looks like that spkg is broken.  In fact, this was reported as 
 a bug almost a year ago, but no one has fixed it.  See 
 http://trac.sagemath.org/sage_trac/ticket/9333.  I'll try to post a link 
 to a new spkg soon.  


I've posted a link to a new spkg on that ticket, if you want to download it 
and try it out.

-- 
John
 

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Problem with Solve

2011-05-27 Thread rpoirier
I want to solve a relativity problem using SOLVE.
I used to be able to, but now I run into a problem.

lp=60e9*1000
dtp=1.25*24*3600
beta=var('beta')
gamma=1/(sqrt(1-beta^2))
solve(dtp*gamma==lp/(beta*c),beta)

the result I expect is a numerical value, but I get the following:
[beta == 733841/396000*sqrt(-beta^2 + 1)]


I am using Sage Version 4.6, Release Date: 2010-10-30 on Mac.
perhaps I am not aware of a change made to solve since previous
releases?

Thanks in advance for any help on this...

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] How set up new accounts in a Python script? (instead of the notebook web form?)

2011-05-27 Thread Chris Seberino
How set up new accounts in a Python script?  (instead of the notebook
web form?)

I would like to automate this process if possible.

Thanks!

cs

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] How set up new accounts in a Python script? (instead of the notebook web form?)

2011-05-27 Thread Berkin Malkoc
On Fri, May 27, 2011 at 11:01 PM, Chris Seberino cseber...@gmail.comwrote:

 How set up new accounts in a Python script?  (instead of the notebook
 web form?)

 I would like to automate this process if possible.http://www.sagemath.org


It is in the reference:
http://www.sagemath.org/doc/reference/sagenb/notebook/notebook.html

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: output cell in notebook is to little (vertically) for typeset output

2011-05-27 Thread andres.ordonez
Thanks for the reply. The problem is not that the output is too large
horizontally, like too long, the problem is that it is too large
vertically, like too tall. However your recommendations are very
interesting, I've tested the breqn in my system and it works well,
I'll install texmacs to check it out too.

I should have used this feature (publish notebook) before, anyway look
at it to see what I mean.
http://localhost:8000/home/pub/0


On May 18, 5:36 am, Dmitry Shkirmanov piminusme...@bk.ru wrote:
  Hi, the output cell I get is too little (vertically) for the size of
  the output and I can't see it completely. This happens sometimes when
  the output is long and only when I ask for the typeset version of the
  output.

 Hello, as far as i know Sage can not divide output into lines.
 You can use latex's package breqn for it (see for 
 examplehttp://demo.sagenb.org/home/pub/121/ )
 But sometimes it does not work well 
 (seehttp://groups.google.com/group/sage-devel/browse_thread/thread/31d615...{}#f7c2e74744fd1797
 )
 Alternatively, you can use texmacs plugin 
 (http://www.sagemath.org:9001/TeXmacs
 ) This plugin used to work for me on debian lenny, but it does not
 work on debian squeeze. (different wersions of texmacs). So you need
 to install old version of texmacs.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: How set up new accounts in a Python script? (instead of the notebook web form?)

2011-05-27 Thread Chris Seberino
On May 27, 3:34 pm, Berkin Malkoc malk...@gmail.com wrote:
 It is in the 
 reference:http://www.sagemath.org/doc/reference/sagenb/notebook/notebook.html

Thank you.  Those docs appear to be for a Sage session.

I actually need it to work from a Django web application unrelated to
Sage!?!?

In other words, my question pertains to a Python script instead of a
Sage session!

Is this possible?

Chris

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: How set up new accounts in a Python script? (instead of the notebook web form?)

2011-05-27 Thread Robert Bradshaw
On Fri, May 27, 2011 at 3:35 PM, Chris Seberino cseber...@gmail.com wrote:
 On May 27, 3:34 pm, Berkin Malkoc malk...@gmail.com wrote:
 It is in the 
 reference:http://www.sagemath.org/doc/reference/sagenb/notebook/notebook.html

 Thank you.  Those docs appear to be for a Sage session.

 I actually need it to work from a Django web application unrelated to
 Sage!?!?

 In other words, my question pertains to a Python script instead of a
 Sage session!

 Is this possible?


A sage script is just a pre-parsed python script. The majority of the
pre-parsing is math-specific so it would probably work as is (once
you've imported the used functions from sage.all).

- Robert

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: error installing Kash

2011-05-27 Thread jtyard
Thanks John.  It works!  Is there a reason that nobody seemed to care
that this wasn't fixed for a long time?  Does Magma just work that
much better that everyone is willing to shell out the money for
computing with large Galois groups?


On May 27, 9:19 am, John H Palmieri jhpalmier...@gmail.com wrote:
 On Thursday, May 26, 2011 9:47:19 PM UTC-7, John H Palmieri wrote:

  On Thursday, May 26, 2011 5:41:24 PM UTC-7, jtyard wrote:

  Hi,

  I'm having trouble installing the optional kash package with
  sage-4.7.  I'm using a recent issue macbook pro running 10.6.7.  Any
  help would be appreciated.  

  It certainly looks like that spkg is broken.  In fact, this was reported as
  a bug almost a year ago, but no one has fixed it.  See 
 http://trac.sagemath.org/sage_trac/ticket/9333.  I'll try to post a link
  to a new spkg soon.  

 I've posted a link to a new spkg on that ticket, if you want to download it
 and try it out.

 --
 John

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org