[sage-support] Re: sage -wiki not starting

2008-09-23 Thread Adam Webb


  ^^^ This is some sort of permission error. Are you running SELinux or
  something like that?


Just to confirm. SELinux was added to the computer. I am now
'negotiating' with IT. :-)

cheers,
Adam
--~--~-~--~~~---~--~~
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] working with rings

2008-09-23 Thread cesarnda

If I do:

sage: MS = MatrixSpace(IntegerModRing(9), 5,5)
sage: G = MS([[5, 0, 0, 0, 4],[4, 5, 0, 0, 0],[0, 4, 5, 0, 0],[0, 0,4,
5, 0], [0, 0, 0, 4, 5]])
sage: G.base_ring()
Ring of integers modulo 9

is there a way to get the base ring as an integer?, i.e. I want to
know the base ring to work with it in a cython program,let's say I
want to do arithmetic with the base ring 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] a problem starting the notebook

2008-09-23 Thread cesarnda

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 to http://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: working with rings

2008-09-23 Thread Mike Hansen

Hello,
On Mon, Sep 22, 2008 at 11:34 PM, cesarnda [EMAIL PROTECTED] wrote:

 If I do:

 sage: MS = MatrixSpace(IntegerModRing(9), 5,5)
 sage: G = MS([[5, 0, 0, 0, 4],[4, 5, 0, 0, 0],[0, 4, 5, 0, 0],[0, 0,4,
 5, 0], [0, 0, 0, 4, 5]])
 sage: G.base_ring()
 Ring of integers modulo 9

 is there a way to get the base ring as an integer?

Do you mean you want the matrix as a matrix over the integers rather
than over the integers mod 9?  If so, then you can do the following:

sage: H = G.change_ring(ZZ); H

[5 0 0 0 4]
[4 5 0 0 0]
[0 4 5 0 0]
[0 0 4 5 0]
[0 0 0 4 5]
sage: H.base_ring()
Integer Ring

--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: Mercurial problems in 3.1.2

2008-09-23 Thread Justin C. Walker


On Sep 22, 2008, at 22:24 , mabshoff wrote:

 Nope, none of those fixes is in alpha0, but I hope that at least some
 of them will make it into alpha1, due out late tomorrow. I still don't
 see how parallel make impacts numpy, so if you could send me the
 portion of the blown up numpy build with parallel make I could attempt
 to figure out what is wrong.

See
   sage.math.washington.edu:~justin/logs/sage-numpy.log
(the whole shebang; maybe something early on triggered it :-}).

Justin

--
Justin C. Walker, Curmudgeon-At-Large
Institute for the Enhancement of the Director's Income

When LuteFisk is outlawed,
Only outlaws will have LuteFisk





--~--~-~--~~~---~--~~
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 -wiki not starting

2008-09-23 Thread mabshoff



On Sep 22, 11:32 pm, Adam Webb [EMAIL PROTECTED] wrote:
   ^^^ This is some sort of permission error. Are you running SELinux or
   something like that?

Hi Adam,

 Just to confirm. SELinux was added to the computer. I am now
 'negotiating' with IT. :-)

good luck negotiating :). You can relabel all the files so that Sage
and SELinux can play well together, but adding new pages to the wiki
might prove difficult since those new files need to inherit the right
ACLs.

 cheers,
 Adam

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: working with rings

2008-09-23 Thread Robert Bradshaw

On Sep 22, 2008, at 11:37 PM, Mike Hansen wrote:


 Hello,
 On Mon, Sep 22, 2008 at 11:34 PM, cesarnda [EMAIL PROTECTED] wrote:

 If I do:

 sage: MS = MatrixSpace(IntegerModRing(9), 5,5)
 sage: G = MS([[5, 0, 0, 0, 4],[4, 5, 0, 0, 0],[0, 4, 5, 0, 0],[0,  
 0,4,
 5, 0], [0, 0, 0, 4, 5]])
 sage: G.base_ring()
 Ring of integers modulo 9

 is there a way to get the base ring as an integer?

 Do you mean you want the matrix as a matrix over the integers rather
 than over the integers mod 9?  If so, then you can do the following:

 sage: H = G.change_ring(ZZ); H

 [5 0 0 0 4]
 [4 5 0 0 0]
 [0 4 5 0 0]
 [0 0 4 5 0]
 [0 0 0 4 5]
 sage: H.base_ring()
 Integer Ring

Or, if you meant the modulus of the ring, you can get that with

sage: G.base_ring().order()
9

- 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: Mercurial problems in 3.1.2

2008-09-23 Thread mabshoff



On Sep 22, 11:39 pm, Justin C. Walker [EMAIL PROTECTED] wrote:
 On Sep 22, 2008, at 22:24 , mabshoff wrote:

  Nope, none of those fixes is in alpha0, but I hope that at least some
  of them will make it into alpha1, due out late tomorrow. I still don't
  see how parallel make impacts numpy, so if you could send me the
  portion of the blown up numpy build with parallel make I could attempt
  to figure out what is wrong.

 See
    sage.math.washington.edu:~justin/logs/sage-numpy.log
 (the whole shebang; maybe something early on triggered it :-}).

Thanks. Numpy is complaining about a missing math module, but I think
that is more likely caused by the libpng.dylib disaster than anything
else. I just checked the python.spkg and we are running make install
with parallel make, which I would guess is not a good idea :)

The ticket for that issue is #4174 and there should be an spkg
shortly.

 Justin


Cheers,

Michael
 --
 Justin C. Walker, Curmudgeon-At-Large
 Institute for the Enhancement of the Director's Income
 
 When LuteFisk is outlawed,
 Only outlaws will have LuteFisk
 
--~--~-~--~~~---~--~~
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: Suggestions for the notebook

2008-09-23 Thread Maike

Okay that's right. But still, #auto doesn't work together with %hide
or %latex, no matter which order I put these commands in, and I need
this feature for my %latex cells, because they're the ones not being
executed when I start up a worksheet.

Maike

On Sep 22, 6:31 pm, William Stein [EMAIL PROTECTED] wrote:
 On 9/22/08, Maike [EMAIL PROTECTED] wrote:



  Hmmm, I get NameError: name 'auto' is not defined. I'm using version
  3.1.1, should that support %auto?

 Use #auto, not %auto





  Thanks! Maike

  On Sep 22, 12:06 pm, Mike Hansen [EMAIL PROTECTED] wrote:
  Hi Maike,

  On Mon, Sep 22, 2008 at 3:04 AM, Maike [EMAIL PROTECTED]
  wrote:

   (2) Thanks that sounds good. I'm not sure how to use #auto though,
   where do I put this option?

  You put %auto as the first line of the cell that you want to
  auto-evaluate.

  --Mike

 --
 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: Suggestions for the notebook

2008-09-23 Thread Mike Hansen

Hello,

On Tue, Sep 23, 2008 at 1:21 AM, Maike [EMAIL PROTECTED] wrote:

 Okay that's right. But still, #auto doesn't work together with %hide
 or %latex, no matter which order I put these commands in, and I need
 this feature for my %latex cells, because they're the ones not being
 executed when I start up a worksheet.

There was a bug in Sage 3.1.1 that caused any associated files or
images with a cell (such as plots or the output of %latex cells) to be
deleted when the worksheet was closed.  If this is the reason why you
want to use the auto cells, you should upgrade to Sage 3.1.2 since I
fixed this bug in it.  This should alleviate some of your problems.

--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: Suggestions for the notebook

2008-09-23 Thread Maike

Thanks, I'll make sure I get 3.1.2 installed today!


On Sep 23, 10:26 am, Mike Hansen [EMAIL PROTECTED] wrote:
 Hello,

 On Tue, Sep 23, 2008 at 1:21 AM, Maike [EMAIL PROTECTED] wrote:

  Okay that's right. But still, #auto doesn't work together with %hide
  or %latex, no matter which order I put these commands in, and I need
  this feature for my %latex cells, because they're the ones not being
  executed when I start up a worksheet.

 There was a bug in Sage 3.1.1 that caused any associated files or
 images with a cell (such as plots or the output of %latex cells) to be
 deleted when the worksheet was closed.  If this is the reason why you
 want to use the auto cells, you should upgrade to Sage 3.1.2 since I
 fixed this bug in it.  This should alleviate some of your problems.

 --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: working with rings

2008-09-23 Thread cesarnda

Actually

sage: G.base_ring().order() is what I wanted, thank you so much.

On Sep 23, 1:42 am, Robert Bradshaw [EMAIL PROTECTED]
wrote:
 On Sep 22, 2008, at 11:37 PM, Mike Hansen wrote:





  Hello,
  On Mon, Sep 22, 2008 at 11:34 PM, cesarnda [EMAIL PROTECTED] wrote:

  If I do:

  sage: MS = MatrixSpace(IntegerModRing(9), 5,5)
  sage: G = MS([[5, 0, 0, 0, 4],[4, 5, 0, 0, 0],[0, 4, 5, 0, 0],[0,  
  0,4,
  5, 0], [0, 0, 0, 4, 5]])
  sage: G.base_ring()
  Ring of integers modulo 9

  is there a way to get the base ring as an integer?

  Do you mean you want the matrix as a matrix over the integers rather
  than over the integers mod 9?  If so, then you can do the following:

  sage: H = G.change_ring(ZZ); H

  [5 0 0 0 4]
  [4 5 0 0 0]
  [0 4 5 0 0]
  [0 0 4 5 0]
  [0 0 0 4 5]
  sage: H.base_ring()
  Integer Ring

 Or, if you meant the modulus of the ring, you can get that with

 sage: G.base_ring().order()
 9

 - 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: question on using integral() in sage. Fourier transform of unit step function.

2008-09-23 Thread kkwweett

Surprinsingly, SAGE 3.1.2 is more ignorant than 3.1.1:

 ./sage

 ---
 | SAGE Version 3.1.2 ...
 | Type notebook() ...
 --

 sage: var('a b t x')
 (a, b, t, x)
 sage: assume(exp(b*pi)1)
 sage: expr(x)=integral(exp(-2*I*pi*(a+I*b)*t),t,0,x)
 sage: factor(limit(expr(x),x=infinity))
 -1*I/(2*pi*(I*b+a))

SAGE doesn't know anymore that exp() is strictly ascending.
(assume(b0) doesn't work anymore)



On 22 sep, 12:30, kkwweett [EMAIL PROTECTED] wrote:
 you can indirectly get

  ./sage

 ---
 | SAGE Version 3.1.1 ...
 | Type notebook() ...
 --

 sage: var('a b t x')
 (a, b, t, x)
 sage: assume(b0)
 sage: expr(x)=integral(exp(-2*I*pi*(a+I*b)*t),t,0,x)
 sage: factor(limit(expr(x),x=infinity))
 -1*I/(2*pi*(I*b+a))
--~--~-~--~~~---~--~~
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] operations with matrices

2008-09-23 Thread aniura

hi,

I wanted to know if there is a way to work in Sage with arrays of
matrices or something similar (something like a[i,j,k], so that
a[i,:,:], a[:,j,:] and a[:,:,k] are all matrices. I tried to use a
list of matrices but apparently sage interprets it as a list of
vectors:

sage: m=matrix(RR,2,range(1,5))
sage: m1=matrix(RR,2,range(6,10))
sage: lm=list(m)
sage: lm.append(m1)
sage: lm

[(1.00, 2.00),
 (3.00, 4.00),
 [6.00 7.00]
[8.00 9.00]]
sage: lm[1]
(3.00, 4.00)

I also wanted to know if there is a command to create a list (or
matrix, or vector) of equal elements;
to sum the entries of vectors, particularly of rows of matrices,

thanks in advance,

Aniura
--~--~-~--~~~---~--~~
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-23 Thread David Harvey


On Sep 23, 2008, at 8:45 AM, aniura wrote:


 hi,

 I wanted to know if there is a way to work in Sage with arrays of
 matrices or something similar (something like a[i,j,k], so that
 a[i,:,:], a[:,j,:] and a[:,:,k] are all matrices. I tried to use a
 list of matrices but apparently sage interprets it as a list of
 vectors:

 sage: m=matrix(RR,2,range(1,5))
 sage: m1=matrix(RR,2,range(6,10))
 sage: lm=list(m)
 sage: lm.append(m1)
 sage: lm

You should do

lm = [m]
lm.append(m1)

instead. When you call list(m) you are asking to *convert* the matrix  
to a list.

david


--~--~-~--~~~---~--~~
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-23 Thread John Cremona

If you type m.tab you will see lots of things you can do with a
matrix m.  For example m.subdivide? allows you to pick out a
submatrix.

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

[[1.00 2.00]
[3.00 4.00],
 [1.00 2.00]
[3.00 4.00],
 [1.00 2.00]
[3.00 4.00],
 [1.00 2.00]
[3.00 4.00],
 [1.00 2.00]
[3.00 4.00]]

To add the entries of a vector:
sage: v=vector(range(100))
sage: sum(v)
4950

I'll leave row sums of a matrix as an exercise!

John Cremona

2008/9/23 aniura [EMAIL PROTECTED]:

 hi,

 I wanted to know if there is a way to work in Sage with arrays of
 matrices or something similar (something like a[i,j,k], so that
 a[i,:,:], a[:,j,:] and a[:,:,k] are all matrices. I tried to use a
 list of matrices but apparently sage interprets it as a list of
 vectors:

 sage: m=matrix(RR,2,range(1,5))
 sage: m1=matrix(RR,2,range(6,10))
 sage: lm=list(m)
 sage: lm.append(m1)
 sage: lm

 [(1.00, 2.00),
  (3.00, 4.00),
  [6.00 7.00]
 [8.00 9.00]]
 sage: lm[1]
 (3.00, 4.00)

 I also wanted to know if there is a command to create a list (or
 matrix, or vector) of equal elements;
 to sum the entries of vectors, particularly of rows of matrices,

 thanks in advance,

 Aniura
 


--~--~-~--~~~---~--~~
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-23 Thread Jason Merrill

 John Cremona

 2008/9/23 aniura [EMAIL PROTECTED]:



  hi,

  I wanted to know if there is a way to work in Sage with arrays of
  matrices or something similar (something like a[i,j,k], so that
  a[i,:,:], a[:,j,:] and a[:,:,k] are all matrices. I tried to use a
  list of matrices but apparently sage interprets it as a list of
  vectors:

  sage: m=matrix(RR,2,range(1,5))
  sage: m1=matrix(RR,2,range(6,10))
  sage: lm=list(m)
  sage: lm.append(m1)
  sage: lm

  [(1.00, 2.00),
   (3.00, 4.00),
   [6.00 7.00]
  [8.00 9.00]]
  sage: lm[1]
  (3.00, 4.00)

  I also wanted to know if there is a command to create a list (or
  matrix, or vector) of equal elements;
  to sum the entries of vectors, particularly of rows of matrices,

  thanks in advance,

  Aniura

Depending on what you're doing, you may also want to look into numpy
arrays, which you can use from within Sage.

from numpy import array

You might also want to work in python mode (%python as the first line
of a cell in the notebook) if you're doing much in numpy, to avoid
having ints get preprocessed to Integers, etc.

Regards,

JM
--~--~-~--~~~---~--~~
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] installation problem with sage-3.1.2

2008-09-23 Thread abhi

I am trying to install sage-3.1.2 on my Fedora 9 with gcc-4.3. I am
having problem with matplotlib-0.98.3.p1its giving error given
below

BUILDING MATPLOTLIB
matplotlib: 0.98.3
python: 2.5.2 (r252:60911, Sep 23 2008, 17:09:57)
[GCC
4.3.0 20080428 (Red Hat 4.3.0-8)]
  platform: linux2

REQUIRED DEPENDENCIES
 numpy: 1.1.0
 freetype2: 9.16.3

OPTIONAL BACKEND DEPENDENCIES
libpng: 1.2.29
Traceback (most recent call last):
  File setup.py, line 125, in module
if check_for_tk() or (options['build_tkagg'] is True):
  File /home/abhishek/sage-3.1.2/spkg/build/matplotlib-0.98.3.p1/src/
setupext.py, line 846, in check_for_tk
explanation = add_tk_flags(module)
  File /home/abhishek/sage-3.1.2/spkg/build/matplotlib-0.98.3.p1/src/
setupext.py, line 1106, in add_tk_flags
module.libraries.extend(['tk' + tk_ver, 'tcl' + tk_ver])
UnboundLocalError: local variable 'tk_ver' referenced before
assignment
Error building matplotlib package.

plz 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: operations with matrices

2008-09-23 Thread Simon King

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:
  sage: m=Matrix(ZZ,[[1,2,3]])
  sage: L=[m]*5
  sage: L[0] is L[1]
  True

Any change to L[0] would also imply a change to L[1] and even to m:
sage: L[1]
[1 2 3]
sage: L[0][0,0]=0
sage: L[1]
[0 2 3]
sage: m
[0 2 3]


Hence, Aniura, if you want to manipulate individual copies of m, then
you should do
  sage: L=[copy(m) for i in range(5)]
Then, you have
  sage: L[0] is L[1]
  False
  sage: L=[copy(m) for i in range(5)]
  sage: L[1]
  [1 2 3]
  sage: L[0][0,0]=0
  sage: L[0]
  [0 2 3]
  sage: L[1]
  [1 2 3]
  sage: m
  [1 2 3]


But i am afraid that does not answer the question of the original
post, which was about creating an array A such that A[i;;], A[;j;]
and A[;;k] are matrices. Jason's reply (use numpy) is probably
better.

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: operations with matrices

2008-09-23 Thread John Cremona

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] question about SAGE eigenvalues

2008-09-23 Thread pong


I tried

sage: A=matrix([[1,1],[2,3]])
sage: A.eigenvalues()
[0.2679491924311228?, 3.732050807568878?]

My question is why the last digit before ? in 0.2679491924311228? is
'8'? Shouldn't it be 7 according to

sage: ch=characteristic_polynomial(A)
sage: solve(ch(x)==0,x)
[x == 2 - sqrt(3), x == sqrt(3) + 2]
sage: N(2-sqrt(3), digits=18)
0.267949192431122706




--~--~-~--~~~---~--~~
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-23 Thread William Stein

On Tue, Sep 23, 2008 at 9:34 AM, pong [EMAIL PROTECTED] wrote:


 I tried

 sage: A=matrix([[1,1],[2,3]])
 sage: A.eigenvalues()
 [0.2679491924311228?, 3.732050807568878?]

 My question is why the last digit before ? in 0.2679491924311228? is
 '8'? Shouldn't it be 7 according to

? means the digit before the ? is unknown.

This is an algebraic number printed as an element of QQbar.
You can always get it to higher precision.

sage: RealField(100)(A.eigenvalues()[0])
0.26794919243112270647255365849


William


 sage: ch=characteristic_polynomial(A)
 sage: solve(ch(x)==0,x)
 [x == 2 - sqrt(3), x == sqrt(3) + 2]
 sage: N(2-sqrt(3), digits=18)
 0.267949192431122706




 




-- 
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] Re: question about SAGE eigenvalues

2008-09-23 Thread John Cremona

2008/9/23 pong [EMAIL PROTECTED]:


 I tried

 sage: A=matrix([[1,1],[2,3]])
 sage: A.eigenvalues()
 [0.2679491924311228?, 3.732050807568878?]

 My question is why the last digit before ? in 0.2679491924311228? is
 '8'? Shouldn't it be 7 according to

 sage: ch=characteristic_polynomial(A)
 sage: solve(ch(x)==0,x)
 [x == 2 - sqrt(3), x == sqrt(3) + 2]
 sage: N(2-sqrt(3), digits=18)
 0.267949192431122706




 


Alternatively:

sage: e1,e2= A.eigenvalues()
sage: e1
0.2679491924311228?
sage: e1.interval(ComplexIntervalField(53)) # the default is 53 bits precision
0.2679491924311228?
sage: e1.interval(ComplexIntervalField(100))
0.267949192431122706472553658494?
sage: e1.interval(ComplexIntervalField(200))
0.267949192431122706472553658494127633057194746189619371944193?

i.e. e1 is a number of a type which is essentially infinite precision,
and you can ask for it to any desired precision later.

However I'm still not sure why the original display ends 8? and not
7?.  The ? notatation was introduced quite recently, so I am not sure
whether this is a feature or a bug.

John Cremona

--~--~-~--~~~---~--~~
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 -wiki not starting

2008-09-23 Thread Adam Webb

Hi,


^^^ This is some sort of permission error. Are you running SELinux or
something like that?


It turns out that although SELinux is installed it is actually
disabled because it interferes to much and since I live behind a
firewall it deemed unneeded. So I am back to square one.

At the moment I went into the last file in the traceback: sage/local/
lib/python2.5/site-packages/twisted/python/util.py and put in a
statement to set setgroups and getgroups to None. If I understand the
comments, this forces the case where the OS does not support this. My
initial test is that this works but I have no idea what the side
effects might be.

Adam
--~--~-~--~~~---~--~~
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-23 Thread John Cremona

2008/9/23 John Cremona [EMAIL PROTECTED]:
 2008/9/23 pong [EMAIL PROTECTED]:


 I tried

 sage: A=matrix([[1,1],[2,3]])
 sage: A.eigenvalues()
 [0.2679491924311228?, 3.732050807568878?]

 My question is why the last digit before ? in 0.2679491924311228? is
 '8'? Shouldn't it be 7 according to

 sage: ch=characteristic_polynomial(A)
 sage: solve(ch(x)==0,x)
 [x == 2 - sqrt(3), x == sqrt(3) + 2]
 sage: N(2-sqrt(3), digits=18)
 0.267949192431122706




 


 Alternatively:

 sage: e1,e2= A.eigenvalues()
 sage: e1
 0.2679491924311228?
 sage: e1.interval(ComplexIntervalField(53)) # the default is 53 bits precision
 0.2679491924311228?
 sage: e1.interval(ComplexIntervalField(100))
 0.267949192431122706472553658494?
 sage: e1.interval(ComplexIntervalField(200))
 0.267949192431122706472553658494127633057194746189619371944193?

 i.e. e1 is a number of a type which is essentially infinite precision,
 and you can ask for it to any desired precision later.

 However I'm still not sure why the original display ends 8? and not
 7?.  The ? notatation was introduced quite recently, so I am not sure
 whether this is a feature or a bug.

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.

So in Pong's case the final 8? means 8-plus-or-minus-1 which is not wrong.

 John Cremona


--~--~-~--~~~---~--~~
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: Storing results of solve() function

2008-09-23 Thread Mike Hansen

Hi Andy,

On Tue, Sep 23, 2008 at 12:58 PM, Andy [EMAIL PROTECTED] wrote:

 I am programming for a project in sage and I want to make use of the
 solve() function.  However, I noticed that solve() does not return the
 value of the solved variable but only a statement instead.

 For instance, if I wanted to do solve([x^2 - 1], x), I would likely
 get a result containing the strings x == 1 and x == -1.  This is
 all fine if I just want to view the result, but what if I wanted to
 store the resulting possible values of x in a list?  Like have the
 list returned [-1, 1].

 Any tricks to solve() that allow the results to be stored in a useable
 form?

The results of solve() are Sage's symbolic equations.  You can get at
their left and right hand sides with lhs and rhs respectively.

sage: eqs = solve([x^2 - 1], x); eqs
[x == -1, x == 1]
sage: [eq.rhs() for eq in eqs]
[-1, 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: question about SAGE eigenvalues

2008-09-23 Thread Jason Grout

John Cremona wrote:
 2008/9/23 John Cremona [EMAIL PROTECTED]:
 2008/9/23 pong [EMAIL PROTECTED]:

 I tried

 sage: A=matrix([[1,1],[2,3]])
 sage: A.eigenvalues()
 [0.2679491924311228?, 3.732050807568878?]

 My question is why the last digit before ? in 0.2679491924311228? is
 '8'? Shouldn't it be 7 according to

 sage: ch=characteristic_polynomial(A)
 sage: solve(ch(x)==0,x)
 [x == 2 - sqrt(3), x == sqrt(3) + 2]
 sage: N(2-sqrt(3), digits=18)
 0.267949192431122706




 Alternatively:

 sage: e1,e2= A.eigenvalues()
 sage: e1
 0.2679491924311228?
 sage: e1.interval(ComplexIntervalField(53)) # the default is 53 bits 
 precision
 0.2679491924311228?
 sage: e1.interval(ComplexIntervalField(100))
 0.267949192431122706472553658494?
 sage: e1.interval(ComplexIntervalField(200))
 0.267949192431122706472553658494127633057194746189619371944193?

 i.e. e1 is a number of a type which is essentially infinite precision,
 and you can ask for it to any desired precision later.

 However I'm still not sure why the original display ends 8? and not
 7?.  The ? notatation was introduced quite recently, so I am not sure
 whether this is a feature or a bug.
 
 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?

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? with plot3d

2008-09-23 Thread John H Palmieri

When passing a python function to plot3d, specifying the variable
names and including 'adaptive=True' makes plot3d fail, with the
message

AttributeError: 'function' object has no attribute 'subs'

In more detail:

sage: def f(x,y): return sin(x+y)

Then the following work and produce the same graph:
plot3d(f, (x, -5, 5), (y, -5, 5))
plot3d(f, (-5, 5), (-5, 5))
On the other hand,
plot3d(f, (-5, 5), (-5, 5), adaptive=True)
works, but
plot3d(f, (x, -5, 5), (y, -5, 5), adaptive=True)
barfs with the error message given above.

Is this a bug, or is this related to one of the issues raised in this
earlier thread
http://groups.google.com/group/sage-support/browse_frm/thread/
9ad07eeddb850ab3/e0cab1daca9b0883?lnk=gstq=plot3d#e0cab1daca9b0883 ?

If it's not a bug, it should perhaps fail more gracefully, since the
plot works if 'adaptive=False'.
--~--~-~--~~~---~--~~
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] a different bug? with plot3d

2008-09-23 Thread John H Palmieri

Is the following a bug? I don't really know what 'adaptive=True' means
-- the documentation isn't very helpful -- so maybe it's not supposed
to work for functions like this...

def g(x,y):
if y = 0 or y = x**2:
return 0
else:
return 1

Then
plot3d(g, (-3, 3), (-3, 3), adaptive=True)
fails, with the message

Traceback (most recent call last):
  File stdin, line 1, in module
  File /home/palmieri/.sage/sage_notebook/worksheets/admin/37/code/
7.py, line 6, in module
plot3d(g, (-Integer(3), Integer(3)), (-Integer(3), Integer(3)),
adaptive=True)
  File /usr/local/share/sage/local/lib/python2.5/site-packages/
SQLAlchemy-0.4.6-py2.5.egg/, line 1, in module
  File /home/palmieri/Documents/sage-3.1.2/local/lib/python2.5/site-
packages/sage/plot/plot3d/plot3d.py, line 157, in plot3d
P = plot3d_adaptive(f, urange, vrange, **kwds)
  File /home/palmieri/Documents/sage-3.1.2/local/lib/python2.5/site-
packages/sage/plot/plot3d/plot3d.py, line 255, in plot3d_adaptive
G.set_texture(texture[k], opacity=opacity)
IndexError: list index out of range
--~--~-~--~~~---~--~~
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] atan(0,0) returning zero?

2008-09-23 Thread Tim Lahey

Hi,

In some investigations while using Sage, I noticed
that atan(0,0) returns 0 while using Sage. Maxima
correctly reports an error. The arctan(0,0) should
be undefined. Is there a specific reason for the
behaviour of reporting 0? Is there a flag to set
to make it raise an error?

Thanks,

Tim.

---
Tim Lahey
PhD Candidate, Systems Design Engineering
University of Waterloo

smime.p7s
Description: S/MIME cryptographic signature


[sage-support] question about DiGraph

2008-09-23 Thread pong


I tried one of the examples (example 3 in DiGraph?)

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