[sage-support] more control over plots

2008-09-25 Thread Maike

Hello,

I've tried looking at all the plot options in the documentation, but I
can't find how to do the following. Maybe someone can help...

* control over the scaling of the y-axis. I can choose xmin and xmax,
but the range of the y-axis is always chosen automatically.
* control over where the y-axis is located. It sometimes just ends up
right smack in the middle of the graph and looks dumb, I'd prefer for
it to be on the left.
* turning off the numbers on the axes. I'd like the axes to show, but
not the values.
* having a light gray grid displayed in the background of a plot

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] Re: more control over plots

2008-09-25 Thread Stan Schymanski

Hi Maike,

I found that the use of pylab allows a lot more control over your
plots. Example:

import pylab
x1 = srange(0,1.1,0.01)
d1 = [2*x+x^2 for x in x1]
d2 = [3*x+0.9*x^2 for x in x1]
title='Test plot'
pylab.clf() # clear the figure first
pylab.figure(1)
# plot some data and add a legend
pylab.plot(x1,d1, label=d1)
pylab.plot(x1,d2,label=d2)
pylab.axvline(x=0.5,ls='-.')
pylab.legend(loc=0) # print the legend
pylab.title(title)
pylab.ylabel($f(x)$) # label the axes
pylab.xlabel($x$)
pylab.savefig('foo.png') # fire!

I have not found out how to make the adjustments you asked for, but
there is some helpful literature around that explains how to use pylab
in detail (look for matplotlib on the web). I heard that the plot
functionality in sage is being worked on but I don't know how far it
is at the moment. Perhaps it is possible to do all this already. I do
know that you can set the axes ranges for both the x- and y-axes quite
easily:

P=fun.plot(x,0,1)
P.axes_range(xmin1,xmax1,ymin1,ymax1)
P.axes_labels(['$A_v$', '$B_v$'])
P

Where fun is the function to plot, x is the variable on the x-axis,
and P.axes_range defines the ranges of the axes.

Hope this helps until someone more knowledgeable helps out.

Stan
--~--~-~--~~~---~--~~
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] problem with attach

2008-09-25 Thread Jan Peeters

I have a worksheet Getaltheorie in my Worksheet List. When i give
the command attach Getaltheorie (or attach 'Getaltheorie', or or
attach 'Getaltheorie.sage'  or ...) in another worksheet,  i get the
error message 'Error attaching /Users/jokr004/.sage/Getaltheorie --
file not found'. I'm sure I'm doing something wrong but i have no idea
how to solve it. Is there a way to load the commands defined in ane
worksheet into another worksheet?

Thanks

--~--~-~--~~~---~--~~
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] small problem with pylab plots in sage 3.1.2

2008-09-25 Thread Stan Schymanski

Dear all,

When I upgraded to 3.1.2, I found that some of my plots generated
using pylab in the notebooks miss their bottom bits. It seems to be
related to the dpi setting. Example:

import pylab
x1 = srange(0,1.1,0.01)
d1 = [2*x+x^2 for x in x1]
pylab.clf() # clear the figure first
pylab.figure(1)
pylab.plot(x1,d1, label=d1)
pylab.ylabel($f(x)$) # label the axes
pylab.xlabel($x$)
pylab.savefig('foo.png',dpi=72) # fire!

If I leave the dpi=72 out in the last line, the plot is larger and
complete. This problem did not occur in sage 3.1.1, so I assume that
it is a bug. Could someone confirm and if so, create a ticket? Thanks!

Regards,
Stan
--~--~-~--~~~---~--~~
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 problem with pylab plots in sage 3.1.2

2008-09-25 Thread Martin Albrecht

I can confirm this bug and opened

http://trac.sagemath.org/sage_trac/ticket/4194

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] Re: more control over plots

2008-09-25 Thread Jason Grout

Maike wrote:
 Hello,
 
 I've tried looking at all the plot options in the documentation, but I
 can't find how to do the following. Maybe someone can help...
 
 * control over the scaling of the y-axis. I can choose xmin and xmax,
 but the range of the y-axis is always chosen automatically.
 * control over where the y-axis is located. It sometimes just ends up
 right smack in the middle of the graph and looks dumb, I'd prefer for
 it to be on the left.


For these two, use the ymin and ymax options in show when you show 
the plot.  Something like:

sage: plot(sin(x), (x, -pi, pi)).show(ymin=-1, ymax=3)

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] bug in _fast_float_ with plot in sage 3.2.1?

2008-09-25 Thread Stan Schymanski

Since upgrading to 3.2.1, the following does not work any more:

from sage.ext.fast_eval import fast_float
bv1=x^3-2*x^2+3*x
bv2=x^4-2*x^3+3
bv1p=bv1._fast_float_('x')
bv2p=bv2._fast_float_('x')
plot([bv1p,bv2p],0,1)

Traceback (click to the left for traceback)
...
TypeError: Needs at least 1 arguments (0 provided)


This works:
plot([bv1,bv2],0,1)
or
plot(bv1p,0,1)
or
plot(bv2p,0,1)

Since this worked in sage 3.1.1, I suppose that it is a bug introduced
in 3.2.1. Or am I doing something wrong?

Thanks for your help!

Stan
--~--~-~--~~~---~--~~
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-25 Thread cesarnda

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

sage: notebook()
The notebook files are stored in: /home/cesarnda/.sage//sage_notebook
**
**
* Open your web browser to http://localhost:8000 *
**
**
2008-09-25 07:38:53-0500 [-] Log opened.
2008-09-25 07:38:53-0500 [-] twistd 8.1.0 (/home/cesarnda/Sage/
sage-3.0.6-i686-Linux/local/bin/python 2.5.2) starting up
2008-09-25 07:38:53-0500 [-] reactor class: class
'twisted.internet.selectreactor.SelectReactor'
2008-09-25 07:38:53-0500 [-] twisted.web2.channel.http.HTTPFactory
starting on 8000
2008-09-25 07:38:53-0500 [-] Starting factory
twisted.web2.channel.http.HTTPFactory instance at 0x8c274ac
2008-09-25 07:38:57-0500 [HTTPChannel,1,127.0.0.1] /home/cesarnda/Sage/
sage-3.0.6-i686-Linux/local/lib/python2.5/site-packages/Twisted-8.1.0-
py2.5-linux-i686.egg/twisted/internet/defer.py:267:
exceptions.DeprecationWarning: Don't pass strings (like 'Bad token')
to failure.Failure (replacing with a DefaultException).
2008-09-25 07:38:57-0500 [HTTPChannel,1,127.0.0.1] Exception
rendering:
2008-09-25 07:38:57-0500 [HTTPChannel,1,127.0.0.1] Unhandled Error
Traceback (most recent call last):
Failure: twisted.python.failure.DefaultException: Bad token




On Sep 24, 7:32 pm, mabshoff [EMAIL PROTECTED]
dortmund.de wrote:
 On Sep 24, 5:25 pm, cesarnda [EMAIL PROTECTED] wrote:

  so?

 What version of Sage are you using? What operating system are you on?
 Could you provide the complete log, i.e. the output from when you
 start Sage and then invoke the notebook?

 Cheers,

 Michael

  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: listing all elements of a finitely generated ideal

2008-09-25 Thread Martin Albrecht

On Thursday 25 September 2008, vpv wrote:
 sage: B.x0,x1,x2 = BooleanPolynomialRing(3)
 sage: f1 = x0*x1 + x2
 sage: f2 = x1*x2
 sage: f3 = x0*x1*x2 + x0*x2
 sage: I = ideal(f1,f2,f3)

If you compute the Gröbner basis:

sage: I.groebner_basis()
[x0*x1, x2]

You'll see that all elements of the form 

f =  sum p_i*x0*x1 + sum q_i*x2  for p_i and q_i polynomials in B 

are in I.

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] Re: more control over plots

2008-09-25 Thread Maike

Hi Jason,

Thanks for the help! Which parameter is it that tells the axis to be
on the left? My example is:

rsa = line([(2000,952),(2005,1149),(2010,1369),(2015,1613),(2020,1881),
(2025,2174),(2030,2493),(2035,2840),(2040,3214)],rgbcolor=green)
ecc = line([(2000,132),(2005,139),(2010,146),(2015,154),(2020,161),
(2025,169),(2030,176),(2035,184),(2040,191)],rgbcolor=red)
(rsa+ecc).save('bild.png',xmin=2000,xmax=2040,axes_labels=['year','key
length in bits'],figsize=5)

Here I'd like the axis to be on the left. Can you tell me how to do
this here? Thanks!
Maike


On Sep 25, 1:18 pm, Jason Grout [EMAIL PROTECTED] wrote:
 Jason Grout wrote:
  Maike wrote:
  Hello,

  I've tried looking at all the plot options in the documentation, but I
  can't find how to do the following. Maybe someone can help...

  * control over the scaling of the y-axis. I can choose xmin and xmax,
  but the range of the y-axis is always chosen automatically.
  * control over where the y-axis is located. It sometimes just ends up
  right smack in the middle of the graph and looks dumb, I'd prefer for
  it to be on the left.

  For these two, use the ymin and ymax options in show when you show
  the plot.  Something like:

  sage: plot(sin(x), (x, -pi, pi)).show(ymin=-1, ymax=3)

 Sorry, I misread your second point.  The following example puts the
 y-axis on the left:

 sage: plot(sin(x), (x, 0, pi)).show(ymin=-1,ymax=-3)

 Does that help?

 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] Re: more control over plots

2008-09-25 Thread Jason Grout

Maike wrote:
 Hi Jason,
 
 Thanks for the help! Which parameter is it that tells the axis to be
 on the left? My example is:
 
 rsa = line([(2000,952),(2005,1149),(2010,1369),(2015,1613),(2020,1881),
 (2025,2174),(2030,2493),(2035,2840),(2040,3214)],rgbcolor=green)
 ecc = line([(2000,132),(2005,139),(2010,146),(2015,154),(2020,161),
 (2025,169),(2030,176),(2035,184),(2040,191)],rgbcolor=red)
 (rsa+ecc).save('bild.png',xmin=2000,xmax=2040,axes_labels=['year','key
 length in bits'],figsize=5)
 
 Here I'd like the axis to be on the left. Can you tell me how to do
 this here? Thanks!


This doesn't totally answer you, but you could do a kludge by adding 
frame=True, axes=False to the save command.  That takes off the axes, 
but puts a frame around the plot.  After glancing through the source 
code in plot.py and axes.py in the devel/sage/sage/plot directory, it 
looks like the centered axes are automatically calculated and there 
isn't a way to change it currently.  If you need more flexibility, then 
I'd suggest either using pylab for now (like the other post pointed out) 
  or diving in and patching the code in Sage.

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] Calculating mods

2008-09-25 Thread Mikemak27

I am brand new to this. I was wondering how to calculate mods while in
the sage notebook. I need to calculate 520622^430085 mod 998171. Does
anyone know how to type this into the command line. I keep getting a
syntax error. I have no idea how to do this because I am brand new to
sage. Thank you.

--~--~-~--~~~---~--~~
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: Calculating mods

2008-09-25 Thread John Cremona

sage: 520622^430085 % 998171
897985


It is very much faster to do it more like this:
sage: R=Integers(998171)
sage: a=R(520622)
sage: a^430085
897985

The first way (I think) computes 520622^430085 as an integer and then
reduces, while the second way constructs the ring of integers mod
998171, defines a as the residue of 520622 in that ring, and then
exponentiates.

John Cremona

2008/9/25 Mikemak27 [EMAIL PROTECTED]:

 I am brand new to this. I was wondering how to calculate mods while in
 the sage notebook. I need to calculate 520622^430085 mod 998171. Does
 anyone know how to type this into the command line. I keep getting a
 syntax error. I have no idea how to do this because I am brand new to
 sage. Thank you.

 


--~--~-~--~~~---~--~~
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: bug in _fast_float_ with plot in sage 3.2.1?

2008-09-25 Thread Mike Hansen

Hi Stan,

On Thu, Sep 25, 2008 at 5:27 AM, Stan Schymanski [EMAIL PROTECTED] wrote:
 from sage.ext.fast_eval import fast_float
 bv1=x^3-2*x^2+3*x
 bv2=x^4-2*x^3+3
 bv1p=bv1._fast_float_('x')
 bv2p=bv2._fast_float_('x')
 plot([bv1p,bv2p],0,1)

 Traceback (click to the left for traceback)
 ...
 TypeError: Needs at least 1 arguments (0 provided)

 Since this worked in sage 3.1.1, I suppose that it is a bug introduced
 in 3.2.1. Or am I doing something wrong?

Yes, it should work -- I'll fix this.  However, you shouldn't have to
manually use fast float now.  When you do plot([bv1,bv2],0,1), the
fast_float stuff will now (in 3.1.2) automatically get called in the
background.

--Mike

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

2008-09-25 Thread Mike Hansen

Hello,

On Thu, Sep 25, 2008 at 9:50 AM, pong [EMAIL PROTECTED] wrote:

 I'm still having problem in displaying the label of the edges using
 DiGraph. I have read more from this group and tried:

 G=DiGraph({1:{1:['hola','hi'], 2:['two','dos']},2:{1:['one']}},
 loops=True, multiedges=True)
 G.edges()
 [(1, 1, 'hi'), (1, 1, 'hola'), (1, 2, 'dos'), (1, 2, 'two'), (2, 1,
 'one')]

 G.show()

 I expect to see two loops from 1 to 1 labeled by 'hola' and 'hi',
 etc...
 but the result of G.show() only show one loop and no lables on the
 edges.

 Can someone tell me what am I missing?

You need to explicitly ask for edge labels to appear on the plot:

G.show(edge_labels=True)

The plotting code for graphs definitely needs some work, but luckily
there is someone working on it.  It looks like there is only one edge
and one loop since they are drawn directly over each other.  The same
thing is going on with the labels.  I hope we can get this fixed in
the next release or two.

--Mike

 Thanks in advance



 On Sep 23, 9:15 pm, pong [EMAIL PROTECTED] wrote:
 I tried one of the examples (example 3 inDiGraph?)

 g =DiGraph({0:{1:'x',2:'z',3:'a'}, 2:{5:'out'}},
 implementation='networkx'); show(g)

 However, I don't see any label of the edges, why?

 Also, I think theDiGraphfunction is very useful for drawing finite
 automata (thanks!) My question is: does it support loop to a node?
 (which is essential in drawing automata)
 


--~--~-~--~~~---~--~~
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-25 Thread cesarnda

I am using Kubuntu 8.04

On 25 sep, 07:39, cesarnda [EMAIL PROTECTED] wrote:
 --
 | SAGE Version 3.1.2, Release Date: 2008-09-19                       |
 | Typenotebook() for the GUI, and license() for information.        |
 --

 sage:notebook()
 Thenotebookfiles are stored in: /home/cesarnda/.sage//sage_notebook
 **
 *                                                *
 * Open your web browser tohttp://localhost:8000*
 *                                                *
 **
 2008-09-25 07:38:53-0500 [-] Log opened.
 2008-09-25 07:38:53-0500 [-] twistd 8.1.0 (/home/cesarnda/Sage/
 sage-3.0.6-i686-Linux/local/bin/python 2.5.2)startingup
 2008-09-25 07:38:53-0500 [-] reactor class: class
 'twisted.internet.selectreactor.SelectReactor'
 2008-09-25 07:38:53-0500 [-] twisted.web2.channel.http.HTTPFactorystartingon 
 8000
 2008-09-25 07:38:53-0500 [-]Startingfactory
 twisted.web2.channel.http.HTTPFactory instance at 0x8c274ac
 2008-09-25 07:38:57-0500 [HTTPChannel,1,127.0.0.1] /home/cesarnda/Sage/
 sage-3.0.6-i686-Linux/local/lib/python2.5/site-packages/Twisted-8.1.0-
 py2.5-linux-i686.egg/twisted/internet/defer.py:267:
 exceptions.DeprecationWarning: Don't pass strings (like 'Bad token')
 to failure.Failure (replacing with a DefaultException).
 2008-09-25 07:38:57-0500 [HTTPChannel,1,127.0.0.1] Exception
 rendering:
 2008-09-25 07:38:57-0500 [HTTPChannel,1,127.0.0.1] Unhandled Error
         Traceback (most recent call last):
         Failure: twisted.python.failure.DefaultException: Bad token

 On Sep 24, 7:32 pm, mabshoff [EMAIL PROTECTED]

 dortmund.de wrote:
  On Sep 24, 5:25 pm, cesarnda [EMAIL PROTECTED] wrote:

   so?

  What version of Sage are you using? What operating system are you on?
  Could you provide the complete log, i.e. the output from when you
  start Sage and then invoke thenotebook?

  Cheers,

  Michael

   On 23 sep, 01:35, cesarnda [EMAIL PROTECTED] wrote:

I start sage and I typenotebookand 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: a problem starting the notebook

2008-09-25 Thread mabshoff



On Sep 25, 10:09 am, cesarnda [EMAIL PROTECTED] wrote:
 I am using Kubuntu 8.04

 On 25 sep, 07:39, cesarnda [EMAIL PROTECTED] wrote:

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

  sage:notebook()
  Thenotebookfiles are stored in: /home/cesarnda/.sage//sage_notebook
  **
  *                                                *
  * Open your web browser tohttp://localhost:8000*
  *                                                *
  **
  2008-09-25 07:38:53-0500 [-] Log opened.
  2008-09-25 07:38:53-0500 [-] twistd 8.1.0 (/home/cesarnda/Sage/
  sage-3.0.6-i686-Linux/local/bin/python 2.5.2)startingup
  2008-09-25 07:38:53-0500 [-] reactor class: class
  'twisted.internet.selectreactor.SelectReactor'
  2008-09-25 07:38:53-0500 [-] 
  twisted.web2.channel.http.HTTPFactorystartingon 8000
  2008-09-25 07:38:53-0500 [-]Startingfactory
  twisted.web2.channel.http.HTTPFactory instance at 0x8c274ac
  2008-09-25 07:38:57-0500 [HTTPChannel,1,127.0.0.1] /home/cesarnda/Sage/
  sage-3.0.6-i686-Linux/local/lib/python2.5/site-packages/Twisted-8.1.0-
  py2.5-linux-i686.egg/twisted/internet/defer.py:267:
  exceptions.DeprecationWarning: Don't pass strings (like 'Bad token')
  to failure.Failure (replacing with a DefaultException).
  2008-09-25 07:38:57-0500 [HTTPChannel,1,127.0.0.1] Exception
  rendering:
  2008-09-25 07:38:57-0500 [HTTPChannel,1,127.0.0.1] Unhandled Error
          Traceback (most recent call last):
          Failure: twisted.python.failure.DefaultException: Bad token


Hmm, nothing obvious pops out. Can you move the .sage directory in
$HOME and see if the problem goes away?

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: question about DiGraph

2008-09-25 Thread pong

Thanks!!

A more general question, how can I find out all the possible options
for a command, like show for example?

I've tried show.option? which doesn't seem to work.

On Sep 25, 9:56 am, Mike Hansen [EMAIL PROTECTED] wrote:
 Hello,



 On Thu, Sep 25, 2008 at 9:50 AM, pong [EMAIL PROTECTED] wrote:

  I'm still having problem in displaying the label of the edges using
  DiGraph. I have read more from this group and tried:

  G=DiGraph({1:{1:['hola','hi'], 2:['two','dos']},2:{1:['one']}},
  loops=True, multiedges=True)
  G.edges()
  [(1, 1, 'hi'), (1, 1, 'hola'), (1, 2, 'dos'), (1, 2, 'two'), (2, 1,
  'one')]

  G.show()

  I expect to see two loops from 1 to 1 labeled by 'hola' and 'hi',
  etc...
  but the result of G.show() only show one loop and no lables on the
  edges.

  Can someone tell me what am I missing?

 You need to explicitly ask for edge labels to appear on the plot:

 G.show(edge_labels=True)

 The plotting code for graphs definitely needs some work, but luckily
 there is someone working on it.  It looks like there is only one edge
 and one loop since they are drawn directly over each other.  The same
 thing is going on with the labels.  I hope we can get this fixed in
 the next release or two.

 --Mike

  Thanks in advance

  On Sep 23, 9:15 pm, pong [EMAIL PROTECTED] wrote:
  I tried one of the examples (example 3 inDiGraph?)

  g =DiGraph({0:{1:'x',2:'z',3:'a'}, 2:{5:'out'}},
  implementation='networkx'); show(g)

  However, I don't see any label of the edges, why?

  Also, I think theDiGraphfunction is very useful for drawing finite
  automata (thanks!) My question is: does it support loop to a node?
  (which is essential in drawing automata)
--~--~-~--~~~---~--~~
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: Calculating mods

2008-09-25 Thread Robert Bradshaw

Or, if you want to do it in a single line (which does the same as the  
more explicit code below)

sage: mod(520622, 998171) ^ 430085
897985

On Sep 25, 2008, at 9:43 AM, John Cremona wrote:


 sage: 520622^430085 % 998171
 897985


 It is very much faster to do it more like this:
 sage: R=Integers(998171)
 sage: a=R(520622)
 sage: a^430085
 897985

 The first way (I think) computes 520622^430085 as an integer and then
 reduces, while the second way constructs the ring of integers mod
 998171, defines a as the residue of 520622 in that ring, and then
 exponentiates.

 John Cremona

 2008/9/25 Mikemak27 [EMAIL PROTECTED]:

 I am brand new to this. I was wondering how to calculate mods  
 while in
 the sage notebook. I need to calculate 520622^430085 mod 998171. Does
 anyone know how to type this into the command line. I keep getting a
 syntax error. I have no idea how to do this because I am brand new to
 sage. Thank you.




 


--~--~-~--~~~---~--~~
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: Windows: Where are worksheets stored?

2008-09-25 Thread mabshoff



On Sep 24, 1:27 pm, Jannick Asmus [EMAIL PROTECTED] wrote:
 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.

Hi,

the VMware application of Sage on Windows stores the worksheets just
like the native OSX and Linux versions in $HOME/.sage. Unfortunately
it is not possible yet to do a one step download and re-upload of all
worksheets, but that is an open issue to be fixed in the future. So
you can either down and upload them one by one (tedious for obvious
reasons) or use a tool like WinSCP to log into the running VMware
seesion and copy the .sage directory from the old to the new image.

Let us know if you have any more trouble.

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: Windows: Where are worksheets stored?

2008-09-25 Thread William Stein

On Thu, Sep 25, 2008 at 10:22 AM, mabshoff
[EMAIL PROTECTED] wrote:



 On Sep 24, 1:27 pm, Jannick Asmus [EMAIL PROTECTED] wrote:
 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.

 Hi,

 the VMware application of Sage on Windows stores the worksheets just
 like the native OSX and Linux versions in $HOME/.sage. Unfortunately
 it is not possible yet to do a one step download and re-upload of all
 worksheets, but that is an open issue to be fixed in the future. So
 you can either down and upload them one by one (tedious for obvious
 reasons) or use a tool like WinSCP to log into the running VMware
 seesion and copy the .sage directory from the old to the new image.

 Let us know if you have any more trouble.

Another option for people upgrading from sage-3.0.6 to sage-3.1.2
using the vmware image is just to do this:

(1) login to the vmware image using
   login: manage
(2) type at the prompt
   sudo su
(3) type
   sage -upgrade
(4) wait a few hours

It turns out that upgrading the vmware image from sage-3.0.6 to
sage-3.1.2 using the build from source automated method
works just fine.  (At least, it did for me.)

 -- 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: question about DiGraph

2008-09-25 Thread Jason Grout

Mike Hansen wrote:
 Hello,
 
 On Thu, Sep 25, 2008 at 9:50 AM, pong [EMAIL PROTECTED] wrote:
 I'm still having problem in displaying the label of the edges using
 DiGraph. I have read more from this group and tried:

 G=DiGraph({1:{1:['hola','hi'], 2:['two','dos']},2:{1:['one']}},
 loops=True, multiedges=True)
 G.edges()
 [(1, 1, 'hi'), (1, 1, 'hola'), (1, 2, 'dos'), (1, 2, 'two'), (2, 1,
 'one')]

 G.show()

 I expect to see two loops from 1 to 1 labeled by 'hola' and 'hi',
 etc...
 but the result of G.show() only show one loop and no lables on the
 edges.

 Can someone tell me what am I missing?
 
 You need to explicitly ask for edge labels to appear on the plot:
 
 G.show(edge_labels=True)
 
 The plotting code for graphs definitely needs some work, but luckily
 there is someone working on it.  It looks like there is only one edge
 and one loop since they are drawn directly over each other.  The same
 thing is going on with the labels.  I hope we can get this fixed in
 the next release or two.


Who is working on it?

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] Re: Windows: Where are worksheets stored?

2008-09-25 Thread Jason Grout

mabshoff wrote:
 
 
 On Sep 24, 1:27 pm, Jannick Asmus [EMAIL PROTECTED] wrote:
 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.
 
 Hi,
 
 the VMware application of Sage on Windows stores the worksheets just
 like the native OSX and Linux versions in $HOME/.sage. Unfortunately
 it is not possible yet to do a one step download and re-upload of all
 worksheets, but that is an open issue to be fixed in the future. So
 you can either down and upload them one by one (tedious for obvious
 reasons) or use a tool like WinSCP to log into the running VMware
 seesion and copy the .sage directory from the old to the new image.


I think it's actually in /home/notebook/sage_notebook for the VMWARE 
image, if you launch the notebook by typing notebook at the prompt.

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] Re: Seg fault with determinant calculation

2008-09-25 Thread phil



On Sep 22, 4:23 pm, phil [EMAIL PROTECTED] wrote:
 On Sep 15, 10:26 am, Martin Albrecht [EMAIL PROTECTED]
 wrote:
   The original machine I was using was needed for other things.  So, I
 ran it on sage 3.1.2rc4 on sage.math.washington.edu and it completed
 successfully after 169446 seconds.  So, the problem was specific to
 the setup I was using or it was fixed in 3.1.2rc4.
   The scaling of the problem seems worse than it should be though.
 The 9x9 problem takes 40 seconds while the 10x0 problem takes 4236
 times longer.  That's worse than O(n!) let along O(n^3).
   If your curious, the test problem is 
 athttp://sage.math.washington.edu/home/fongpwf/sage_work/determinant_10...

One more thing I've noticed is that loading the saved result either
doesn't work is is extremely inefficient.  On Monday, I started up
3.1.2 final and ran load detMp.sobj.   It's been rough 3 days and
it's still going.  This means loading takes longer than the original
computation.

Phil
--~--~-~--~~~---~--~~
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: saving worksheets?

2008-09-25 Thread mabshoff

On Sep 25, 3:19 pm, RayKiddy [EMAIL PROTECTED] wrote:

Hi,

 This seems pretty basic, but I am having issues with deleting
 worksheets and then not having them pop up again.

 Yes, I could read a few hundred pages of manuals, but how hard should
 this be. I followed the instructions for installing sage on Mac OS X
 (10.4.11) and that works. So I do:

 % ./sage
 --
 | SAGE Version 3.1.1, Release Date: 2008-08-17                       |
 | Type notebook() for the GUI, and license() for information.        |
 --
 sage: notebook()
 The notebook files are stored in: /Users/ray/.sage//sage_notebook
 **
 *                                                *
 * Open your web browser tohttp://localhost:8000*
 *                                                *
 **

 So, I click on the checkbox next to one of the worksheets and hit the
 Delete button. I click on the Log out link. Now, I see this on
 sage's console:

 2008-09-25 15:06:15-0700 [-] Log opened.
 2008-09-25 15:06:15-0700 [-] twistd 8.0.1 (/Users/ray/Applications/
 sage/local/bin/python 2.5.2) starting up
 2008-09-25 15:06:15-0700 [-] reactor class: class
 'twisted.internet.selectreactor.SelectReactor'
 2008-09-25 15:06:15-0700 [-] twisted.web2.channel.http.HTTPFactory
 starting on 8000
 2008-09-25 15:06:15-0700 [-] Starting factory
 twisted.web2.channel.http.HTTPFactory instance at 0x38234b8
 2008-09-25 15:08:05-0700 [HTTPChannel,1,127.0.0.1]

 I never get back to a prompt? How do I? The only way I have found is
 to type a ^C.

 ^C2008-09-25 15:15:15-0700 [-] Saving notebook...
 2008-09-25 15:15:15-0700 [-] Saving notebook...
 2008-09-25 15:15:15-0700 [-] Notebook cleanly saved.
 2008-09-25 15:15:15-0700 [-] Notebook cleanly saved.
 2008-09-25 15:15:15-0700 [-] Main loop terminated.
 2008-09-25 15:15:15-0700 [-] Server Shut Down.
 True
 sage: quit
 Exiting SAGE (CPU time 0m0.03s, Wall time 9m15.28s).
 %

 Hm. Looks as though it saved. I re-start sage and there it is. The
 worksheet I thought I deleted is back.

This was a bug fixed in the 3.1.2 release. There is no 3.1.2 binary
for OSX 10.4 PPC yet, but there should be in the not too distant
future.

 So, I see a Delete button, a Save button, a Save  Quit button.
 I have tried all of these. No effect. Is there a Delete Really
 button? Where is it? I tried to get back to the sage: prompt with a
 ^D. What else should I try? ^X-elbow-Z? What is the magic word for
 getting it to do this rather obvious thing?

 If someone can explain it, I can find a rather obvious place to put
 this info in the documentation. I found several obvious places, and no
 documentation. Thanks.

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: saving worksheets?

2008-09-25 Thread mabshoff



On Sep 25, 3:35 pm, mabshoff [EMAIL PROTECTED]
dortmund.de wrote:
 On Sep 25, 3:19 pm, RayKiddy [EMAIL PROTECTED] wrote:

 Hi,



  This seems pretty basic, but I am having issues with deleting
  worksheets and then not having them pop up again.

  Yes, I could read a few hundred pages of manuals, but how hard should
  this be. I followed the instructions for installing sage on Mac OS X
  (10.4.11) and that works. So I do:

  % ./sage
  --
  | SAGE Version 3.1.1, Release Date: 2008-08-17                       |
  | Type notebook() for the GUI, and license() for information.        |
  --
  sage: notebook()
  The notebook files are stored in: /Users/ray/.sage//sage_notebook
  **
  *                                                *
  * Open your web browser tohttp://localhost:8000*
  *                                                *
  **

  So, I click on the checkbox next to one of the worksheets and hit the
  Delete button. I click on the Log out link. Now, I see this on
  sage's console:

  2008-09-25 15:06:15-0700 [-] Log opened.
  2008-09-25 15:06:15-0700 [-] twistd 8.0.1 (/Users/ray/Applications/
  sage/local/bin/python 2.5.2) starting up
  2008-09-25 15:06:15-0700 [-] reactor class: class
  'twisted.internet.selectreactor.SelectReactor'
  2008-09-25 15:06:15-0700 [-] twisted.web2.channel.http.HTTPFactory
  starting on 8000
  2008-09-25 15:06:15-0700 [-] Starting factory
  twisted.web2.channel.http.HTTPFactory instance at 0x38234b8
  2008-09-25 15:08:05-0700 [HTTPChannel,1,127.0.0.1]

  I never get back to a prompt? How do I? The only way I have found is
  to type a ^C.

[Sorry for the double post, but I missed to answer this one]

When you start the notebook you do not get back the prompt. I do not
know why, but I guess there is a good reason :)

  ^C2008-09-25 15:15:15-0700 [-] Saving notebook...
  2008-09-25 15:15:15-0700 [-] Saving notebook...
  2008-09-25 15:15:15-0700 [-] Notebook cleanly saved.
  2008-09-25 15:15:15-0700 [-] Notebook cleanly saved.
  2008-09-25 15:15:15-0700 [-] Main loop terminated.
  2008-09-25 15:15:15-0700 [-] Server Shut Down.
  True
  sage: quit
  Exiting SAGE (CPU time 0m0.03s, Wall time 9m15.28s).
  %

  Hm. Looks as though it saved. I re-start sage and there it is. The
  worksheet I thought I deleted is back.

 This was a bug fixed in the 3.1.2 release. There is no 3.1.2 binary
 for OSX 10.4 PPC yet, but there should be in the not too distant
 future.

  So, I see a Delete button, a Save button, a Save  Quit button.
  I have tried all of these. No effect. Is there a Delete Really
  button? Where is it? I tried to get back to the sage: prompt with a
  ^D. What else should I try? ^X-elbow-Z? What is the magic word for
  getting it to do this rather obvious thing?

  If someone can explain it, I can find a rather obvious place to put
  this info in the documentation. I found several obvious places, and no
  documentation. Thanks.

 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] lists in cython

2008-09-25 Thread cesarnda

in http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/ there is
the following example:

def primes(int kmax):
  cdef int n, k, i
  cdef int p[1000]
  result = []
  if kmax  1000:
kmax = 1000
  k = 0
  n = 2
  while k  kmax:
i = 0
while i  k and n % p[i]  0:
  i = i + 1
if i == k:
  p[k] = n
  k = k + 1
  result.append(n)
n = n + 1
  return result

if I compile in the notebook I get a html file showing me the
following lines in yellow:

def primes(int kmax):
result = []
result.append(n)
return result

how can I modify this example to avoid the yellow lines?
--~--~-~--~~~---~--~~
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] saving worksheets?

2008-09-25 Thread RayKiddy


This seems pretty basic, but I am having issues with deleting
worksheets and then not having them pop up again.

Yes, I could read a few hundred pages of manuals, but how hard should
this be. I followed the instructions for installing sage on Mac OS X
(10.4.11) and that works. So I do:

% ./sage
--
| SAGE Version 3.1.1, Release Date: 2008-08-17   |
| Type notebook() for the GUI, and license() for information.|
--
sage: notebook()
The notebook files are stored in: /Users/ray/.sage//sage_notebook
**
**
* Open your web browser to http://localhost:8000 *
**
**

So, I click on the checkbox next to one of the worksheets and hit the
Delete button. I click on the Log out link. Now, I see this on
sage's console:

2008-09-25 15:06:15-0700 [-] Log opened.
2008-09-25 15:06:15-0700 [-] twistd 8.0.1 (/Users/ray/Applications/
sage/local/bin/python 2.5.2) starting up
2008-09-25 15:06:15-0700 [-] reactor class: class
'twisted.internet.selectreactor.SelectReactor'
2008-09-25 15:06:15-0700 [-] twisted.web2.channel.http.HTTPFactory
starting on 8000
2008-09-25 15:06:15-0700 [-] Starting factory
twisted.web2.channel.http.HTTPFactory instance at 0x38234b8
2008-09-25 15:08:05-0700 [HTTPChannel,1,127.0.0.1]

I never get back to a prompt? How do I? The only way I have found is
to type a ^C.

^C2008-09-25 15:15:15-0700 [-] Saving notebook...
2008-09-25 15:15:15-0700 [-] Saving notebook...
2008-09-25 15:15:15-0700 [-] Notebook cleanly saved.
2008-09-25 15:15:15-0700 [-] Notebook cleanly saved.
2008-09-25 15:15:15-0700 [-] Main loop terminated.
2008-09-25 15:15:15-0700 [-] Server Shut Down.
True
sage: quit
Exiting SAGE (CPU time 0m0.03s, Wall time 9m15.28s).
%

Hm. Looks as though it saved. I re-start sage and there it is. The
worksheet I thought I deleted is back.

So, I see a Delete button, a Save button, a Save  Quit button.
I have tried all of these. No effect. Is there a Delete Really
button? Where is it? I tried to get back to the sage: prompt with a
^D. What else should I try? ^X-elbow-Z? What is the magic word for
getting it to do this rather obvious thing?

If someone can explain it, I can find a rather obvious place to put
this info in the documentation. I found several obvious places, and no
documentation. Thanks.

--~--~-~--~~~---~--~~
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: saving worksheets?

2008-09-25 Thread Jason Grout

mabshoff wrote:
 On Sep 25, 3:19 pm, RayKiddy [EMAIL PROTECTED] wrote:
 
 Hi,
 
 This seems pretty basic, but I am having issues with deleting
 worksheets and then not having them pop up again.

 Yes, I could read a few hundred pages of manuals, but how hard should
 this be. I followed the instructions for installing sage on Mac OS X
 (10.4.11) and that works. So I do:

 % ./sage
 --
 | SAGE Version 3.1.1, Release Date: 2008-08-17   |
 | Type notebook() for the GUI, and license() for information.|
 --
 sage: notebook()
 The notebook files are stored in: /Users/ray/.sage//sage_notebook
 **
 **
 * Open your web browser tohttp://localhost:8000*
 **
 **

 So, I click on the checkbox next to one of the worksheets and hit the
 Delete button. I click on the Log out link. Now, I see this on
 sage's console:

 2008-09-25 15:06:15-0700 [-] Log opened.
 2008-09-25 15:06:15-0700 [-] twistd 8.0.1 (/Users/ray/Applications/
 sage/local/bin/python 2.5.2) starting up
 2008-09-25 15:06:15-0700 [-] reactor class: class
 'twisted.internet.selectreactor.SelectReactor'
 2008-09-25 15:06:15-0700 [-] twisted.web2.channel.http.HTTPFactory
 starting on 8000
 2008-09-25 15:06:15-0700 [-] Starting factory
 twisted.web2.channel.http.HTTPFactory instance at 0x38234b8
 2008-09-25 15:08:05-0700 [HTTPChannel,1,127.0.0.1]

 I never get back to a prompt? How do I? The only way I have found is
 to type a ^C.

 ^C2008-09-25 15:15:15-0700 [-] Saving notebook...
 2008-09-25 15:15:15-0700 [-] Saving notebook...
 2008-09-25 15:15:15-0700 [-] Notebook cleanly saved.
 2008-09-25 15:15:15-0700 [-] Notebook cleanly saved.
 2008-09-25 15:15:15-0700 [-] Main loop terminated.
 2008-09-25 15:15:15-0700 [-] Server Shut Down.
 True
 sage: quit
 Exiting SAGE (CPU time 0m0.03s, Wall time 9m15.28s).
 %

 Hm. Looks as though it saved. I re-start sage and there it is. The
 worksheet I thought I deleted is back.
 
 This was a bug fixed in the 3.1.2 release. There is no 3.1.2 binary
 for OSX 10.4 PPC yet, but there should be in the not too distant
 future.


I installed it from a binary on Monday on an OSX 10.4 PPC laptop.  See 
http://sagemath.org/bin/apple_osx/powerpc/

It is pretty clearly labeled 3.1.2, osx 10.4, PPC.


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] Two Dimensional Plots

2008-09-25 Thread [EMAIL PROTECTED]

I'm working my way through the tutorial and I'm having a problem with
one of them. 2.5.1 at this page http://www.sagemath.org/doc/tut/node18.html
has a circle plot, but I keep getting an ellipse on my screen because
it's y axis is not at the same resolution as the x axis. It has the
command:

sage: circle((0,0), 1, rgbcolor=(1,1,0))


I found the discussion about another part of the tutorial here:
http://groups.google.com/group/sage-support/browse_thread/thread/37c90df86e60e809/aa4287cee9f31ce2?lnk=gstq=circle+plot#aa4287cee9f31ce2

(Sorry for the long link.)

When I use the suggestions in that thread it gives me a filled circle,
not an ellipse. Is there anything I can do to make the first command
listed above work? Why isn't the default to produce a circle when a
circle is asked for, rather than an ellipse?

I'm really not trying to complain, I LOVE the program so far! But this
operation as default doesn't make any sense to me.

I'm using sagenb.org as I go through the tutorial, if that matters.

Thanks!
Erik

--~--~-~--~~~---~--~~
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: Two Dimensional Plots

2008-09-25 Thread Mike Hansen

Hi Erik,

On Thu, Sep 25, 2008 at 5:05 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 I'm working my way through the tutorial and I'm having a problem with
 one of them. 2.5.1 at this page http://www.sagemath.org/doc/tut/node18.html
 has a circle plot, but I keep getting an ellipse on my screen because
 it's y axis is not at the same resolution as the x axis. It has the
 command:

 sage: circle((0,0), 1, rgbcolor=(1,1,0))

You want to show the image with an aspect ratio of one:

sage: c = circle((0,0), 1, rgbcolor=(1,1,0))
sage: c.show(aspect_ratio=1)


--Mike

--~--~-~--~~~---~--~~
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: Two Dimensional Plots

2008-09-25 Thread Erik Lane

Yes, I saw that in the solution of the other one (and have changed my
plots to take this into account), but what is the advantage of the
aspect ratio default *not* being 1? I'm very curious. I'm not a
mathematician, just a student going through college, so I would love
to hear the why behind this.

Also, does this have much of an effect on all my other plots? Do I
have to pay attention every time to see if the axes are at different
ratios to each other? (Although in many plots I guess they easily
could be anyways.)

Thanks,
Erik

On Thu, Sep 25, 2008 at 5:11 PM, Mike Hansen [EMAIL PROTECTED] wrote:

 Hi Erik,

 On Thu, Sep 25, 2008 at 5:05 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 I'm working my way through the tutorial and I'm having a problem with
 one of them. 2.5.1 at this page http://www.sagemath.org/doc/tut/node18.html
 has a circle plot, but I keep getting an ellipse on my screen because
 it's y axis is not at the same resolution as the x axis. It has the
 command:

 sage: circle((0,0), 1, rgbcolor=(1,1,0))

 You want to show the image with an aspect ratio of one:

 sage: c = circle((0,0), 1, rgbcolor=(1,1,0))
 sage: c.show(aspect_ratio=1)


 --Mike

 


--~--~-~--~~~---~--~~
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 do: is_Integer(sqrt(a^2+b^2))

2008-09-25 Thread Quicksilver_Johny

If c=sqrt(a^2+b^2)
How would I check if c is an integer in order to get a true/false
value.
I tried is_Integer(ZZ(c)), this returns true when c is an integer, but
ZZ(c) returns an error when c is not an integer.
--~--~-~--~~~---~--~~
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 do: is_Integer(sqrt(a^2+b^2))

2008-09-25 Thread William Stein

On Thu, Sep 25, 2008 at 5:33 PM, Quicksilver_Johny
[EMAIL PROTECTED] wrote:

 If c=sqrt(a^2+b^2)
 How would I check if c is an integer in order to get a true/false
 value.
 I tried is_Integer(ZZ(c)), this returns true when c is an integer, but
 ZZ(c) returns an error when c is not an integer.

Try using Python's try/except:

try:
ZZ(c)
# c is an integer
except TypeError:
# c isn't an integer

--~--~-~--~~~---~--~~
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: saving worksheets?

2008-09-25 Thread Ray Kiddy


Ok. But I have an Intel Mac OS X machine. Sorry I did not say. I will  
look for binaries.

cheers - ray

On Sep 25, 2008, at 4:17 PM, Jason Grout wrote:


 mabshoff wrote:
 On Sep 25, 3:19 pm, RayKiddy [EMAIL PROTECTED] wrote:

 Hi,

 This seems pretty basic, but I am having issues with deleting
 worksheets and then not having them pop up again.

 Yes, I could read a few hundred pages of manuals, but how hard  
 should
 this be. I followed the instructions for installing sage on Mac OS X
 (10.4.11) and that works. So I do:

 % ./sage
  
 --
 | SAGE Version 3.1.1, Release Date:  
 2008-08-17   |
 | Type notebook() for the GUI, and license() for  
 information.|
  
 --
 sage: notebook()
 The notebook files are stored in: /Users/ray/.sage//sage_notebook
 **
 **
 * Open your web browser tohttp://localhost:8000*
 **
 **

 So, I click on the checkbox next to one of the worksheets and hit  
 the
 Delete button. I click on the Log out link. Now, I see this on
 sage's console:

 2008-09-25 15:06:15-0700 [-] Log opened.
 2008-09-25 15:06:15-0700 [-] twistd 8.0.1 (/Users/ray/Applications/
 sage/local/bin/python 2.5.2) starting up
 2008-09-25 15:06:15-0700 [-] reactor class: class
 'twisted.internet.selectreactor.SelectReactor'
 2008-09-25 15:06:15-0700 [-] twisted.web2.channel.http.HTTPFactory
 starting on 8000
 2008-09-25 15:06:15-0700 [-] Starting factory
 twisted.web2.channel.http.HTTPFactory instance at 0x38234b8
 2008-09-25 15:08:05-0700 [HTTPChannel,1,127.0.0.1]

 I never get back to a prompt? How do I? The only way I have found is
 to type a ^C.

 ^C2008-09-25 15:15:15-0700 [-] Saving notebook...
 2008-09-25 15:15:15-0700 [-] Saving notebook...
 2008-09-25 15:15:15-0700 [-] Notebook cleanly saved.
 2008-09-25 15:15:15-0700 [-] Notebook cleanly saved.
 2008-09-25 15:15:15-0700 [-] Main loop terminated.
 2008-09-25 15:15:15-0700 [-] Server Shut Down.
 True
 sage: quit
 Exiting SAGE (CPU time 0m0.03s, Wall time 9m15.28s).
 %

 Hm. Looks as though it saved. I re-start sage and there it is. The
 worksheet I thought I deleted is back.

 This was a bug fixed in the 3.1.2 release. There is no 3.1.2 binary
 for OSX 10.4 PPC yet, but there should be in the not too distant
 future.


 I installed it from a binary on Monday on an OSX 10.4 PPC laptop.  See
 http://sagemath.org/bin/apple_osx/powerpc/

 It is pretty clearly labeled 3.1.2, osx 10.4, PPC.


 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] Re: How to do: is_Integer(sqrt(a^2+b^2))

2008-09-25 Thread Robert Bradshaw


On Sep 25, 2008, at 5:43 PM, William Stein wrote:


 On Thu, Sep 25, 2008 at 5:33 PM, Quicksilver_Johny
 [EMAIL PROTECTED] wrote:

 If c=sqrt(a^2+b^2)
 How would I check if c is an integer in order to get a true/false
 value.
 I tried is_Integer(ZZ(c)), this returns true when c is an integer,  
 but
 ZZ(c) returns an error when c is not an integer.

 Try using Python's try/except:

 try:
 ZZ(c)
 # c is an integer
 except TypeError:
 # c isn't an integer

These is_* sure are causing a lot of confusion lately...

Rational numbers also have an is_integral method, so you could also do

c=sqrt(a^2+b^2)
if c.is_integral():
# c is an integer

- 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: lists in cython

2008-09-25 Thread cesarnda

why the line:

def primes(int kmax):

is in yellow?

On Sep 25, 8:03 pm, Robert Bradshaw [EMAIL PROTECTED]
wrote:
 On Sep 25, 2008, at 3:45 PM, cesarnda wrote:





  inhttp://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/there is
  the following example:

  def primes(int kmax):
    cdef int n, k, i
    cdef int p[1000]
    result = []
    if kmax  1000:
      kmax = 1000
    k = 0
    n = 2
    while k  kmax:
      i = 0
      while i  k and n % p[i]  0:
        i = i + 1
      if i == k:
        p[k] = n
        k = k + 1
        result.append(n)
      n = n + 1
    return result

  if I compile in the notebook I get a html file showing me the
  following lines in yellow:

  def primes(int kmax):
  result = []
  result.append(n)
  return result

  how can I modify this example to avoid the yellow lines?

 You can't, but they're not very yellow (i.e. there's not really a  
 faster way of doing those operations).

 - 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] from lists to sets

2008-09-25 Thread cesarnda

is there a function that can convert a list to a set without verifying
if there are equal elements?, i.e., I am creating a large set
(cardinality = 9^5) of vectors, so the constructions takes too long
( around 25 seconds), but I know all the vectors are distinct, so is
there a way to add an element into a set without verifying if the
element is already in the set? or
--~--~-~--~~~---~--~~
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: saving worksheets?

2008-09-25 Thread Erik Lane

That same site has Intel binaries as well.

http://sagemath.org/bin/apple_osx/intel/

Erik

On Thu, Sep 25, 2008 at 6:05 PM, Ray Kiddy [EMAIL PROTECTED] wrote:


 Ok. But I have an Intel Mac OS X machine. Sorry I did not say. I will
 look for binaries.

 cheers - ray

 On Sep 25, 2008, at 4:17 PM, Jason Grout wrote:


 mabshoff wrote:
 On Sep 25, 3:19 pm, RayKiddy [EMAIL PROTECTED] wrote:

 Hi,

 This seems pretty basic, but I am having issues with deleting
 worksheets and then not having them pop up again.

 Yes, I could read a few hundred pages of manuals, but how hard
 should
 this be. I followed the instructions for installing sage on Mac OS X
 (10.4.11) and that works. So I do:

 % ./sage
 
 --
 | SAGE Version 3.1.1, Release Date:
 2008-08-17   |
 | Type notebook() for the GUI, and license() for
 information.|
 
 --
 sage: notebook()
 The notebook files are stored in: /Users/ray/.sage//sage_notebook
 **
 **
 * Open your web browser tohttp://localhost:8000*
 **
 **

 So, I click on the checkbox next to one of the worksheets and hit
 the
 Delete button. I click on the Log out link. Now, I see this on
 sage's console:

 2008-09-25 15:06:15-0700 [-] Log opened.
 2008-09-25 15:06:15-0700 [-] twistd 8.0.1 (/Users/ray/Applications/
 sage/local/bin/python 2.5.2) starting up
 2008-09-25 15:06:15-0700 [-] reactor class: class
 'twisted.internet.selectreactor.SelectReactor'
 2008-09-25 15:06:15-0700 [-] twisted.web2.channel.http.HTTPFactory
 starting on 8000
 2008-09-25 15:06:15-0700 [-] Starting factory
 twisted.web2.channel.http.HTTPFactory instance at 0x38234b8
 2008-09-25 15:08:05-0700 [HTTPChannel,1,127.0.0.1]

 I never get back to a prompt? How do I? The only way I have found is
 to type a ^C.

 ^C2008-09-25 15:15:15-0700 [-] Saving notebook...
 2008-09-25 15:15:15-0700 [-] Saving notebook...
 2008-09-25 15:15:15-0700 [-] Notebook cleanly saved.
 2008-09-25 15:15:15-0700 [-] Notebook cleanly saved.
 2008-09-25 15:15:15-0700 [-] Main loop terminated.
 2008-09-25 15:15:15-0700 [-] Server Shut Down.
 True
 sage: quit
 Exiting SAGE (CPU time 0m0.03s, Wall time 9m15.28s).
 %

 Hm. Looks as though it saved. I re-start sage and there it is. The
 worksheet I thought I deleted is back.

 This was a bug fixed in the 3.1.2 release. There is no 3.1.2 binary
 for OSX 10.4 PPC yet, but there should be in the not too distant
 future.


 I installed it from a binary on Monday on an OSX 10.4 PPC laptop.  See
 http://sagemath.org/bin/apple_osx/powerpc/

 It is pretty clearly labeled 3.1.2, osx 10.4, PPC.


 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] Re: Multiline output in notebook

2008-09-25 Thread William Stein

D. M. Monarres wrote:
 Hello all,
 
 my advisor has a question in the sage notebook that I haven't really  
 thought about (as I use the cmd line more often)
 
 Is there a way in a single notebook cell to display multiple output. ie
 
 cell
 17
 28
 19
 cell
 
 Out: 19
 
 where he would like
 
 cell
 17
 28
 19
 cell
 Out: 17
 Out: 28
 Out: 19
 
 The only way I thought of is to have all on one line separated by  
 commas.
 

This as input:

print 17
print 28
print 19

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: lists in cython

2008-09-25 Thread Jason Grout

cesarnda wrote:
 why the line:
 
 def primes(int kmax):
 
 is in yellow?


If you click on the line, you can see the actual C code that Cython 
generated for you.  Doing that, you'll notice that there are quite a few 
more python calls stemming from yellow lines than the white lines.  The 
more yellow a line is, the slower it will probably run because it is 
doing more python stuff than just straight C stuff.  Some python stuff 
is unavoidable, though, like the def statement above.

Note that the coloring of the lines is heuristic; it's not a guarantee 
that those lines are the ones that are running slowly.  But it does help 
quite a bit if you want to speed up your code: make sure that the inner 
loops don't have very much yellow in them.

Personally, I think the coloring of the lines and the ability to click 
on them is one of the neatest features about developing cython in the 
notebook.

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] Re: from lists to sets

2008-09-25 Thread Jason Grout

cesarnda wrote:
 is there a function that can convert a list to a set without verifying
 if there are equal elements?, i.e., I am creating a large set
 (cardinality = 9^5) of vectors, so the constructions takes too long
 ( around 25 seconds), but I know all the vectors are distinct, so is
 there a way to add an element into a set without verifying if the
 element is already in the set? or

What sort of sets are you using?  The python sets use a dictionary, so 
it is generally very fast to see if an element already exists in the set.

If you know everything is distinct, why don't you just keep it as a list?

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] Multiline output in notebook

2008-09-25 Thread D. M. Monarres

Hello all,

my advisor has a question in the sage notebook that I haven't really  
thought about (as I use the cmd line more often)

Is there a way in a single notebook cell to display multiple output. ie

cell
17
28
19
cell

Out: 19

where he would like

cell
17
28
19
cell
Out: 17
Out: 28
Out: 19

The only way I thought of is to have all on one line separated by  
commas.



--
David Monarres
[EMAIL PROTECTED]

Nothing takes the taste out of peanut butter quite like unrequited love.
 -- Charlie Brown


--~--~-~--~~~---~--~~
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: from lists to sets

2008-09-25 Thread cesarnda

I am using the set([]) function, and is a set of vectors, I want to
convert it to a set because I want to use the methods for sets

On Sep 25, 9:09 pm, Jason Grout [EMAIL PROTECTED] wrote:
 cesarnda wrote:
  is there a function that can convert a list to a set without verifying
  if there are equal elements?, i.e., I am creating a large set
  (cardinality = 9^5) of vectors, so the constructions takes too long
  ( around 25 seconds), but I know all the vectors are distinct, so is
  there a way to add an element into a set without verifying if the
  element is already in the set? or

 What sort of sets are you using?  The python sets use a dictionary, so
 it is generally very fast to see if an element already exists in the set.

 If you know everything is distinct, why don't you just keep it as a list?

 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] Re: Seg fault with determinant calculation

2008-09-25 Thread mabshoff



On Sep 25, 12:34 pm, phil [EMAIL PROTECTED] wrote:

Hi,

I did valgrind a couple of the example sessions you gave for various n
(n=4,5 and 8 IIRC) and the good news is that there are no leaks going
on and Singular does not seem to do anything  naughty.

 One more thing I've noticed is that loading the saved result either
 doesn't work is is extremely inefficient.  On Monday, I started up
 3.1.2 final and ran load detMp.sobj.   It's been rough 3 days and
 it's still going.  This means loading takes longer than the original
 computation.

Yeah, pickling for those matrices over the mv polynomial ring probably
uses generic code and hence sucks speed wise. If malb or anyone else
familiar with that are of the code agrees please open a ticket so we
remember to fix this.

 Phil

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