[sage-support] Links between worksheets

2008-09-24 Thread Maike

Hi all,

I can have a link on one worksheet to another worksheet (e.g.
http://localhost:8000/home/user/12/), but this includes the number
that sage internally gives that worksheet (here: 12). Now if I upload
these worksheets to another server, they are assigned different
numbers and the links don't work properly anymore. Is there a any
other way of linking in a more stable way, e.g. using the title of a
worksheet? Also, can I have a link that goes to a certain place within
a worksheet?

Cheers,
Maike
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Secure Sage Server

2008-09-24 Thread Maike

We'd like to set up a sage server allowing different users to see,
copy and edit our published worksheets. However, this allows users to
execute arbitrary system calls, e.g.
 os.popen(ps auxw).read()
The formatting of the output is not perfect, but still, this is a
problem!

I'd be grateful for any suggestions on how to set up a SECURE sage
server. If this has been covered elsewhere, just post the link...
Thanks!

Maike
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Secure Sage Server

2008-09-24 Thread mabshoff

On Sep 24, 12:22 am, Maike [EMAIL PROTECTED] wrote:

Hi Maike,

 We'd like to set up a sage server allowing different users to see,
 copy and edit our published worksheets. However, this allows users to
 execute arbitrary system calls, e.g. os.popen(ps auxw).read()

Yes, any account on a Notebook server hands the user a shell, so you
either trust them or you secure the server itself.

 The formatting of the output is not perfect, but still, this is a
 problem!

 I'd be grateful for any suggestions on how to set up a SECURE sage
 server. If this has been covered elsewhere, just post the link...

There are a couple possibilities:

 a) a chroot jail
 b) a VMWare image (or some other kind of virtualization)
 c) SELinux, potentially in combination with (a)

None of the above is simple and securing a server so that it runs with
SELinux is difficult. There is no documentation on how to do this yet.
I would favor (b), frequent backups of the Sage notebook data and some
intrusion detection system in the notebook in addition to keeping
kernel and all the other components current to avoid break ins. Since
you are running a VMware image it is easily resettable and the
likelyhood of breaking out of the VMWare image is relatively small. So
should you have somebody break into your box it is much easier to
reset an image than the server. If you come up with something we would
definitely like to hear about it.

 Thanks!

 Maike

Cheers,

Michael
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Numerical evaluate of the Dirichlet character value

2008-09-24 Thread Raouf

Hi,
I want to have a numerical value of a  Dirichlet character :

I have this line code in my notebook:

sage:
G = DirichletGroup(21)
chi = G.1;
chi(23)

evaluate:
zeta6 - 1

And when i want to use this value: zeta6 - 1 i have the error message:

G = DirichletGroup(21)
chi = G.1;
chi(23)
B=13*chi(23)
print float(B)

error message:

Traceback (most recent call last):
  File stdin, line 1, in module
  File /home/server2/nb1/sage_notebook/worksheets/fstthese/0/code/
6.py, line 10, in module
print float(B)
  File /home/server2/sage/local/lib/python2.5/site-packages/
SQLAlchemy-0.4.6-py2.5.egg/, line 1, in module

TypeError: float() argument must be a string or a number.



--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Numerical evaluate of the Dirichlet character value

2008-09-24 Thread mabshoff



On Sep 24, 4:15 am, Raouf [EMAIL PROTECTED] wrote:
 Hi,
 I want to have a numerical value of a  Dirichlet character :

 I have this line code in my notebook:

 sage:
 G = DirichletGroup(21)
 chi = G.1;
 chi(23)

 evaluate:
 zeta6 - 1

 And when i want to use this value: zeta6 - 1 i have the error message:

 G = DirichletGroup(21)
 chi = G.1;
 chi(23)
 B=13*chi(23)
 print float(B)

 error message:

 Traceback (most recent call last):
   File stdin, line 1, in module
   File /home/server2/nb1/sage_notebook/worksheets/fstthese/0/code/
 6.py, line 10, in module
     print float(B)
   File /home/server2/sage/local/lib/python2.5/site-packages/
 SQLAlchemy-0.4.6-py2.5.egg/, line 1, in module

 TypeError: float() argument must be a string or a number.

Looks like a bug to me. The usual trick (at least in my book of using
n() does also not work):

[EMAIL PROTECTED]:/scratch/mabshoff/release-cycle/sage-3.1.3.alpha1$ ./
sage
--
| SAGE Version 3.1.3.alpha1, Release Date: 2008-09-24|
| Type notebook() for the GUI, and license() for information.|
--

sage: G = DirichletGroup(21)
sage: chi = G.1;
sage: chi(23)
zeta6 - 1
sage: B=13*chi(23)
sage: print float(B)
---
TypeError Traceback (most recent call
last)

/scratch/mabshoff/release-cycle/sage-3.1.3.alpha1/ipython console in
module()

TypeError: float() argument must be a string or a number
sage: type(B)
type
'sage.rings.number_field.number_field_element_quadratic.NumberFieldElement_quadratic'
sage: n(B)
---
TypeError Traceback (most recent call
last)

/scratch/mabshoff/release-cycle/sage-3.1.3.alpha1/ipython console in
module()

/scratch/mabshoff/release-cycle/sage-3.1.3.alpha1/local/lib/python/
site-packages/sage/misc/functional.py in numerical_approx(x, prec,
digits)
716 return
sage.rings.real_mpfr.RealField_constructor(prec)(x)
717 except TypeError:
-- 718 return sage.rings.complex_field.ComplexField(prec)
(x)
719
720 n = numerical_approx

/scratch/mabshoff/release-cycle/sage-3.1.3.alpha1/local/lib/python2.5/
site-packages/sage/rings/complex_field.py in __call__(self, x, im)
212 except AttributeError:
213 pass
-- 214 return complex_number.ComplexNumber(self, x, im)
215
216 def _coerce_impl(self, x):

/scratch/mabshoff/release-cycle/sage-3.1.3.alpha1/complex_number.pyx
in sage.rings.complex_number.ComplexNumber.__init__ (sage/rings/
complex_number.c:2519)()

TypeError: unable to coerce to a ComplexNumber
sage:


Can someone more knowledgeable in the area open a ticket?

Cheers,

Michael
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Numerical evaluate of the Dirichlet character value

2008-09-24 Thread John Cremona

This works:


sage: emb = B.parent().complex_embeddings()[0]
sage: emb(B)
-6.5 + 11.2583302492*I

B is an element of a number field:
sage: B.parent()
Cyclotomic Field of order 6 and degree 2

and number fields have several embeddings into CC (in this case, 2):
sage: len( B.parent().complex_embeddings())
2

You have complete control over precision:
sage: emb = B.parent().complex_embeddings(prec=200)[0]
sage: emb(B)
-6.50 +
11.258330249197702407928401219788170385128234149767474082363*I

John Cremona

2008/9/24 Raouf [EMAIL PROTECTED]:

 Hi,
 I want to have a numerical value of a  Dirichlet character :

 I have this line code in my notebook:

 sage:
 G = DirichletGroup(21)
 chi = G.1;
 chi(23)

 evaluate:
 zeta6 - 1

 And when i want to use this value: zeta6 - 1 i have the error message:

 G = DirichletGroup(21)
 chi = G.1;
 chi(23)
 B=13*chi(23)
 print float(B)

 error message:

 Traceback (most recent call last):
  File stdin, line 1, in module
  File /home/server2/nb1/sage_notebook/worksheets/fstthese/0/code/
 6.py, line 10, in module
print float(B)
  File /home/server2/sage/local/lib/python2.5/site-packages/
 SQLAlchemy-0.4.6-py2.5.egg/, line 1, in module

 TypeError: float() argument must be a string or a number.



 


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Sage runs amok when killing a sub process

2008-09-24 Thread mabshoff



On Sep 24, 5:18 am, Simon King [EMAIL PROTECTED] wrote:
 Dear Team,

Hi Simon,

 on a linux machine with 4 Dual Core AMD Opteron(tm) Processor 270, I
 had some computations with Sage 3.1.1.

 One of them had a very long Singular sub process, and eventually I
 killed the sub process.

 By consequence, a massive amount (more than 20) of new Python
 processes popped up (see below for a small part of what top shows).

I don't see why 20 of those python jobs would pop up. Can you
reproduce it?

 Fortunately the other Sage processes on that machine have not been
 affected. Nonetheless, I wonder if this is a bug.

The output from top as is is useless since there is no information to
gain. One would at least need PPID and the command line option used to
start the python jobs. It looks like you are ending up with something
that could turn into a zombie, but since it is unclear what exactly
you did this is undebuggable as is.

 Cheers
       Simon


Cheers,

Michael
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: operations with matrices

2008-09-24 Thread aniura

Hi,

well, I have now two different alternatives to be tested: a list of
matrices or a numpy array. since I am programming with scripts, I
should verify which of them works better in that case.

thanks for your suggestions!!

Aniura


On Sep 23, 12:29 pm, John Cremona [EMAIL PROTECTED] wrote:
 2008/9/23 Simon King [EMAIL PROTECTED]:



  On Sep 23, 3:31 pm, John Cremona [EMAIL PROTECTED] wrote:
  The rest of your query is hard to interpret.  To create a list of
  equal elements, say a list of 5 copies of the matrix m, do this:
  sage: [m]*5

  But this would not create a list of 5 *copies* of m. The five entries
  of that list are one and the same object, namely m:

 Excellent point, thanks for correcting me!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Sage runs amok when killing a sub process

2008-09-24 Thread Simon King

Dear Michael,

On Sep 24, 2:25 pm, mabshoff [EMAIL PROTECTED]
dortmund.de wrote:
 I don't see why 20 of those python jobs would pop up. Can you
 reproduce it?

I used nohup, and stdout was written into some file.
And I just found one detail in the log file that may help to track it
down.

It says (with my comments after #)
Singular crashed executing def sage43815=is_fregs(sage43812,COHO1I); #
one of my Singular functions
Singular data for 625gp7 are being deleted  # This message comes from
a __del__ method of my objects - see below
Singular crashed -- automatically restarting.
Singular crashed -- automatically restarting.
Singular crashed -- automatically restarting.
...

And I think this is the explanation:
- Singular crashes, so there is an error, and Sage tries to cleanly
exit.
- A clean exit means that all objects are deallocated.
- In my case, a __del__ method is called whose job it is to kill all
data (related to the object) that live in the Singular sub process.
- The sub process is dead, so a restart is attempted.

Hence, I think everything is fine on the side of Sage, but in my
__del__ method I should better test whether the Singular sub process
is still valid.

Cheers
  Simon

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Small Scale Variants of the AES (SR)

2008-09-24 Thread vpv

Thanks for the useful links, Martin. I downloaded and compiled the
source for Sage (3.1.2). I'll have a look at crypto/mq/sr.py and i'll
try to figure how to add my code there. If i have questions i'll ask.

Cheers,
vpv

On Sep 19, 6:48 pm, Martin Albrecht [EMAIL PROTECTED]
wrote:
    * I'd be very happy if you'd share your code! I would like to make sure
   that it fits into the current framework/is compatible and reuses the
   existing machinery. Are you doing that?

  I don't think so. What should I do to make my code to fit in the SAGE
  framework? Maybe there are some guidelines for developers? The only
  link i found was this onehttp://www.sagemath.org/development.html

 Hi there,

 at

 http://sage.math.washington.edu/home/mhansen/doc-sphinx/SageDeveloper...

 you'll find a prerelease of the new developer's guide. Some parts are not
 finished/polished but it should answer at least some questions. My main point
 however is that the implementation of this functionality should be in
 crypto/mq/sr.py (i.e. in the classes for SR) and re-use the methods provided
 there (for consistency). Let me know if you need help.

    * If we're going to support direct representation of ciphertext bits in
   plaintext and key variables we should also support GF(2^n) as base field
   not only GF(2), i.e. BES style equations. This will be slightly more
   involving.

  Anyway I was already thinking of developing a version of my code for
  GF(2^n), so I would gladly help with this.

 Excellent!

 Cheers,
 Martin

 --
 name: Martin Albrecht
 _pgp:http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x8EF0DC99
 _www:http://www.informatik.uni-bremen.de/~malb
 _jab: [EMAIL PROTECTED]
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] how to calculate the derivative of a boolean polynomial?

2008-09-24 Thread vpv

Is it possible to calculate the derivative of a boolean polynomial in
Sage using PolyBoRi?

I can do this for polynomials over GF(2):

sage: R.x,y,x = PolynomialRing(GF(2),3)
sage: f = 3*x^2*y + 2*x*y + y + 9*x^2 + 5*x - 3
sage: f
x^2*y + x^2 + x + y + 1
sage: f.derivative(x)
1
sage: f.derivative(y)
x^2 + 1

However I cannot do the same for boolean polynomials:

sage: B.x,y,z = BooleanPolynomialRing(3)
sage: f = 3*x^2*y + 2*x*y + y + 9*x^2 + 5*x - 3
sage: f
x*y + y + 1
sage: f.derivative(x)
AttributeError: 'sage.rings.polynomial.pbori.BooleanPolynomial' object
has no attribute '_derivative'
sage:

Maybe this is not implemented or maybe i am not doing sth. right?

Thanks for your help!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Secure Sage Server

2008-09-24 Thread Jason Grout

mabshoff wrote:
 On Sep 24, 12:22 am, Maike [EMAIL PROTECTED] wrote:
 
 Hi Maike,
 
 We'd like to set up a sage server allowing different users to see,
 copy and edit our published worksheets. However, this allows users to
 execute arbitrary system calls, e.g. os.popen(ps auxw).read()
 
 Yes, any account on a Notebook server hands the user a shell, so you
 either trust them or you secure the server itself.
 
 The formatting of the output is not perfect, but still, this is a
 problem!

 I'd be grateful for any suggestions on how to set up a SECURE sage
 server. If this has been covered elsewhere, just post the link...
 
 There are a couple possibilities:
 
  a) a chroot jail
  b) a VMWare image (or some other kind of virtualization)
  c) SELinux, potentially in combination with (a)
 
 None of the above is simple and securing a server so that it runs with
 SELinux is difficult. There is no documentation on how to do this yet.
 I would favor (b), frequent backups of the Sage notebook data and some
 intrusion detection system in the notebook in addition to keeping
 kernel and all the other components current to avoid break ins. Since
 you are running a VMware image it is easily resettable and the
 likelyhood of breaking out of the VMWare image is relatively small. So
 should you have somebody break into your box it is much easier to
 reset an image than the server. If you come up with something we would
 definitely like to hear about it.
 


In case virtualbox is your preference, I have almost finished a 
virtualbox image which tries to mirror the current vmware image too, but 
is based on ubuntu jeos and is a little more locked down (e.g., no 
default ssh server is running).

Thanks,

Jason


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] libsvm unser Sage

2008-09-24 Thread [EMAIL PROTECTED]

Hi,

I have a question about libsvm using under Sage. I have downloaded
libsvm (a Support Vector Machine classification library) which comes
with a python interface.

I did build the sources as follows :

[EMAIL PROTECTED]:~/actuel/recherche/libs/libsvm-2.86/python$ ll
total 208
-rw-r--r-- 1 jlandre jlandre   1140 2004-03-24 12:44
cross_validation.py
-rw-r--r-- 1 jlandre jlandre582 2007-10-14 08:29 Makefile
-rw-r--r-- 1 jlandre jlandre   5023 2008-02-19 00:09 README
-rw-r--r-- 1 jlandre jlandre   2731 2007-03-31 02:31 svmc.i
-rw-r--r-- 1 jlandre jlandre 169031 2007-03-31 02:31 svmc_wrap.c
-rw-r--r-- 1 jlandre jlandre   8140 2006-12-08 15:37 svm.py
-rwxr-xr-x 1 jlandre jlandre   2110 2006-07-28 02:09 svm_test.py
-rwxr-xr-x 1 jlandre jlandre630 2003-07-12 06:07
test_cross_validation.py
[EMAIL PROTECTED]:~/actuel/recherche/libs/libsvm-2.86/python$ make
PYTHON_INCLUDEDIR=/usr/local/sage/sage/local/include/python2.5 all
g++ -O3 -I/usr/local/sage/sage/local/include/python2.5 -I.. -fPIC -c
svmc_wrap.c
g++ -O3 -I/usr/local/sage/sage/local/include/python2.5 -I.. -fPIC -
c ../svm.cpp
g++ -shared -o svmc.so svmc_wrap.o svm.o
[EMAIL PROTECTED]:~/actuel/recherche/libs/libsvm-2.86/python$ ll
total 648
-rw-r--r-- 1 jlandre jlandre   1140 2004-03-24 12:44
cross_validation.py
-rw-r--r-- 1 jlandre jlandre582 2007-10-14 08:29 Makefile
-rw-r--r-- 1 jlandre jlandre   5023 2008-02-19 00:09 README
-rw-r--r-- 1 jlandre jlandre   2731 2007-03-31 02:31 svmc.i
-rwxr-xr-x 1 jlandre jlandre 160033 2008-09-24 17:30 svmc.so
-rw-r--r-- 1 jlandre jlandre 169031 2007-03-31 02:31 svmc_wrap.c
-rw-r--r-- 1 jlandre jlandre 180992 2008-09-24 17:30 svmc_wrap.o
-rw-r--r-- 1 jlandre jlandre  89912 2008-09-24 17:30 svm.o
-rw-r--r-- 1 jlandre jlandre   8140 2006-12-08 15:37 svm.py
-rwxr-xr-x 1 jlandre jlandre   2110 2006-07-28 02:09 svm_test.py
-rwxr-xr-x 1 jlandre jlandre630 2003-07-12 06:07
test_cross_validation.py

As you can see, I passed the path of the Sage python installation to
the Makefile and everything was OK.

I obtain a library file named svmc.so. My question is where do I
have to put it under the Sage directory in order to use it ?

Thanks in advance for your nice reply, have a nice day wherever you
are in the world...

Regards,

Jérôme Landré
University of Reims-Champagne-Ardenne
France

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Using Fourier transform in sage.

2008-09-24 Thread Sand Wraith

Thank you! :-)

 sage: v = vector(CDF,[1..10]); v
 (1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0)
 sage: w = v.fft(); w
 (55.0, -5.0 + 15.3884176859*I, -5.0 + 6.88190960236*I, -5.0 +
 3.63271264003*I, -5.0 + 1.62459848116*I, -5.0, -5.0 - 1.62459848116*I,
 -5.0 - 3.63271264003*I, -5.0 - 6.88190960236*I, -5.0 -
 15.3884176859*I)
 sage: w.inv_fft()
 (1.0 - 8.881784197e-17*I, 2.0 - 3.7437131288e-16*I, 3.0 +
 4.15667297272e-18*I, 4.0 + 4.46859877911e-16*I, 5.0 +
 4.33797144802e-16*I, 6.0 - 8.881784197e-17*I, 7.0 +
 4.61256576967e-17*I, 8.0 + 2.04083553579e-16*I, 9.0 -
 3.67679530233e-16*I, 10.0 - 2.15336379908e-16*I)

  Thanks.

 --
 William Stein
 Associate Professor of Mathematics
 University of Washingtonhttp://wstein.org
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: question about SAGE eigenvalues

2008-09-24 Thread Carl Witty

On Sep 23, 1:26 pm, Jason Grout [EMAIL PROTECTED] wrote:
 To me, it looks like it may be a bug:

 sage: A=matrix([[1,1],[2,3]])
 sage: e1,e2=A.eigenvalues()
 sage: e1.interval(ComplexIntervalField(53))
 0.2679491924311228?
 sage: b=e1.interval(ComplexIntervalField(53))
 sage: b
 0.2679491924311228?
 sage: b.str(style='brackets')
 '[0.26794919243112269 .. 0.26794919243112276]'

 The question mark notation indicates that this last interval (the real
 interval) should lie inside of

 [0.2679491924311227 .. 0.2679491924311229]

 But it doesn't seem to lie in that range.

 Carl, what do you think?

Yes, the above sure looks like a bug to me.

I'll try to look at it sometime this week (over the weekend, if not
sooner).

Carl

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: question about SAGE eigenvalues

2008-09-24 Thread Carl Witty

On Sep 23, 1:31 pm, Jason Grout [EMAIL PROTECTED] wrote:
  OK, it is a feature.  To quote from
 http://wiki.sagemath.org/sage-3.1.2(Release notes for 3.1.2):

  The question marks at the end of the numbers in the previous example
  mean that Sage is printing out an approximation of an exact value that
  it uses. In particular, the question mark means that the last digit
  can vary by plus or minus 1. In other words, 32.46424919657298? means
  that the exact number is really between 32.46424919657297 and
  32.46424919657299. Sage knows what the exact number is and uses the
  exact number in calculations.

 That last sentence is technically incorrect, I think (sorry; I wrote
 it).  It might be better to say, Sage carries out the calculations
 using interval arithmetic and essentially uses infinite precision in
 these cases.

 Carl, is there some way to word things better?

I think the sentence from the release notes is fine.  Elements of
QQbar are exact algebraic numbers; the fact that QQbar uses interval
arithmetic internally is an implementation detail that shouldn't
matter to the user.  (It would be nice if users of QQbar had no reason
to even know about the interval arithmetic used internally.  For the
sake of efficiency, though, I don't always print the best possible
approximation to a number, so the intervals are somewhat exposed to
the user when they print QQbar elements.)

Carl

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Can not delete worksheet.

2008-09-24 Thread Sand Wraith

Thank you )) now its OK

On Sep 21, 5:25 pm, Timothy Clemans [EMAIL PROTECTED]
wrote:
 Hi,

 This and other bugs have been fixed in the latest release, 3.1.2.

 Timothy

 On Sun, Sep 21, 2008 at 7:23 AM, Sand Wraith [EMAIL PROTECTED] wrote:

  Hi!

  Using sage:
  SAGE Version 3.1.1, Release Date: 2008-08-17

  and can not delete worksheet:

  1) select worksheet test
  2) press delete
  3) now i can see test worksheet in Trash,
  4) press sign out
  5) stop sage
  6) launch sage again
  7) and now i see test worksheet in active section again!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Numerical evaluate of the Dirichlet character value

2008-09-24 Thread Robert Bradshaw

On Sep 24, 2008, at 4:42 AM, John Cremona wrote:


 2008/9/24 mabshoff [EMAIL PROTECTED]:



 On Sep 24, 4:15 am, Raouf [EMAIL PROTECTED] wrote:
 Hi,
 I want to have a numerical value of a  Dirichlet character :

 I have this line code in my notebook:

 sage:
 G = DirichletGroup(21)
 chi = G.1;
 chi(23)

 evaluate:
 zeta6 - 1

 And when i want to use this value: zeta6 - 1 i have the error  
 message:

 G = DirichletGroup(21)
 chi = G.1;
 chi(23)
 B=13*chi(23)
 print float(B)

 error message:

 Traceback (most recent call last):
   File stdin, line 1, in module
   File /home/server2/nb1/sage_notebook/worksheets/fstthese/0/code/
 6.py, line 10, in module
 print float(B)
   File /home/server2/sage/local/lib/python2.5/site-packages/
 SQLAlchemy-0.4.6-py2.5.egg/, line 1, in module

 TypeError: float() argument must be a string or a number.

 Looks like a bug to me. The usual trick (at least in my book of using
 n() does also not work):

 [EMAIL PROTECTED]:/scratch/mabshoff/release-cycle/sage-3.1.3.alpha1$ ./
 sage
 - 
 -
 | SAGE Version 3.1.3.alpha1, Release Date:  
 2008-09-24|
 | Type notebook() for the GUI, and license() for  
 information.|
 - 
 -

 sage: G = DirichletGroup(21)
 sage: chi = G.1;
 sage: chi(23)
 zeta6 - 1
 sage: B=13*chi(23)
 sage: print float(B)
 - 
 --
 TypeError Traceback (most recent call
 last)

 /scratch/mabshoff/release-cycle/sage-3.1.3.alpha1/ipython  
 console in
 module()

 TypeError: float() argument must be a string or a number
 sage: type(B)
 type
 'sage.rings.number_field.number_field_element_quadratic.NumberFieldEl 
 ement_quadratic'
 sage: n(B)
 - 
 --
 TypeError Traceback (most recent call
 last)

 /scratch/mabshoff/release-cycle/sage-3.1.3.alpha1/ipython  
 console in
 module()

 /scratch/mabshoff/release-cycle/sage-3.1.3.alpha1/local/lib/python/
 site-packages/sage/misc/functional.py in numerical_approx(x, prec,
 digits)
716 return
 sage.rings.real_mpfr.RealField_constructor(prec)(x)
717 except TypeError:
 -- 718 return sage.rings.complex_field.ComplexField 
 (prec)
 (x)
719
720 n = numerical_approx

 /scratch/mabshoff/release-cycle/sage-3.1.3.alpha1/local/lib/ 
 python2.5/
 site-packages/sage/rings/complex_field.py in __call__(self, x, im)
212 except AttributeError:
213 pass
 -- 214 return complex_number.ComplexNumber(self, x, im)
215
216 def _coerce_impl(self, x):

 /scratch/mabshoff/release-cycle/sage-3.1.3.alpha1/complex_number.pyx
 in sage.rings.complex_number.ComplexNumber.__init__ (sage/rings/
 complex_number.c:2519)()

 TypeError: unable to coerce to a ComplexNumber
 sage:


 Can someone more knowledgeable in the area open a ticket?

 I'm not sure quite what the ticket would propose.  We could have a
 method n() for number field elements which maps the element into CC
 using the first available complex embedding and a precision given by a
 prec parameter.  But I think number theorists are more likely to want
 to have control over their embeddings, as in my sample solution.

Under the new coercion model (not ported yet, but high on the todo  
list), one can create number fields with default embeddings, which  
may make sense to do here.

- Robert


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: how to calculate the derivative of a boolean polynomial?

2008-09-24 Thread Robert Bradshaw

On Sep 24, 2008, at 7:09 AM, vpv wrote:


 Is it possible to calculate the derivative of a boolean polynomial in
 Sage using PolyBoRi?

 I can do this for polynomials over GF(2):

 sage: R.x,y,x = PolynomialRing(GF(2),3)
 sage: f = 3*x^2*y + 2*x*y + y + 9*x^2 + 5*x - 3
 sage: f
 x^2*y + x^2 + x + y + 1
 sage: f.derivative(x)
 1
 sage: f.derivative(y)
 x^2 + 1

 However I cannot do the same for boolean polynomials:

 sage: B.x,y,z = BooleanPolynomialRing(3)
 sage: f = 3*x^2*y + 2*x*y + y + 9*x^2 + 5*x - 3
 sage: f
 x*y + y + 1
 sage: f.derivative(x)
 AttributeError: 'sage.rings.polynomial.pbori.BooleanPolynomial' object
 has no attribute '_derivative'
 sage:

 Maybe this is not implemented or maybe i am not doing sth. right?

It looks like this is not implemented.

- Robert



--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Numerical evaluate of the Dirichlet character value

2008-09-24 Thread William Stein

`

On Wed, Sep 24, 2008 at 4:42 AM, John Cremona [EMAIL PROTECTED] wrote:

 2008/9/24 mabshoff [EMAIL PROTECTED]:



 On Sep 24, 4:15 am, Raouf [EMAIL PROTECTED] wrote:
 Hi,
 I want to have a numerical value of a  Dirichlet character :

 I have this line code in my notebook:

 sage:
 G = DirichletGroup(21)
 chi = G.1;
 chi(23)

 evaluate:
 zeta6 - 1

 And when i want to use this value: zeta6 - 1 i have the error message:

 G = DirichletGroup(21)
 chi = G.1;
 chi(23)
 B=13*chi(23)
 print float(B)

 error message:

 Traceback (most recent call last):
   File stdin, line 1, in module
   File /home/server2/nb1/sage_notebook/worksheets/fstthese/0/code/
 6.py, line 10, in module
 print float(B)
   File /home/server2/sage/local/lib/python2.5/site-packages/
 SQLAlchemy-0.4.6-py2.5.egg/, line 1, in module

 TypeError: float() argument must be a string or a number.

 Looks like a bug to me. The usual trick (at least in my book of using
 n() does also not work):

 [EMAIL PROTECTED]:/scratch/mabshoff/release-cycle/sage-3.1.3.alpha1$ ./
 sage
 --
 | SAGE Version 3.1.3.alpha1, Release Date: 2008-09-24|
 | Type notebook() for the GUI, and license() for information.|
 --

 sage: G = DirichletGroup(21)
 sage: chi = G.1;
 sage: chi(23)
 zeta6 - 1
 sage: B=13*chi(23)
 sage: print float(B)

B cannot be be coerced to a float, since B is a complex number with
nontrivial imaginary part.  It definitely should raise a TypeError
as it does.

That said, it would be good to make it so this works, which would be
a good thing to open as a ticket.

sage: G = DirichletGroup(21)
sage: B = 23* G.1(23)
sage: B
23*zeta6 - 23
sage: complex(B)
---
TypeError Traceback (most recent call last)



William

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: libsvm unser Sage

2008-09-24 Thread William Stein

On Wed, Sep 24, 2008 at 8:42 AM, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:

 Hi,

 I have a question about libsvm using under Sage. I have downloaded
 libsvm (a Support Vector Machine classification library) which comes
 with a python interface.

 I did build the sources as follows :

 [EMAIL PROTECTED]:~/actuel/recherche/libs/libsvm-2.86/python$ ll
 total 208
 -rw-r--r-- 1 jlandre jlandre   1140 2004-03-24 12:44
 cross_validation.py
 -rw-r--r-- 1 jlandre jlandre582 2007-10-14 08:29 Makefile
 -rw-r--r-- 1 jlandre jlandre   5023 2008-02-19 00:09 README
 -rw-r--r-- 1 jlandre jlandre   2731 2007-03-31 02:31 svmc.i
 -rw-r--r-- 1 jlandre jlandre 169031 2007-03-31 02:31 svmc_wrap.c
 -rw-r--r-- 1 jlandre jlandre   8140 2006-12-08 15:37 svm.py
 -rwxr-xr-x 1 jlandre jlandre   2110 2006-07-28 02:09 svm_test.py
 -rwxr-xr-x 1 jlandre jlandre630 2003-07-12 06:07
 test_cross_validation.py
 [EMAIL PROTECTED]:~/actuel/recherche/libs/libsvm-2.86/python$ make
 PYTHON_INCLUDEDIR=/usr/local/sage/sage/local/include/python2.5 all
 g++ -O3 -I/usr/local/sage/sage/local/include/python2.5 -I.. -fPIC -c
 svmc_wrap.c
 g++ -O3 -I/usr/local/sage/sage/local/include/python2.5 -I.. -fPIC -
 c ../svm.cpp
 g++ -shared -o svmc.so svmc_wrap.o svm.o
 [EMAIL PROTECTED]:~/actuel/recherche/libs/libsvm-2.86/python$ ll
 total 648
 -rw-r--r-- 1 jlandre jlandre   1140 2004-03-24 12:44
 cross_validation.py
 -rw-r--r-- 1 jlandre jlandre582 2007-10-14 08:29 Makefile
 -rw-r--r-- 1 jlandre jlandre   5023 2008-02-19 00:09 README
 -rw-r--r-- 1 jlandre jlandre   2731 2007-03-31 02:31 svmc.i
 -rwxr-xr-x 1 jlandre jlandre 160033 2008-09-24 17:30 svmc.so
 -rw-r--r-- 1 jlandre jlandre 169031 2007-03-31 02:31 svmc_wrap.c
 -rw-r--r-- 1 jlandre jlandre 180992 2008-09-24 17:30 svmc_wrap.o
 -rw-r--r-- 1 jlandre jlandre  89912 2008-09-24 17:30 svm.o
 -rw-r--r-- 1 jlandre jlandre   8140 2006-12-08 15:37 svm.py
 -rwxr-xr-x 1 jlandre jlandre   2110 2006-07-28 02:09 svm_test.py
 -rwxr-xr-x 1 jlandre jlandre630 2003-07-12 06:07
 test_cross_validation.py

 As you can see, I passed the path of the Sage python installation to
 the Makefile and everything was OK.

 I obtain a library file named svmc.so. My question is where do I
 have to put it under the Sage directory in order to use it ?

What happens if -- from the same directory that svmc.so is in -- you
run Sage and type

   sage: import svmc
   sage: svmc.[press the tab key]
   sage: help(svmc)
   sage: dir(svmc)


 Thanks in advance for your nice reply, have a nice day wherever you
 are in the world...

 Regards,

 Jérôme Landré
 University of Reims-Champagne-Ardenne
 France

 




-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Generating all subgroups of a group

2008-09-24 Thread Rob Beezer

A homework exercise for my students asks them to find all subgroups of
S_4, which should be a very instructive exercise, even if a bit
unreasonable.  In SAGE, the  conjugacy_classes_subgroups()  method
gets you started, and the quick-and-dirty brute-force code below
creates all possible subgroups by doing the necessary conjugations.

Is there a SAGE command that will do something similar?  Are there
SAGE commands that will make the code below more efficient?  (The
routine below takes about 30 seconds on my reasonably powerful
machine.)

A subgroups command would be very useful command for students
learning group theory and experimenting, though time and space might
quickly become a problem.  Any thoughts?

G = SymmetricGroup(4)
conj_sg = G.conjugacy_classes_subgroups()
all_sg=[]
for representative_sg in conj_sg:
  for g in G:
new_sg=[]
for h in representative_sg:
  new_sg.append(g^-1*h*g)
new_sg.sort()
if not(new_sg in all_sg):
  all_sg.append(new_sg)
for sg in all_sg:
  print sg

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Generating all subgroups of a group

2008-09-24 Thread Carlo Hamalainen

On Wed, Sep 24, 2008 at 7:29 PM, Rob Beezer [EMAIL PROTECTED] wrote:

 A homework exercise for my students asks them to find all subgroups of
 S_4, which should be a very instructive exercise, even if a bit
 unreasonable.  In SAGE, the  conjugacy_classes_subgroups()  method
 gets you started, and the quick-and-dirty brute-force code below
 creates all possible subgroups by doing the necessary conjugations.

GAP has code for finding low index subgroups. Here's some Sage code to
find all subgroups up to a certain index in the (3,3,3) triangle
group:

##
p = 3
q = 3
r = 3

F = gap.new(FreeGroup(3))
gens = list(gap.GeneratorsOfGroup(F))
rho1 = gens[0]
rho2 = gens[1]
rho3 = gens[2]

triangle_group = F.FactorGroupFpGroupByRels([F.1*F.2*F.3, \
F.1**p, F.2**q, F.3**r])

iter = gap.LowIndexSubgroupsFpGroupIterator(triangle_group, \
gap.TrivialSubgroup(triangle_group), 30)

while str(gap.IsDoneIterator(iter)) == 'false':
H = gap.NextIterator(iter)

nr_points = gap.Index(triangle_group, H)

G = gap.Image(gap.ActionHomomorphism(triangle_group, \
gap.RightCosets(triangle_group, H), gap.OnRight))

print gap.Order(G)
##


I have plans to write a Cython wrapper for LOWX some time, see
http://designtheory.org/~peter/software/lowx/

-- 
Carlo Hamalainen
http://carlo-hamalainen.net

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Generating all subgroups of a group

2008-09-24 Thread David Joyner

On Wed, Sep 24, 2008 at 2:05 PM, Carlo Hamalainen
[EMAIL PROTECTED] wrote:

 On Wed, Sep 24, 2008 at 7:29 PM, Rob Beezer [EMAIL PROTECTED] wrote:

 A homework exercise for my students asks them to find all subgroups of
 S_4, which should be a very instructive exercise, even if a bit
 unreasonable.  In SAGE, the  conjugacy_classes_subgroups()  method
 gets you started, and the quick-and-dirty brute-force code below
 creates all possible subgroups by doing the necessary conjugations.

 GAP has code for finding low index subgroups. Here's some Sage code to
 find all subgroups up to a certain index in the (3,3,3) triangle
 group:

 ##
 p = 3
 q = 3
 r = 3

 F = gap.new(FreeGroup(3))
 gens = list(gap.GeneratorsOfGroup(F))
 rho1 = gens[0]
 rho2 = gens[1]
 rho3 = gens[2]

 triangle_group = F.FactorGroupFpGroupByRels([F.1*F.2*F.3, \
F.1**p, F.2**q, F.3**r])

 iter = gap.LowIndexSubgroupsFpGroupIterator(triangle_group, \
gap.TrivialSubgroup(triangle_group), 30)

 while str(gap.IsDoneIterator(iter)) == 'false':
H = gap.NextIterator(iter)

nr_points = gap.Index(triangle_group, H)

G = gap.Image(gap.ActionHomomorphism(triangle_group, \
gap.RightCosets(triangle_group, H), gap.OnRight))

print gap.Order(G)
 ##


 I have plans to write a Cython wrapper for LOWX some time, see
 http://designtheory.org/~peter/software/lowx/

Thanks in advance!


 --
 Carlo Hamalainen
 http://carlo-hamalainen.net

 


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Generating all subgroups of a group

2008-09-24 Thread John Cremona

In Rob's example it would be nice (and good for the students to see)
if instead of looping over all g in G to construct conjugate subgroups
he could loop over coset representatives of H in G (where H is his
representative_subgroup), or (optimal) coset reps of the normalizer of
H in G.  Now we can already compute HG=H.normalizer(G) in Sage
directly, but I cannot see a way of getting a list of coset reps.
Presumably Gap can do this, so perhaps wrapping that function would be
worthwhile.  I did a search_src(transversal) and indeed found (in
the file coding/binary_code.pyx) reference to a Gap function
RightTransversal.

John Cremona

2008/9/24 Carlo Hamalainen [EMAIL PROTECTED]:

 On Wed, Sep 24, 2008 at 7:29 PM, Rob Beezer [EMAIL PROTECTED] wrote:

 A homework exercise for my students asks them to find all subgroups of
 S_4, which should be a very instructive exercise, even if a bit
 unreasonable.  In SAGE, the  conjugacy_classes_subgroups()  method
 gets you started, and the quick-and-dirty brute-force code below
 creates all possible subgroups by doing the necessary conjugations.

 GAP has code for finding low index subgroups. Here's some Sage code to
 find all subgroups up to a certain index in the (3,3,3) triangle
 group:

 ##
 p = 3
 q = 3
 r = 3

 F = gap.new(FreeGroup(3))
 gens = list(gap.GeneratorsOfGroup(F))
 rho1 = gens[0]
 rho2 = gens[1]
 rho3 = gens[2]

 triangle_group = F.FactorGroupFpGroupByRels([F.1*F.2*F.3, \
F.1**p, F.2**q, F.3**r])

 iter = gap.LowIndexSubgroupsFpGroupIterator(triangle_group, \
gap.TrivialSubgroup(triangle_group), 30)

 while str(gap.IsDoneIterator(iter)) == 'false':
H = gap.NextIterator(iter)

nr_points = gap.Index(triangle_group, H)

G = gap.Image(gap.ActionHomomorphism(triangle_group, \
gap.RightCosets(triangle_group, H), gap.OnRight))

print gap.Order(G)
 ##


 I have plans to write a Cython wrapper for LOWX some time, see
 http://designtheory.org/~peter/software/lowx/

 --
 Carlo Hamalainen
 http://carlo-hamalainen.net

 


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Windows: Where are worksheets stored?

2008-09-24 Thread Jannick Asmus

Hi,

switching to the latest release 3.1.2 on windows machines I would like 
to save my workbooks. but where are they stored?

Sorry for my ignorance since my question seems to be a FAQ.

As always, thanks for your help.

Best wishes,
J.



--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: libsvm unser Sage

2008-09-24 Thread [EMAIL PROTECTED]

Hi,

When I start Sage in the directory where python libsvm was built, It
seems to work but I have another problem to run the test_script :

--
| SAGE Version 3.1.2, Release Date: 2008-09-19   |
| Type notebook() for the GUI, and license() for information.|
--

sage: import svmc
sage: sv
svm.osvm_test.py  svmc.i   svmc_wrap.c
svm.py   svmc svmc.so  svmc_wrap.o
sage: svmc.
svmc.C_SVC   svmc.svm_parameter_C_set
svmc.EPSILON_SVR svmc.svm_parameter_cache_size_get
svmc.LINEAR  svmc.svm_parameter_cache_size_set
svmc.NU_SVC  svmc.svm_parameter_coef0_get
svmc.NU_SVR  svmc.svm_parameter_coef0_set
svmc.ONE_CLASS   svmc.svm_parameter_degree_get
svmc.POLYsvmc.svm_parameter_degree_set
svmc.PRECOMPUTED svmc.svm_parameter_eps_get
svmc.RBF svmc.svm_parameter_eps_set
svmc.SIGMOID svmc.svm_parameter_gamma_get
svmc.delete_double   svmc.svm_parameter_gamma_set
svmc.delete_int
svmc.svm_parameter_kernel_type_get
svmc.delete_svm_parameter
svmc.svm_parameter_kernel_type_set
svmc.delete_svm_problem  svmc.svm_parameter_nr_weight_get
svmc.double_getitem  svmc.svm_parameter_nr_weight_set
svmc.double_setitem  svmc.svm_parameter_nu_get
svmc.i   svmc.svm_parameter_nu_set
svmc.int_getitem svmc.svm_parameter_p_get
svmc.int_setitem svmc.svm_parameter_p_set
svmc.new_double
svmc.svm_parameter_probability_get
svmc.new_int
svmc.svm_parameter_probability_set
svmc.new_svm_parameter   svmc.svm_parameter_shrinking_get
svmc.new_svm_problem svmc.svm_parameter_shrinking_set
svmc.so  svmc.svm_parameter_svm_type_get
svmc.svm_check_parameter svmc.svm_parameter_svm_type_set
svmc.svm_check_probability_model svmc.svm_parameter_weight_get
svmc.svm_cross_validation
svmc.svm_parameter_weight_label_get
svmc.svm_destroy_model
svmc.svm_parameter_weight_label_set
svmc.svm_get_labels  svmc.svm_parameter_weight_set
svmc.svm_get_nr_classsvmc.svm_predict
svmc.svm_get_svm_typesvmc.svm_predict_probability
svmc.svm_get_svr_probability svmc.svm_predict_values
svmc.svm_load_model  svmc.svm_problem_l_get
svmc.svm_node_array  svmc.svm_problem_l_set
svmc.svm_node_array_destroy  svmc.svm_problem_x_get
svmc.svm_node_array_set  svmc.svm_problem_x_set
svmc.svm_node_matrix svmc.svm_problem_y_get
svmc.svm_node_matrix_destroy svmc.svm_problem_y_set
svmc.svm_node_matrix_set svmc.svm_save_model
svmc.svm_parameter_C_get svmc.svm_train
sage: help(svmc)

sage: dir(svmc)

['C_SVC',
 'EPSILON_SVR',
 'LINEAR',
 'NU_SVC',
 'NU_SVR',
 'ONE_CLASS',
 'POLY',
 'PRECOMPUTED',
 'RBF',
 'SIGMOID',
 '__doc__',
 '__file__',
 '__name__',
 'delete_double',
 'delete_int',
 'delete_svm_parameter',
 'delete_svm_problem',
 'double_getitem',
 'double_setitem',
 'int_getitem',
 'int_setitem',
 'new_double',
 'new_int',
 'new_svm_parameter',
 'new_svm_problem',
 'svm_check_parameter',
 'svm_check_probability_model',
 'svm_cross_validation',
 'svm_destroy_model',
 'svm_get_labels',
 'svm_get_nr_class',
 'svm_get_svm_type',
 'svm_get_svr_probability',
 'svm_load_model',
 'svm_node_array',
 'svm_node_array_destroy',
 'svm_node_array_set',
 'svm_node_matrix',
 'svm_node_matrix_destroy',
 'svm_node_matrix_set',
 'svm_parameter_C_get',
 'svm_parameter_C_set',
 'svm_parameter_cache_size_get',
 'svm_parameter_cache_size_set',
 'svm_parameter_coef0_get',
 'svm_parameter_coef0_set',
 'svm_parameter_degree_get',
 'svm_parameter_degree_set',
 'svm_parameter_eps_get',
 'svm_parameter_eps_set',
 'svm_parameter_gamma_get',
 'svm_parameter_gamma_set',
 'svm_parameter_kernel_type_get',
 'svm_parameter_kernel_type_set',
 'svm_parameter_nr_weight_get',
 'svm_parameter_nr_weight_set',
 'svm_parameter_nu_get',
 'svm_parameter_nu_set',
 'svm_parameter_p_get',
 'svm_parameter_p_set',
 'svm_parameter_probability_get',
 'svm_parameter_probability_set',
 'svm_parameter_shrinking_get',
 'svm_parameter_shrinking_set',
 'svm_parameter_svm_type_get',
 'svm_parameter_svm_type_set',
 'svm_parameter_weight_get',
 'svm_parameter_weight_label_get',
 'svm_parameter_weight_label_set',
 'svm_parameter_weight_set',
 'svm_predict',
 'svm_predict_probability',
 'svm_predict_values',
 'svm_problem_l_get',
 'svm_problem_l_set',
 'svm_problem_x_get',
 'svm_problem_x_set',
 'svm_problem_y_get',
 'svm_problem_y_set',
 'svm_save_model',
 'svm_train']
sage: svm_test.py

[sage-support] Re: maple from sage on mac os

2008-09-24 Thread Alex Raichev

Hi William:

The same thing happens to me on Mac OS X.  How do i fix this?

Alex

--
| SAGE Version 3.1.2, Release Date: 2008-09-19   |
| Type notebook() for the GUI, and license() for information.|
--

sage: maple('3*5')

sage: maple('3*5')
read /Users/arai021/.sage//temp/prj_567_106.cs.auckland.ac.nz/1910//
inter
sage: maple('3*5')
15
sage: maple('3*5')

sage: maple('3*5')
read /Users/arai021/.sage//temp/prj_567_106.cs.auckland.ac.nz/1910//
inter
sage: maple('3*5')
sage1
sage: maple('3*5')

sage: maple('3*5')
read /Users/arai021/.sage//temp/prj_567_106.cs.auckland.ac.nz/1910//
inter
sage: maple('3*5')
sage2
sage: maple('3*5')

sage: maple('3*5')
read /Users/arai021/.sage//temp/prj_567_106.cs.auckland.ac.nz/1910//
inter
sage: maple('3*5')
sage9

On Aug 26, 8:42 pm, William Stein [EMAIL PROTECTED] wrote:
 On Sat, Aug 23, 2008 at 3:12 AM, G. Edgar [EMAIL PROTECTED] wrote:

  I tried this again...

 Thanks.  Is there any chance I could get a temporary login shell on
 your machine?
 If you don't know how to do this, it would be easy for your sysadmin.  That's
 the only sure way to just get this fixed.

 William





  

  --
  | SAGE Version 3.1.1, Release Date: 2008-08-17                       |
  | Type notebook() for the GUI, and license() for information.        |
  --

  sage: maple('8+3')

  sage: maple('8+3')
  read /Users/edgar/.sage//temp/cpe_75_187_61_115.columbus.res.rr.com/
  6804/
  sage: maple('8+3')
  11
  sage: maple('8+3')

  sage: maple('8+3')
  read /Users/edgar/.sage//temp/cpe_75_187_61_115.columbus.res.rr.com/
  6804/
  sage: maple('8+3')
  sage1
  sage: maple('8+3')

  sage: maple('8+3')
  read /Users/edgar/.sage//temp/cpe_75_187_61_115.columbus.res.rr.com/
  6804/
  sage: maple('8+3')
  sage2
  sage: maple('8+3')

  sage: maple('8+3')
  read /Users/edgar/.sage//temp/cpe_75_187_61_115.columbus.res.rr.com/
  6804/
  sage: maple('8+3')
  sage9
  sage:

 --
 William Stein
 Associate Professor of Mathematics
 University of Washingtonhttp://wstein.org
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: a problem starting the notebook

2008-09-24 Thread cesarnda

so?

On 23 sep, 01:35, cesarnda [EMAIL PROTECTED] wrote:
 I start sage and I type notebook and firefox is open to the following
 address:

 http://localhost:8000/?startup_token=1af26f2b14cac678ab97c121c9cca7c5

 which is not found, so I have to cut it just tohttp://localhost:8000,
 is there a way to solve this problem?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: maple from sage on mac os

2008-09-24 Thread mabshoff



On Sep 24, 3:20 pm, Alex Raichev [EMAIL PROTECTED] wrote:
 Hi William:

 The same thing happens to me on Mac OS X.  How do i fix this?

 Alex

Hi Alex,

I don't know how handy you are with patches and so on, but applying
the patch from #4180 followed by a sage -b would enable us to easily
see the pexpect logs. If you get the patch applied and so on do the
following:

export SAGE_PEXPECT_LOG=yes, then start sage from that console, do
some examples that break. Then check out $DOT_SAGE/pexpect_logs/ (that
is usually $HOME/.sage/pexpect_logs/) and send us the logs. That will
likely allow us to pinpoint what is going wrong.

If you do not want to or cannot do the patching just wait for 3.1.3
and it will have everything build in.

Cheers,

Michael
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Generating all subgroups of a group

2008-09-24 Thread Rob Beezer

Carlo and John,

Thanks for the replies - those are both very helpful, and exactly the
sort of thing I was hoping to learn about.

It appears to me that  H.normalizer()  expects just a single element
as an argument (rather than a whole subgroup), and returns a  Group
(rather than a PermutationGroup), but maybe I'm missing something.
All the same, speeding things up with a use of the normalizer would be
just the sort of thing my students could appreciate a few weeks from
now.

Thanks again,
Rob

On Sep 24, 12:33 pm, John Cremona [EMAIL PROTECTED] wrote:
 In Rob's example it would be nice (and good for the students to see)
 if instead of looping over all g in G to construct conjugate subgroups
 he could loop over coset representatives of H in G (where H is his
 representative_subgroup), or (optimal) coset reps of the normalizer of
 H in G.  Now we can already compute HG=H.normalizer(G) in Sage
 directly, but I cannot see a way of getting a list of coset reps.
 Presumably Gap can do this, so perhaps wrapping that function would be
 worthwhile.  I did a search_src(transversal) and indeed found (in
 the file coding/binary_code.pyx) reference to a Gap function
 RightTransversal.

 John Cremona

 2008/9/24 Carlo Hamalainen [EMAIL PROTECTED]:



  On Wed, Sep 24, 2008 at 7:29 PM, Rob Beezer [EMAIL PROTECTED] wrote:

  A homework exercise for my students asks them to find all subgroups of
  S_4, which should be a very instructive exercise, even if a bit
  unreasonable.  In SAGE, the  conjugacy_classes_subgroups()  method
  gets you started, and the quick-and-dirty brute-force code below
  creates all possible subgroups by doing the necessary conjugations.

  GAP has code for finding low index subgroups. Here's some Sage code to
  find all subgroups up to a certain index in the (3,3,3) triangle
  group:

  ##
  p = 3
  q = 3
  r = 3

  F = gap.new(FreeGroup(3))
  gens = list(gap.GeneratorsOfGroup(F))
  rho1 = gens[0]
  rho2 = gens[1]
  rho3 = gens[2]

  triangle_group = F.FactorGroupFpGroupByRels([F.1*F.2*F.3, \
     F.1**p, F.2**q, F.3**r])

  iter = gap.LowIndexSubgroupsFpGroupIterator(triangle_group, \
     gap.TrivialSubgroup(triangle_group), 30)

  while str(gap.IsDoneIterator(iter)) == 'false':
     H = gap.NextIterator(iter)

     nr_points = gap.Index(triangle_group, H)

     G = gap.Image(gap.ActionHomomorphism(triangle_group, \
         gap.RightCosets(triangle_group, H), gap.OnRight))

     print gap.Order(G)
  ##

  I have plans to write a Cython wrapper for LOWX some time, see
 http://designtheory.org/~peter/software/lowx/

  --
  Carlo Hamalainen
 http://carlo-hamalainen.net
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Links between worksheets

2008-09-24 Thread Rob Beezer

William,

I'm able to convert my open-source linear algebra textbook from LaTeX
to jsMath in an automated way, and you have seen my experiments in
converting snippets of the jsMath versions into SAGE worksheets.

When I attempt to convert the entire book this way, I'd expect each of
the 40 or so sections to be its own worksheet.  I use a lot of
hyperlinks to definitions and theorems, so there would be a lot of
links between worksheets.  And the creation of these links is under
the control of the translator (tex4ht).

I haven't thought too hard about the details, but it seems greater
flexibility in naming and locating work sheets would be necessary.
So I thought I'd toss out this scenario as a similar situation where
some extensions to the worksheet file name and location structure
could make new uses of SAGE possible.

Thanks,
Rob

On Sep 24, 9:32 am, William Stein [EMAIL PROTECTED] wrote:
 On Wed, Sep 24, 2008 at 12:09 AM, Maike [EMAIL PROTECTED] wrote:

  Hi all,

  I can have a link on one worksheet to another worksheet (e.g.
 http://localhost:8000/home/user/12/), but this includes the number
  that sage internally gives that worksheet (here: 12). Now if I upload
  these worksheets to another server, they are assigned different
  numbers and the links don't work properly anymore. Is there a any
  other way of linking in a more stable way, e.g. using the title of a
  worksheet?

 There is nothing better at present, unfortunately. Using the title
 isn't so good either, since it can be trivially changed at any time.
 Maybe worksheets
 should have some sort of linkable attribute url that is like a title, but 
 can't
 easily be changed (and if you change it you get a big warning about
 links breaking)?

  Also, can I have a link that goes to a certain place within
  a worksheet?

 You can do this using standard html.

 If in edit mode you put
 a name=here
 somewhere, then you can link to that point
 using, e.g., a href=#here

 See
    https://sage.math.washington.edu:8101/home/pub/28/
 for an example.    Doing

 https://sage.math.washington.edu:8101/home/pub/28/#here

 jumps to the bottom of that worksheet.

 William
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: maple from sage on mac os

2008-09-24 Thread Alex Raichev

Hi Michael:

I followed your instructions, did the following Sage commands, and got
the following pexpect log.

--
| SAGE Version 3.1.2, Release Date: 2008-09-19   |
| Type notebook() for the GUI, and license() for information.|
--

sage: maple('3*5')

sage: maple('3*5')
read /Users/arai021/.sage//temp/prj_567_106.cs.auckland.ac.nz/4643//
inter
sage: maple('3*5')
sage0
sage: maple('3*5')

sage: maple('3*5')
read /Users/arai021/.sage//temp/prj_567_106.cs.auckland.ac.nz/4643//
inter
sage: maple('3*5')
sage1
sage: maple('3*5')

sage: maple('3*5')
read /Users/arai021/.sage//temp/prj_567_106.cs.auckland.ac.nz/4643//
inter
sage: maple('3*5')
sage2

===

#--read /Users/arai021/.sage//temp/prj_567_106.cs.auckland.ac.nz/
4643//interface//tmp4643;
read /Users/arai021/.sage//temp/prj_567_106.cs.auckland.ac.nz/4643//
inter
#--read /Users/arai021/.sage//temp/prj_
\
read /Users/arai021/.sage//temp/prj_567_106.cs.auckland.ac.nz/4643//
interface//tmp4643;

#--567_106.cs.auckland.ac.nz/4643//interface//tmp4643;
read /Users/arai021/.sage//temp/prj_567_read /Users/arai021/.sage//
temp/prj_567_106.cs.auckland.ac.nz/4643//interface//tmp4643;
106.cs.auckland.ac.nz/4643//interface//tmp4643;
sage0
#--read /Users/arai021/.sage//temp/prj_567read /Users/
arai021/.sage//temp/prj_567_106.cs.auckland.ac.nz/4643//interface//
tmp4643;
_106.cs.auckland.ac.nz/4643//inter
#--read /Users/arai021/.sage//temp/prj_\   read
/Users/arai021/.sage//temp/prj_567_106.cs.auckland.ac.nz/4643//
interface//tmp4643;


#--567_106.cs.auckland.ac.nz/4643//interface//tmp4643;
sage0
#--read /Users/arread /Users/arai021/.sage//temp/
prj_567_106.cs.auckland.ac.nz/4643//interface//tmp4643;
read /Users/arai021/.sage//temp/prj_567_106.cs.auckland.ac.nz/4643//
interface//tmp4643;
ai021/.sage//temp/prj_567_106.cs.auckland.ac.nz/4643//inter
#--read /Users/arai021/.sage//temp/prjread /Users/arai021/.sage//
temp/prj_567_106.cs.auckland.ac.nz/4643//interface//tmp4643;
_\

#--567_106.cs.auckland.ac.nz/4643//interface//tmp4643;
read /Users/arai021/.sage//temp/prj_567_106.cs.auckland.ac.nz/4643//
interface//tmp4643;
sage1
#--read /Users/arai021/.sage//temp/prj_567_106.cs.auckland.ac.nz/
4643//inter
#--read /Userread /Users/arai021/.sage//temp/
prj_567_106.cs.auckland.ac.nz/4643//interface//tmp4643;
read /Users/arai021/.sage//temp/prj_567_106.cs.auckland.ac.nz/4643//
interface//tmp4643;
s/arai021/.sage//temp/prj_\

#--567_106.cs.auckland.ac.nz/464read /Users/arai021/.sage//temp/
prj_567_106.cs.auckland.ac.nz/4643//interface//tmp4643;
3//interface//tmp4643;
sage1
#--read /Users/arai021/.sage//temp/prj_567_106.cs.auckland.ac.nz/
46read /Users/arai021/.sage//temp/prj_567_106.cs.auckland.ac.nz/4643//
interface//tmp4643;
43//inter
#--read /Users/arai021/.sage//temp/prj_
\

#--567_read /Users/arai021/.sage//temp/prj_567_106.cs.auckland.ac.nz/
4643//interface//tmp4643;
read /Users/arai021/.sage//temp/prj_567_106.cs.auckland.ac.nz/4643//
interface//tmp4643;
106.cs.auckland.ac.nz/4643//interface//tmp4643;
sage2
#--read /Users/arai021/.sage//temp/prj_567read /Users/
arai021/.sage//temp/prj_567_106.cs.auckland.ac.nz/4643//interface//
tmp4643;
_106.cs.auckland.ac.nz/4643//inter
#--read /Users/arai021/.sage//temp/prj_\   read
/Users/arai021/.sage//temp/prj_567_106.cs.auckland.ac.nz/4643//
interface//tmp4643;


#--567_106.cs.auckland.ac.nz/4643//interface//tmp4643;
sage2
#--read /Users/arread /Users/arai021/.sage//temp/
prj_567_106.cs.auckland.ac.nz/4643//interface//tmp4643;




On Sep 25, 12:44 pm, mabshoff [EMAIL PROTECTED]
dortmund.de wrote:
 On Sep 24, 3:20 pm, Alex Raichev [EMAIL PROTECTED] wrote:

  Hi William:

  The same thing happens to me onMacOS X.  How do i fix this?

  Alex

 Hi Alex,

 I don't know how handy you are with patches and so on, but applying
 the patch from #4180 followed by a sage-b would enable us to easily
 see the pexpect logs. If you get the patch applied and so on do the
 following:

 export SAGE_PEXPECT_LOG=yes, then startsagefrom that console, do
 some examples that break. Then check out $DOT_SAGE/pexpect_logs/ (that
 is usually $HOME/.sage/pexpect_logs/) and send us the logs. That will
 likely allow us to pinpoint what is going wrong.

 If you do not want to or cannot do the patching just wait for 3.1.3
 and it will have everything build in.

 Cheers,

 Michael
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---