[sage-support] Feedback from a first-time installer of Sage on a MAC

2007-11-08 Thread njas

This was on an iMAC, OS 10.4.10.
I went to
Sage
   Free download
 MAC OSX
INSTRUCTIONS.txt  - but the instructions here (dated 22 Aug
2007) did not work for me.  I downloaded the sage gz file to my
Desktop, then double-clicked it. This produced an error - it just
failed after a while. I tried twice. Each time it failed.

But then I went to
Documentation
   SAGE Installation Guide
  (PDF)
which said to move the sage file to another directory (off the
Desktop) and to run tar in a terminal window, and that worked!

I'm just reporting what happened. I'm not looking for any reply.
Things
worked in the end!

Neil Sloane


--~--~-~--~~~---~--~~
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://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] What is needed in order to save objects of extension class?

2007-11-08 Thread Simon King

Dear support team,

a basic question whose answer i was neither able to find in the Sage
Programming Guide nor in http://modular.math.washington.edu/sage/doc/html/tut/:

Suppose i have an extension class Foo and an instance X of Foo. What
methods must Foo provide in order to make things work like the
following?
 save(X,'bla')
 Y=load('bla')

The class Foo has a method save and a method load, and the
following works:
 X.save('bla')
 Y=Foo('')  # initializes Y as instance of Foo
 Y.load('bla')

But apparently for supporting the simpler syntax save(X,'bla')
load('bla') this is not enough.

Also I found some rumor in the doc strings about a method dumps, and
that the result of dumps can be used by loads in order to produce
an object. But apparently loads is not the same as eval: If i have
a string s that makes eval(s) to return a copy of X, loads(s)
fails.
So what is Foo.dumps supposed to do?

I'm sure that there is some written documentation on how to do those
things. Simply i couldn't find them.

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://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: What is needed in order to save objects of extension class?

2007-11-08 Thread William Stein

On Nov 8, 2007 12:36 PM, Simon King [EMAIL PROTECTED] wrote:
 Dear support team,

 a basic question whose answer i was neither able to find in the Sage
 Programming Guide nor in 
 http://modular.math.washington.edu/sage/doc/html/tut/:

 Suppose i have an extension class Foo and an instance X of Foo.

By an extension class I assume you mean a class you defined using Cython?

 What
 methods must Foo provide in order to make things work like the
 following?
  save(X,'bla')
  Y=load('bla')

Either:

 (1) X must be pickle-able (a general Python notation), or

 (2) You must provide a save method that can be called like this:
  obj.save(filename=filename, compress=compress, **kwds)
  i.e., it takes a filename and a compression option.
  The result of calling obj.save must be a compressed or non-compressed
  pickle.

Regarding (1), for Cython extension classes, it is usually necessary
to define a __reduce__ method.  Type search_src('__reduce__') for
examples.

 The class Foo has a method save and a method load, and the
 following works:

That will make it so it doesn't work, since (2) is violated.

  X.save('bla')
  Y=Foo('')  # initializes Y as instance of Foo
  Y.load('bla')

 But apparently for supporting the simpler syntax save(X,'bla')
 load('bla') this is not enough.

 Also I found some rumor in the doc strings about a method dumps, and
 that the result of dumps can be used by loads in order to produce
 an object.

Type dumps? for the docs on dumps.  It dumps an objects to a compressed
version of a Python pickle.  Also, loads recovers a compressed (or uncompressed)
Python pickle and makes an object out of it.


 But apparently loads is not the same as eval: If i have
 a string s that makes eval(s) to return a copy of X, loads(s)
 fails.
 So what is Foo.dumps supposed to do?

 I'm sure that there is some written documentation on how to do those
 things. Simply i couldn't find them.

In general you might want to read up on Python pickles, since it seems
perhaps you haven't already done so.  Check out:
   http://docs.python.org/lib/module-pickle.html
to get started.   Basically, Python is designed from the ground up to
make it so nearly arbitrary objects can be turned into strings in a sensible
way from which the object can be recovered.  The strings are not human
readable.

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://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: What is needed in order to save objects of extension class?

2007-11-08 Thread Simon King

Dear William,

On Nov 8, 5:36 pm, William Stein [EMAIL PROTECTED] wrote:
 By an extension class I assume you mean a class you defined using Cython?

Yes.

 Type dumps? for the docs on dumps.

I even did dumps?? and found cPickle mentioned in the code.
But it didn't tell me much, because...

 In general you might want to read up on Python pickles, since it seems
 perhaps you haven't already done so.  Check out:
http://docs.python.org/lib/module-pickle.html
 to get started.

... i was missing such source of information.

Thank you very much!

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://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: reference manual

2007-11-08 Thread mabshoff



On Nov 8, 8:57 pm, Paul Zimmermann [EMAIL PROTECTED] wrote:

Hello Paul,

 Onhttp://sagemath.org/doc/html/ref/module-sage.calculus.calculus.htmlone
 can read:

 sage: var('x, u, v')
 (x, u, v)
 sage: f = expand((2*u*v^2-v^2-4*u^3)^2 * (-u)^3 * (x-sin(x))^3) # not 
 tested -- trac #946

 This seems to work now:

 sage: var('x, u, v')
 sage: f = expand((2*u*v^2-v^2-4*u^3)^2 * (-u)^3 * (x-sin(x))^3)
 sage: f.factor()
 u^3*(2*u*v^2 - v^2 - 4*u^3)^2*(sin(x) - x)^3


The problem is that this doesn't work on a couple of different boxes,
for example my 32 bit FC7 test box. We haven't figured out why this
happens, but it is still in the to do list.

 Paul

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://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] reference manual

2007-11-08 Thread Paul Zimmermann

On http://sagemath.org/doc/html/ref/module-sage.calculus.calculus.html one
can read:

sage: var('x, u, v')
(x, u, v)
sage: f = expand((2*u*v^2-v^2-4*u^3)^2 * (-u)^3 * (x-sin(x))^3) # not 
tested -- trac #946

This seems to work now:

sage: var('x, u, v')
sage: f = expand((2*u*v^2-v^2-4*u^3)^2 * (-u)^3 * (x-sin(x))^3)
sage: f.factor()
u^3*(2*u*v^2 - v^2 - 4*u^3)^2*(sin(x) - x)^3

Paul


--~--~-~--~~~---~--~~
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://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: reference manual

2007-11-08 Thread William Stein

On Thu, 08 Nov 2007 19:57:02 -, Paul Zimmermann [EMAIL PROTECTED] wrote:


 On http://sagemath.org/doc/html/ref/module-sage.calculus.calculus.html one
 can read:

 sage: var('x, u, v')
 (x, u, v)
 sage: f = expand((2*u*v^2-v^2-4*u^3)^2 * (-u)^3 * (x-sin(x))^3) # not 
 tested -- trac #946

 This seems to work now:

 sage: var('x, u, v')
 sage: f = expand((2*u*v^2-v^2-4*u^3)^2 * (-u)^3 * (x-sin(x))^3)
 sage: f.factor()
 u^3*(2*u*v^2 - v^2 - 4*u^3)^2*(sin(x) - x)^3

You're right this works fine now.  I also tried removing all the #not 
tested's, so the lines
are doctested and running the doctests on osx and 64-bit linux (sage.math), and 
doctesting
calculus.py did not hang.  I've posted a patch, and it will be safe to close 
that ticket
once the patch goes in.

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://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: reference manual

2007-11-08 Thread William Stein

On Thu, 08 Nov 2007 20:09:09 -, mabshoff [EMAIL PROTECTED] wrote:




 On Nov 8, 8:57 pm, Paul Zimmermann [EMAIL PROTECTED] wrote:

 Hello Paul,

 Onhttp://sagemath.org/doc/html/ref/module-sage.calculus.calculus.htmlone
 can read:

 sage: var('x, u, v')
 (x, u, v)
 sage: f = expand((2*u*v^2-v^2-4*u^3)^2 * (-u)^3 * (x-sin(x))^3) # not 
 tested -- trac #946

 This seems to work now:

 sage: var('x, u, v')
 sage: f = expand((2*u*v^2-v^2-4*u^3)^2 * (-u)^3 * (x-sin(x))^3)
 sage: f.factor()
 u^3*(2*u*v^2 - v^2 - 4*u^3)^2*(sin(x) - x)^3


 The problem is that this doesn't work on a couple of different boxes,

It's more that running

 cd SAGE_ROOT/devel/sage/sage/calculus
 sage -t calculus.py

hangs on some machine.  In the ticket I said only that it hung on
sage.math (64-bit linux), and it definitely works fine on there now.

I just tested on a 32-bit Redhat Enterprise Linux build and it also
works fine.   So maybe it's just fine now?

 for example my 32 bit FC7 test box. We haven't figured out why this
 happens, but it is still in the to do list.



-- 
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://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] version number strangeness

2007-11-08 Thread John Cremona

Just upgraded to 2.8.12 prior to Sage Days 6, and find this:

[EMAIL PROTECTED]
--
| SAGE Version 2.8.10, Release Date: 2007-10-28  |
| Type notebook() for the GUI, and license() for information.|
--

Automatically updating the cached Gap workspace:
/home/jec/.sage//gap/workspace-1140050670
sage: version()
'SAGE Version 2.8.12, Release Date: 2007-11-06'

Is this some triviality or something else?  Have I really got 2.8.12?

[On kubuntu 7.10]

-- 
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://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: version number strangeness

2007-11-08 Thread William Stein

On Nov 8, 2007 8:22 PM, John Cremona [EMAIL PROTECTED] wrote:

 Just upgraded to 2.8.12 prior to Sage Days 6, and find this:

 [EMAIL PROTECTED]
 --
 | SAGE Version 2.8.10, Release Date: 2007-10-28  |
 | Type notebook() for the GUI, and license() for information.|
 --

 Automatically updating the cached Gap workspace:
 /home/jec/.sage//gap/workspace-1140050670
 sage: version()
 'SAGE Version 2.8.12, Release Date: 2007-11-06'

 Is this some triviality or something else?  Have I really got 2.8.12?

Could you try:

  sage: hg_scripts.merge()
  sage: hg_scripts.update()

then restart Sage?   It's now the case that Sage will not overwrite
changes you make to SAGE_ROOT/local/bin/ or to SAGE_ROOT/data/extcode,
but instead *merges* your changes with the new changes.  Sometimes
this requires you to do something manually.

William


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://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: version number strangeness

2007-11-08 Thread William Stein

On Thu, 08 Nov 2007 20:33:22 -, John Cremona [EMAIL PROTECTED] wrote:


 This happened (and the problem was still there on restarting):

 sage:  sage: hg_scripts.merge()
 cd /home/src/sage/local/bin  hg merge
 abort: there is nothing to merge - use hg update instead
 sage:  sage: hg_scripts.update()
 cd /home/src/sage/local/bin  hg update
 abort: untracked local file 'sage-wiki' differs from remote version

Delete

 /home/src/sage/local/bin/sage-wiki

then try again.   That will work.  (I saw this once before.)

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://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Issue with interface to Gap in 2.8.12

2007-11-08 Thread Carlo Hämäläinen

Hi,

Is there a limit on the size of permutations with the Gap interface? I
managed to get an error today which seems to be due to Gap putting
(...) at the end of a line. Here's the error:

type 'exceptions.TypeError': Gap produced error output
Syntax error: expression expected in /home/carlo/.sage//temp/t40/13158//interf\
ace//tmp line 1
$sage3:=(1,2,8,30,43,13,3)(4,18,56,140,145,59,19)(5,23,69,162,167,72,24)(6,11,\
33,86,114,46,16)(7,12,34,87,115,47,17)(9,35,96,208,146,61,21)(10,38,103,220,16\
8,74,27)(14,22,58,141,252,124,48)(15,26,71,163,264,131,51)(20,62,150,284,288,1\
53,63)(25,75,172,306,310,175,76)(28,41,94,190,234,122,54)(29,42,95,191,235,123\
,55)(31,88,192,281,149,67,37)(32,91,199,303,171,81,40)(36,98,211,237,241,213,9\
9)(39,105,223,244,248,225,106)(44,50,68,144,277,236,116)(45,53,80,166,299,243,\
119)(49,126,255,197,193,258,127)(52,133,267,204,200,270,134)(57,142,278,232,28\
9,155,65)(60,66,152,285,185,282,147)(64,156,292,319,333,295,157)(70,164,300,23\
3,311,177,79)(73,78,174,307,188,304,169)(77,178,314,322,336,315,179)(82,110,20\
6,298,280,250,138)(83,111,207,276,302,251,139)(...);;
  \
  \
  \
  \
  \
  \
  \
  \
  \
^

   executing Read(/home/carlo/.sage//temp/t40/13158//interface//tmp);



Here's the code to reproduce it:

def p3Group(p):
assert is_prime(p)

F = gap.new(FreeGroup(3))

a = F.gen(1)
b = F.gen(2)
c = F.gen(3)

rels = []
rels.append( a**Integer(p) )
rels.append( b**Integer(p) )
rels.append( c**Integer(p) )
rels.append( a*b*((b*a*c)**Integer(-1)) )
rels.append( c*a*((a*c)**Integer(-1)) )
rels.append( c*b*((b*c)**Integer(-1)) )

N = gap.NormalClosure(F, gap.Subgroup(F, rels))
niso = gap.NaturalHomomorphismByNormalSubgroupNC(F, N)

a = PermutationGroupElement(gap.Image(niso, a))

# This works:
p3Group(5)

# This blows up:
p3Group(7)

--~--~-~--~~~---~--~~
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://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: Issue with interface to Gap in 2.8.12

2007-11-08 Thread William Stein

On Nov 9, 2007 12:24 AM, Carlo Hämäläinen [EMAIL PROTECTED] wrote:
 Is there a limit on the size of permutations with the Gap interface? I
 managed to get an error today which seems to be due to Gap putting
 (...) at the end of a line.

Yes, evidently there definitely is.  I wasn't aware of this until just now.
I've made this trac #1133, since I definitely consider it a serious issue:
  http://trac.sagemath.org/sage_trac/ticket/1133
Many thanks for reporting this with a complete example.

William

 Here's the error:

 type 'exceptions.TypeError': Gap produced error output
 Syntax error: expression expected in 
 /home/carlo/.sage//temp/t40/13158//interf\
 ace//tmp line 1
 $sage3:=(1,2,8,30,43,13,3)(4,18,56,140,145,59,19)(5,23,69,162,167,72,24)(6,11,\
 33,86,114,46,16)(7,12,34,87,115,47,17)(9,35,96,208,146,61,21)(10,38,103,220,16\
 8,74,27)(14,22,58,141,252,124,48)(15,26,71,163,264,131,51)(20,62,150,284,288,1\
 53,63)(25,75,172,306,310,175,76)(28,41,94,190,234,122,54)(29,42,95,191,235,123\
 ,55)(31,88,192,281,149,67,37)(32,91,199,303,171,81,40)(36,98,211,237,241,213,9\
 9)(39,105,223,244,248,225,106)(44,50,68,144,277,236,116)(45,53,80,166,299,243,\
 119)(49,126,255,197,193,258,127)(52,133,267,204,200,270,134)(57,142,278,232,28\
 9,155,65)(60,66,152,285,185,282,147)(64,156,292,319,333,295,157)(70,164,300,23\
 3,311,177,79)(73,78,174,307,188,304,169)(77,178,314,322,336,315,179)(82,110,20\
 6,298,280,250,138)(83,111,207,276,302,251,139)(...);;
   
 \
   
 \
   
 \
   
 \
   
 \
   
 \
   
 \
   
 \
   
 \
 ^

executing Read(/home/carlo/.sage//temp/t40/13158//interface//tmp);



 Here's the code to reproduce it:

 def p3Group(p):
 assert is_prime(p)

 F = gap.new(FreeGroup(3))

 a = F.gen(1)
 b = F.gen(2)
 c = F.gen(3)

 rels = []
 rels.append( a**Integer(p) )
 rels.append( b**Integer(p) )
 rels.append( c**Integer(p) )
 rels.append( a*b*((b*a*c)**Integer(-1)) )
 rels.append( c*a*((a*c)**Integer(-1)) )
 rels.append( c*b*((b*c)**Integer(-1)) )

 N = gap.NormalClosure(F, gap.Subgroup(F, rels))
 niso = gap.NaturalHomomorphismByNormalSubgroupNC(F, N)

 a = PermutationGroupElement(gap.Image(niso, a))

 # This works:
 p3Group(5)

 # This blows up:
 p3Group(7)

 




-- 
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://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---