[sage-devel] Re: sage-1.6

2007-01-12 Thread Jaap Spies

William Stein wrote:
 Hello,
 
 I've release sage-1.6.  Download
  http://sage.math.washington.edu/sage/dist/src/
 
 Some major entries in the log:
 
 Thu Jan 11 18:12:12 2007
 
 1.6: * Twisted-1.5

Running sage -upgrade Twisted fails to install!

Twisted-2.5.0/zope.interface-3.3.0/src/zope.interface.egg-info/not-zip-safe
Twisted-2.5.0/zope.interface-3.3.0/src/zope.interface.egg-info/PKG-INFO
Twisted-2.5.0/zope.interface-3.3.0/src/zope.interface.egg-info/requires.txt
Twisted-2.5.0/zope.interface-3.3.0/src/zope.interface.egg-info/SOURCES.txt
Twisted-2.5.0/zope.interface-3.3.0/src/zope.interface.egg-info/top_level.txt
Second download resulted in a corrupted package.
make[1]: *** [installed/twisted-2.5.0] Error 1
make[1]: Leaving directory `/usr/local/sage/spkg'

real0m27.101s
user0m9.585s
sys 0m1.435s


Jaap


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: sage-1.6

2007-01-12 Thread Martin Albrecht

On Friday 12 January 2007 12:42, Jaap Spies wrote:
 William Stein wrote:
  Hello,
 
  I've release sage-1.6.  Download
   http://sage.math.washington.edu/sage/dist/src/
 
  Some major entries in the log:
 
  Thu Jan 11 18:12:12 2007
  
  1.6: * Twisted-1.5

 Running sage -upgrade Twisted fails to install!

 Twisted-2.5.0/zope.interface-3.3.0/src/zope.interface.egg-info/not-zip-safe
 Twisted-2.5.0/zope.interface-3.3.0/src/zope.interface.egg-info/PKG-INFO
 Twisted-2.5.0/zope.interface-3.3.0/src/zope.interface.egg-info/requires.txt
 Twisted-2.5.0/zope.interface-3.3.0/src/zope.interface.egg-info/SOURCES.txt
 Twisted-2.5.0/zope.interface-3.3.0/src/zope.interface.egg-info/top_level.tx
t Second download resulted in a corrupted package.

I can confirm this. However manually unpacking and spkg-install-ing it worked 
for me.

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



[sage-devel] Ticket #91 (gcd for Polynomials over ZZ)

2007-01-12 Thread Martin Albrecht
Hi everyone,

I have a fix for ticket #91 which needs a little discussion:

Singular does not support ZZ but it is used to compute the gcd of two 
MPolynomials. As the gcd computation of Singular ignores the coefficient 
anyway ( gcd(2x,4x) == x ) I allowed that MPolynomials over ZZ may be coerced 
to Singular if force=True is provided. Of course, this is not correct, but 
it works for several cases, e.g. gcd. Without explicitly specifying 
force=True only correct conversions are performed. The gcd method on the 
MPolynomials however enforces coercion. 
 
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-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---


ticket91.hg
Description: Binary data


[sage-devel] Re: sage-1.6

2007-01-12 Thread William Stein

On Fri, 12 Jan 2007 03:42:15 -0800, Jaap Spies [EMAIL PROTECTED] wrote:
 I've release sage-1.6.  Download
  http://sage.math.washington.edu/sage/dist/src/

 Some major entries in the log:

 Thu Jan 11 18:12:12 2007
 
 1.6: * Twisted-1.5

 Running sage -upgrade Twisted fails to install!

 Twisted-2.5.0/zope.interface-3.3.0/src/zope.interface.egg-info/not-zip-safe
 Twisted-2.5.0/zope.interface-3.3.0/src/zope.interface.egg-info/PKG-INFO
 Twisted-2.5.0/zope.interface-3.3.0/src/zope.interface.egg-info/requires.txt
 Twisted-2.5.0/zope.interface-3.3.0/src/zope.interface.egg-info/SOURCES.txt
 Twisted-2.5.0/zope.interface-3.3.0/src/zope.interface.egg-info/top_level.txt
 Second download resulted in a corrupted package.
 make[1]: *** [installed/twisted-2.5.0] Error 1
 make[1]: Leaving directory `/usr/local/sage/spkg'

Thanks, this is now fixed!

William


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: sage-1.6

2007-01-12 Thread Jaap Spies

Martin Albrecht wrote:
 On Friday 12 January 2007 12:42, Jaap Spies wrote:
 William Stein wrote:

 Thu Jan 11 18:12:12 2007
 
 1.6: * Twisted-1.5
 Running sage -upgrade Twisted fails to install!


 Twisted-2.5.0/zope.interface-3.3.0/src/zope.interface.egg-info/top_level.tx
 t Second download resulted in a corrupted package.
 
 I can confirm this. However manually unpacking and spkg-install-ing it worked 
 for me.
 

The files are extracted to Twisted-2.5.0 and installer complaints about
a non-existing directory twisted-2.5.0

I fooled the system by mv Twisted-2.5.0 twisted-2.5.0


Jaap


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Ticket #91 (gcd for Polynomials over ZZ)

2007-01-12 Thread William Stein

On Fri, 12 Jan 2007 06:22:15 -0800, Martin Albrecht [EMAIL PROTECTED] wrote:
 I have a fix for ticket #91 which needs a little discussion:

 Singular does not support ZZ but it is used to compute the gcd of two
 MPolynomials. As the gcd computation of Singular ignores the coefficient
 anyway ( gcd(2x,4x) == x ) I allowed that MPolynomials over ZZ may be coerced
 to Singular if force=True is provided. Of course, this is not correct, but
 it works for several cases, e.g. gcd. Without explicitly specifying
 force=True only correct conversions are performed. The gcd method on the
 MPolynomials however enforces coercion.

If f and g are polynomials ZZ[x,y,...], can't we fairly easily and correctly
compute gcd(f,g) in all cases by combining GCD in QQ[x,y,] with GCD in ZZ?
E.g., if f and g are 2*x*(x-1) and 4*x^2, first do GCD in QQ to get x, then do
GCD's in ZZ (of the content of and of g) to figure out how to scale the
result correctly to get 2*x, which is a greater common divisor in ZZ[x,y,...].

  -- William

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: sage-1.6

2007-01-12 Thread Jaap Spies

William Stein wrote:
 Hello,
 
 I've release sage-1.6.  Download
  http://sage.math.washington.edu/sage/dist/src/
 

   * Get SAGE to build on cygwin

What I did: reinstall cygwin (incl. dev tools), download sage-1.6.tar.

Same error in building gdmodule: missing library libiconv

Strange because libiconv is installed.

touch spkg/installed/gdmodule-0.56.p2

Waiting: SAGE build/upgrade complete!

Jaap





--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Ticket #91 (gcd for Polynomials over ZZ)

2007-01-12 Thread Martin Albrecht
On Friday 12 January 2007 16:04, William Stein wrote:
 On Fri, 12 Jan 2007 06:22:15 -0800, Martin Albrecht 
[EMAIL PROTECTED] wrote:
  I have a fix for ticket #91 which needs a little discussion:
 
  Singular does not support ZZ but it is used to compute the gcd of two
  MPolynomials. As the gcd computation of Singular ignores the coefficient
  anyway ( gcd(2x,4x) == x ) I allowed that MPolynomials over ZZ may be
  coerced to Singular if force=True is provided. Of course, this is not
  correct, but it works for several cases, e.g. gcd. Without explicitly
  specifying force=True only correct conversions are performed. The gcd
  method on the MPolynomials however enforces coercion.

 If f and g are polynomials ZZ[x,y,...], can't we fairly easily and
 correctly compute gcd(f,g) in all cases by combining GCD in QQ[x,y,]
 with GCD in ZZ? E.g., if f and g are 2*x*(x-1) and 4*x^2, first do GCD in
 QQ to get x, then do GCD's in ZZ (of the content of and of g) to figure out
 how to scale the result correctly to get 2*x, which is a greater common
 divisor in ZZ[x,y,...].

Done.

Martin

PS: I assume that this MPolynomialRing(ZZ,$n) -- Singular conversion hack 
is accepted then? 

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


ticket91.hg
Description: Binary data


[sage-devel] Re: Cube Friday

2007-01-12 Thread boothby

I tried to run that, and got the following error on the public notebook 
(running 1.6)


On Fri, 12 Jan 2007, Robert Miller wrote:


 Emily,

 Check this code out: it plots that weird cube pattern we kept seeing...

 Also, are we meeting soon?

 #generate the n-cube
 n=4

 #generate vertex labels:
 #n positions, 0 or 1 for each
 l = []
 for i in range(2^n):
l.append(Integer(i).binary())
 for i in range(len(l)):
l[i] = '0'*(n-len(l[i])) + l[i]

 #determine adjacencies:
 #adjacent vertices differ in
 #exactly one position
 d = {}
 for i in range(len(l)):
a = []
for j in range(n):
if l[i][j] == '0':
k = '1'
else: k = '0'
a.append(l[i][0:j] + k + l[i][j+1:n])
d[l[i]] = a

 #get basis vectors for projection RR^n - RR^2
 ll = {}
 theta = float(pi/n)
 for i in range(n):
ll[i] = (float(cos(i*theta)),float(sin(i*theta)))

 #calculate positions
 pos = {}
 for vertex in d.iterkeys():
x = 0
y = 0
for i in range(n):
x += int(vertex[i])*ll[i][0]
y += int(vertex[i])*ll[i][1]
pos[vertex] = [x,y]

 G = Graph(d)

 G.show(pos=pos, with_labels=False, node_size=10)

 --
 Robert L. Miller
 http://www.robertlmiller.com/

 




--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: sage-1.6

2007-01-12 Thread William Stein

On Fri, 12 Jan 2007 09:57:31 -0800, alex clemesha [EMAIL PROTECTED] wrote:

 I just installed sage-1.6 and it works fine but is
 missing the Twisted web2 module.

 I then applied the spkg I made with the web2 module

 sage -i twisted-2.4.0.p2.spkg

 and that worked fine.

 (This is the spkg I sent you a couple days ago William,
 but it is to large to send as an attachment here.)

 Can you include this?
 Also, did you mean Twisted 2.5 (not 1.5 ?)

Post a package in your home directory on sage.math that takes
the twisted-2.5 package and includes web2, so I can include
it for SAGE-1.7.

William

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: ode_solver

2007-01-12 Thread Hamptonio


Very nice!  Things seem fine so far after a few crude tests (on a Mac
Pro, sage 1.6, no packages installed).  I will try to push it harder
soon.  I think there is one small typo in the documentation: for the
initial condition example shouldn't it be

   y_0=1,y_1=1, would do

   sage: T.y_0=[1,1]

instead of

   y_0=1,y_1=1, would do

   sage: T.y_0=[1,0]

Cheers,
Marshall Hampton


Joshua Kantor wrote:
 In response to Williams sage-2.0 plan I wanted to describe what I had done
 with using gsl to implement a numerical ode solver. I believe that the
 patch containing this  will be applied after
 doing a recent pull or upgrade but I'm not sure(is this true?). If not I
 can send patches for people to play with. I have included the
 documentation at the end so people can look at the syntax.

 To see the documentation and examples

 sage: ode_solver?

 To be done

 1. Testing/feedback: Is it easy to use compared to matlab,mathematica.
 Any bugs or ways to crash it (unexpected input or user specified
 functions that do weird things)?

 2. More examples, doctests, improved documentation (I noticed a bunch of
 typos just copying the documentation below)

 3. Obvious additions people think would be useful. Currently it has a
 plotting routine and a routine to produce an interpolated function from
 the data points.


 Ideas for extension:

 1. It would be nice if there was some facility for automatically
 converting a nth order ODE
 to a system of first order ones.

 2. It would be nice if there was some facility for automatically computing
 the jacobian when the functions involved are rational functions and
 elementary functions.


 3. Numerically computing the jacobian: For the algorithms that require the
 jacobian It would be possible to numerically compute the jacobian,
 however I was wary of doing this by default. Does anyone have any knowledge
 about
 the benefits of this, can it cause instability (using the numerical
 jacobian
 instead of the exact one).


 Accuracy testing:

 1. I believe there are standard batches of tests for ode solvers.
 it would be interesting if some of these could be applied to compare the
 accuracy with matlab for example. This ode solver will be slower than
 matlab's on systems that require many function evaluations because we are
 forced to use python functions and there is significant overhead in
 calling these. Still comparisons would be interesting. There is a way to
 use compiled functions describe in the documentation but requires
 writing the functions in C and so isn't really suitable for
 general users.



   


 ode_solver is a class that wraps the GSL libraries ode solver routines
   To use it instantiate a class,
   sage: T=ode_solver()

   To solve a system of the form dy_i/dt=f_i(t,y), you must supply a
   vector or tuple/list valued function f representing f_i.
   The functions f and the jacobian should have the form foo(t,y) or
 foo(t,y,params).
   params which is optional allows for your function to depend on
 one or a tuple of parameters.
   Note if you use it, params must be a tuple even if it only has
 one component.
   For example if you wanted to solve y''+y=0. You need to write it
 as a first order system
   y_0' = y_1
   y1_1 = -y_0

   In code,

   sage: f = lambda t,y:[y[1],-y[0]]
   sage: T.function=f

   For some algorithms the jacobian must be supplied as well,
   the form of this should be a function return a list of lists of
 the form
   [ [df_1/dy_1,...,df_1/dy_n], ..., [df_n/dy_1,...,df_n,dy_n],
   [df_1/dt,...,df_n/dt] ]. There are examples below, if your
 jacobian was the function my_jacobian
   you would do.

   sage: T.jacobian=my_jacobian


   There are a variety of algorithms available for different types
 of systems. Possible algorithms are
   rkf45 - runga-kutta-felhberg (4,5)
   rk2 - embedded runga-kutta (2,3)
   rk4 - 4th order classical runga-kutta
   rk8pd - runga-kutta prince-dormand (8,9)
   rk2imp - implicit 2nd order runga-kutta at gaussian points
   rk4imp - implicit 4th order runga-kutta at gaussian points
   bsimp - implicit burlisch-stoer (requires jacobian)
   gear1 - M=1 implicit gear
   gear2 - M=2 implicit gear

   The default algorithm if rkf45. If you instead wanted to use
 bsimp you would do

   sage: T.algorithm=bsimp

   The user should supply initial conditions in y_0. For example if
 your initial conditions are
   y_0=1,y_1=1, would do

   sage: T.y_0=[1,0]

   The actual solver is invoked by the method ode_solve.
   It has arguments t_span, y_0,num_points, params.
   y_0 must be supplied either as an argument or above by
 

[sage-devel] Re: ode_solver

2007-01-12 Thread William Stein

On Fri, 12 Jan 2007 11:12:08 -0800, Hamptonio [EMAIL PROTECTED] wrote:



 Very nice!  Things seem fine so far after a few crude tests (on a Mac
 Pro, sage 1.6, no packages installed).  I will try to push it harder
 soon.  I think there is one small typo in the documentation: for the
 initial condition example shouldn't it be

y_0=1,y_1=1, would do

sage: T.y_0=[1,1]

 instead of

   y_0=1,y_1=1, would do

   sage: T.y_0=[1,0]

Thanks, fixed.

Feel free to send us any interesting examples you might have -- or even
just make them in a SAGE notebook and point me to it.

William


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Ticket #91 (gcd for Polynomials over ZZ)

2007-01-12 Thread William Stein

On Fri, 12 Jan 2007 08:38:34 -0800, Martin Albrecht [EMAIL PROTECTED] wrote:
 On Friday 12 January 2007 16:04, William Stein wrote:
 On Fri, 12 Jan 2007 06:22:15 -0800, Martin Albrecht
 [EMAIL PROTECTED] wrote:
  I have a fix for ticket #91 which needs a little discussion:
 
  Singular does not support ZZ but it is used to compute the gcd of two
  MPolynomials. As the gcd computation of Singular ignores the coefficient
  anyway ( gcd(2x,4x) == x ) I allowed that MPolynomials over ZZ may be
  coerced to Singular if force=True is provided. Of course, this is not
  correct, but it works for several cases, e.g. gcd. Without explicitly
  specifying force=True only correct conversions are performed. The gcd
  method on the MPolynomials however enforces coercion.

 If f and g are polynomials ZZ[x,y,...], can't we fairly easily and
 correctly compute gcd(f,g) in all cases by combining GCD in QQ[x,y,]
 with GCD in ZZ? E.g., if f and g are 2*x*(x-1) and 4*x^2, first do GCD in
 QQ to get x, then do GCD's in ZZ (of the content of and of g) to figure out
 how to scale the result correctly to get 2*x, which is a greater common
 divisor in ZZ[x,y,...].

 Done.

 Martin

 PS: I assume that this MPolynomialRing(ZZ,$n) -- Singular conversion hack
 is accepted then?

Yes.  I've included it from sage-1.7.

William

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Sage Days 3, Looking for roommate

2007-01-12 Thread Rishikesh

I looking for someone to share room during 
Sage Days 3. Please reply to this email.


Rishi

-- 
88A Avondale Avenue S., Waterloo, ON, N2L 2B9
Tel: +1.519.745.8301
Email: [EMAIL PROTECTED], [EMAIL PROTECTED]
Webpage: http://www.rishikesh.ca

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: sage-1.6

2007-01-12 Thread Yi Qiang


On Jan 12, 2007, at 10:17 AM, William Stein wrote:

 Post a package in your home directory on sage.math that takes
 the twisted-2.5 package and includes web2, so I can include
 it for SAGE-1.7.
I didn't know anyone actually used TwistedWeb2.  Anyhow, since I've  
been making the Twisted packages, here is one for TwistedWeb2:

http://sage.math.washington.edu/home/yi/spkgs/TwistedWeb2-0.2.0.spkg

Yi




--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: sage-1.6

2007-01-12 Thread William Stein

On Fri, 12 Jan 2007 15:45:40 -0800, Yi Qiang [EMAIL PROTECTED] wrote:



 On Jan 12, 2007, at 10:17 AM, William Stein wrote:

 Post a package in your home directory on sage.math that takes
 the twisted-2.5 package and includes web2, so I can include
 it for SAGE-1.7.
 I didn't know anyone actually used TwistedWeb2.

I think Alex intends to.  It's not currently used in SAGE itself.

 Anyhow, since I've
 been making the Twisted packages, here is one for TwistedWeb2:

 http://sage.math.washington.edu/home/yi/spkgs/TwistedWeb2-0.2.0.spkg


Thanks.  Fix the package so that the name is lower case, and also when
extracted the directory name exactly matches the package name (without spkg).

Thanks!

William

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: My SAGE function

2007-01-12 Thread William Stein

On Fri, 12 Jan 2007 16:39:44 -0800, Timothy Clemans [EMAIL PROTECTED] wrote:

 Stein,

 I wrote a SAGE function that lists the first n primes.
 http://sage.math.washington.edu:8100/nprimes

 def listnprimes(n):
  
  Returns list of the first n prime numbers.

  EXAMPLES:
   sage: print listnprimes(5)
   [2,3,5,7,11]
   sage: print listnprimes(10)
   [2,3,5,7,11,13,17,19,23,29]
  Written by Timothy Clemans
  
  Z = sage.rings.integer.Integer
  n = Z(n)
  if n  1: return
  i = 2
  prime = []
  for h in range(n):
   prime.append(i)
   i = next_prime(i)
  return prime

 Any comments would be nice. I would like this to be included in SAGE.

This will be much slower than other methods, since next_prime is quite
expensive (to put it mildly) compared to using a sieve method.  Better
would be a function that
   (1) Use the prime number theorem (or improvements -- see my notes with Mazur)
   to estimate an integer B such that
 prime_range(B)
   has length very close to n, and use an estimate that tends to 
overestimate.
   (2) Compute v = prime_range(B) (which is a very fast operation, even for B
   pretty large).
   (3) if len(v) = n return v[:n].
   (4) If len(v)  n, use a loop like you wrote above, i.e., use next_prime a 
few times.

William

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: sage-1.6

2007-01-12 Thread William Stein

On Fri, 12 Jan 2007 17:21:16 -0800, Yi Qiang [EMAIL PROTECTED] wrote:



 On Jan 12, 2007, at 3:59 PM, William Stein wrote:

  Fix the package so that the name is lower case, and also when
 extracted the directory name exactly matches the package name
 (without spkg).

 Done.  New spkg here:

 http://sage.math.washington.edu/home/yi/spkgs/twistedweb2-0.2.0.spkg

Thanks.  It installs.  However the first thing I tried doesn't work:

sage: import twisted.web2
---
type 'exceptions.AttributeError'Traceback (most recent call last)

/Users/was/Desktop/ipython console in module()

/Users/was/s/local/lib/python2.5/site-packages/twisted/web2/__init__.py in 
module()
   9
  10 
  11
  12 from twisted.web2._version import version
--- 13 __version__ = version.short()

type 'exceptions.AttributeError': X instance has no attribute 'short'

Maybe web2 doesn't work with twisted-2.5 yet?

William

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] sage-1.8

2007-01-12 Thread William Stein

Hi,

Here is the somewhat detailed plan for SAGE-1.8. See also
http://sage.math.washington.edu:9002/sage_trac/milestone/sage-1.8

I spent a lot fo time making the list of trac bugs below.  These are all fairly
important usually intersting and important bugs that still persist in SAGE-1.6.
Help appreciated on any of them, though don't worry if you're clueless about
them.  I plan to make more details about how to fix each when sage-1.7 is done.

== SAGE-1.8: Goal Date is Jan 19, 2007 ==

== Bug fixing ==

  * Fix the fixable important SAGE bugs listed in trac (ones below not fixed 
will be fixed for sage-1.9):
 - trac #34 -- modular symbols bug
 - trac #39 -- implement equality testing for ZZ[x,y,...] using M2 (or give 
error message)
 - trac #189 -- minor sage notebook formating bug
 - trac #45 - ntl modulus reset correclty.
 - trac #130 - problem with multiline history recall in IPython
 - trac #149 -- failure in E.sha_an()
 - trac #151 -- clisp.run's left running -- it's still happening though 
many cases have been fixed.
SOLVE this frickin' zombie problem somehow once for all...
 - trac #168 -- Plot bounds ignored when frame=True
 - trac #177 -- pari interface -- new arithmetic model
 - trac #185 -- implement backoff when queuing for notebook updates.
 - trac #188 -- Python's builtin round function is funny since it always 
coerces to float
 - trac #32 -- missing coercion of polynomials between different bases 
functionality
 - trac #35 -- load adosfile.sage breaks
 - trac #63 -- in safari notebook, tab key inserts tab AND moves to 
beginning of cell
 - trac #96 -- time command doesn't work in .sage files !?
 - trac #154 -- gfan changes broke interface slightly.
 - trac #156 -- freeze of gfan (actually singular -- not gfan's fault)
 - trac #181 -- recursive load and symbol??
 - trac #148 -- links in saved notebook worksheets


== Code ==
  * Symbolic calculus package (bobby m. etc): update

  * p-adic (David Roe): update

  * Integrate in code from Ling Long et al for congruence subgroups

  * Pyrex: interval arithmetic ring (volunteers?)

  * Pyrex: generic polynomial ring elements

  * Pyrex: generic power series over arbitrary ring

  * Pyrex: generic laurent series over arbitrary ring

  * Optimize matrix algebra over QQ, GF(p), ZZ (Stein, Bradshaw, Ifti B)
  - matrix permanents
  - multimodular algorithms
  - more optimizations for special rings (e.g., copy, etc.)
  - use ssmod as an example to motivate this
  - In the file matrix/docs.py is a list of base rings where specialized 
matrix classes should be implemented.  More specialized vector space and free 
module classes also need to be implemented in SageX.

  * Improve modular symbols and modular forms.  Some algorithms haven't been 
completely implemented.  (Some do things I never implemented in MAGMA.)
  - finish modular forms algorithms
  - enable modular forms doctests and test and fix
  - finish implementing modular symbols factorization in general 
(eisenstein part is currently not fully implemented)
  - computation of period mapping
  - more testing, examples, etc., for modular symbos for GammaH


== Documentation ==
  * SAGE Constructions (Stein, Kohel, Joyner): Update the constructions guide 
to use modern SAGE constructions to solve the problems.  No dirty tricks 
except in a dirty tricks section.



--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---