Scipy 2008 --  Sage
system:sage

<center>
<br><br><hr><br>
<img src="sage_logo.png">
<font color='black'><h1>William Stein</h1>
<h3>(I'm a Number Theory Professor in the<br>"Pure" Mathematics Department<br> at University of Washington, but I was a CS undergrad.)</h3>
<h1>Scipy 2008</h1></font>
<br><br>
<img src="scipy2008.png">

<br>

</center>

<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><hr>
<center>
<font color="#000099"><h1>Acknowledgement:</h1></font></center>
<center><table border=1 cellpadding=10 bgcolor="#fafafa" width=70%><tr><td>
I would like to profusely thank the organizers of Scipy 2008.  They've done a superb job putting
together this conference and making it an enjoyable, productive, and exciting
experience.   
</td></tr></table></center>

<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><hr>
<center>
<font color="#000099"><h1></h1></font></center>

<font size=+2>Observation: Scipy/Numpy/Enthought <b><i>does not meet the needs</i></b> of many users of mathematics software (otherwise, a lot less people
would use Matlab, Mathematica and Maple).</font>
<br><br>

<center><table border=1 cellpadding=10 bgcolor="#fafafa" width=70%><tr><td>
<font size=+1>From IRC last night:<br><br>
Sage and the notebook are *very* cool; they beg experimentation
in a way that "make sure you have x, y, and z installed also if 
you want to see any graphs" doesn't.
<br><br>
Making numerical solutions of ODEs as easy (or easier) in Sage as 
is in Mathematica would be a dream for me and I've been 
wondering about making the CAS do more work to put things in 
a form that they can be farmed out to specialized code.
<br><br>
With scipy's numerical solver, you need to put things in a very special 
form which involves tedious algebra, which is why we have CAS's.
</font>
</td></tr></table></center>

<br><br>
<br><br>
<center><table border=1 cellpadding=10 bgcolor="#cacaca" width=70%><tr><td>
<font size=+3>
<b>Sage Mission Statement:</b> Create a viable open source free alternative to Magma,
Maple, Mathematica, and Matlab. </font>
</td></tr></table></center>

<br><br><br>
<font size+1>
Thus our stated goal is to meet the needs of Magma, Maple, Mathematica, and
Matlab users.     Enthought's approach can <b>never</b> meet the needs of this
range of users because of their (very puzzling to me) refusal to use GPL'd code. 
Sage can.
</font>
 

<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><hr>
<font color="#000099"><h1  align='center'>History of Sage</h1></font>
<center>
<img src="sage_logo.png">
</center>
<center><table border=1 cellpadding=10 bgcolor="#fafafa" width=75%><tr><td>

<ol>
<li> <b>Berkeley 1995-2000:</b> I did my Ph.D. in Number Theory (Modular Forms) under Hendrik Lenstra, and wrote a massive
amount of C++ code, then moved entirely to Magma.  
<br><br>
<li> <b>Harvard 2000-2003:</b> I developed a lot of code in Magma, and convinced many people in my area
to use Magma.
<br><br>
<li> <b>Harvard 2003-2005:</b>
I realized that I had made a <font color='red'><b>major mistake</b></font> in embracing the closed
Magma system as my core research tool,<br>

<br><br>
<li> <b>Harvard late 2004:</b> I get tenure at UCSD and start investigating nontrivial options.
<br><br>
<li> <b>Harvard, January 2005:</b> I release Sage-0.1 and a long lonely year of very hard work follows.
<br><br>
<li> <b>UC San Diego, February 2006:</b> Sage-1.0 and Sage Days 1.  Get some help from David Joyner and David Kohel.
<br><br>
<li> <b>University of Washington, October 2006:</b> Sage Days 2; Start build a developer community that now numbers
well over 100 and is writing <font color="#700"><b>massive amounts of new very high quality code</b></font>.
<br><br>
<li> <b>November 2007:</b> Sage wins first prize in Scientific Category of Trophees du Libre (3000 euros, a laptop, etc.)  Developer base grows and matures substantially.
<li> <b>NOW:</b> An average of 800 new visitors to the website each day.  Well over 1000 complete downloads a month.   
</ol>
<center>
<img src="trophees.png">
</center>


</td></tr></table></center>





<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><hr>
<font color="#000099"><h1  align='center'>What is Sage?</h1></font>
<center>
<img src="sage_logo.png">
</center>
<center>
<table border=1 cellpadding=10 bgcolor="#fafafa" width=70%><tr><td>
<font size=+1>
<br><br>
<ol>
<li> A <b>completely free distribution</b> of the world's best open source mathematical software that builds easily from
source on Linux and OS X (and soon on Solaris and Microsoft Windows).  
Basically Sage <font color='red'><b>includes nearly everything</b></font> you need standard.
<br><br>
<li> Over three hundred thousand lines of <b>new code and documentation</b> that implements large amounts
of new functionality and provides a graphical interface.  A massive automated test suite. 
<br><br>
<li> <b>Unified interfaces to Magma, Mathematica, Maple,</b> Matlab, Axiom, Mupad, Singular, Macaulay2, etc., so it is 
easier for you to use all these programs together (for example, when migrating to Sage or making sure your new Sage code
is faster than anything else out there).
</ol>
</font>
</td></tr></table>
</center>

<br><br>

{{{id=4|

///
}}}

<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><hr>
<font color="#000099"><h1 align=center>3D Visualization</h1></font>

{{{id=317|

///
}}}

{{{id=316|
graphs.CircularLadderGraph(12).plot()
///
}}}

{{{id=296|
graphs.CircularLadderGraph(12).plot3d(zoom=1.1)
///
}}}

{{{id=213|
var('x,y')
f = sin(x^2+y^2)/(x^2+y^2)
icosahedron(size=pi/2.1,color='red') + \
    plot3d(f, (x,-pi,pi), (y,-pi,pi), opacity=0.85, zoom=1.2)
///
}}}

{{{id=214|
# Yoda! -- over 50,000 triangles.
from scipy import io
x = io.loadmat(DATA + 'yodapose.mat')
from sage.plot.plot3d.index_face_set import IndexFaceSet
V = x['V']; F3=x['F3']-1; F4=x['F4']-1
Y = IndexFaceSet(F3,V,color=Color('#00aa00')) + IndexFaceSet(F4,V,color=Color('#00aa00'))
Y = Y.rotateX(-1)
Y.show(aspect_ratio=[1,1,1], frame=False, figsize=4)
///
}}}

{{{id=288|
@interact
def _(points=selector([5..10], buttons=True, default=7), 
      interpolation_points=(15..50), 
      mesh=False, raytrace=False, seed=(18,(0..99))):
    print 'This uses Java 2D (jmol) and scipy.interpolate to draw a surface through some random points.'
    set_random_seed(seed)
    show(list_plot3d(random_matrix(RDF, points), interpolation_type='nn', 
         num_points=interpolation_points, 
         texture='red', frame_aspect_ratio=[1,1,1/2], mesh=mesh,
         viewer='tachyon' if raytrace else 'jmol'))
///

<html><div padding=6 id='div-interact-288'> <table width=800px height=400px bgcolor='#c5c5c5'
                 cellpadding=15><tr><td bgcolor='#f9f9f9' valign=top align=left><table><tr><td align=right><font color="black">points&nbsp;</font></td><td><table style="border:1px solid #dfdfdf;background-color:#efefef">
<tr><td><button style='border-style:outset;' value='0' onclick='$("BUTTON", this.parentNode).css("border-style", "outset"); $(this).css("border-style", "inset"); interact(288, "sage.server.notebook.interact.update(288, \"points\", 1, sage.server.notebook.interact.standard_b64decode(\""+encode64(this.value)+"\"), globals())")'>5</button>
<button style='border-style:outset;' value='1' onclick='$("BUTTON", this.parentNode).css("border-style", "outset"); $(this).css("border-style", "inset"); interact(288, "sage.server.notebook.interact.update(288, \"points\", 1, sage.server.notebook.interact.standard_b64decode(\""+encode64(this.value)+"\"), globals())")'>6</button>
<button style='border-style:inset;' value='2' onclick='$("BUTTON", this.parentNode).css("border-style", "outset"); $(this).css("border-style", "inset"); interact(288, "sage.server.notebook.interact.update(288, \"points\", 1, sage.server.notebook.interact.standard_b64decode(\""+encode64(this.value)+"\"), globals())")'>7</button>
<button style='border-style:outset;' value='3' onclick='$("BUTTON", this.parentNode).css("border-style", "outset"); $(this).css("border-style", "inset"); interact(288, "sage.server.notebook.interact.update(288, \"points\", 1, sage.server.notebook.interact.standard_b64decode(\""+encode64(this.value)+"\"), globals())")'>8</button>
<button style='border-style:outset;' value='4' onclick='$("BUTTON", this.parentNode).css("border-style", "outset"); $(this).css("border-style", "inset"); interact(288, "sage.server.notebook.interact.update(288, \"points\", 1, sage.server.notebook.interact.standard_b64decode(\""+encode64(this.value)+"\"), globals())")'>9</button>
<button style='border-style:outset;' value='5' onclick='$("BUTTON", this.parentNode).css("border-style", "outset"); $(this).css("border-style", "inset"); interact(288, "sage.server.notebook.interact.update(288, \"points\", 1, sage.server.notebook.interact.standard_b64decode(\""+encode64(this.value)+"\"), globals())")'>10</button>
</td></tr></table></td></tr>
<tr><td align=right><font color="black">interpolation_points&nbsp;</font></td><td><table><tr><td>
    	<div id='slider-interpolation_points-288' class='ui-slider-3' style='padding:0px;margin:0px;'><span class='ui-slider-handle'></span></div>
    	</td><td><font color='black' id='slider-interpolation_points-288-lbl'></font></td></tr></table><script>(function(){ var values = ["15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50"]; setTimeout(function() {
    $('#slider-interpolation_points-288').slider({
    	stepping: 1, minValue: 0, maxValue: 35, startValue: 0,
    	change: function () { var position = Math.ceil($('#slider-interpolation_points-288').slider('value')); if(values!=null) $('#slider-interpolation_points-288-lbl').text(values[position]); interact(288, "sage.server.notebook.interact.update(288, \"interpolation_points\", 2, sage.server.notebook.interact.standard_b64decode(\""+encode64(position)+"\"), globals())"); },
    	slide: function() { if(values!=null) $('#slider-interpolation_points-288-lbl').text(values[Math.ceil($('#slider-interpolation_points-288').slider('value'))]); }
    });
    if(values != null) $('#slider-interpolation_points-288-lbl').text(values[Math.ceil($('#slider-interpolation_points-288').slider('value'))]);
    }, 1); })();</script></td></tr>
<tr><td align=right><font color="black">mesh&nbsp;</font></td><td><input type='checkbox'  width=200px onchange='interact(288, "sage.server.notebook.interact.update(288, \"mesh\", 3, sage.server.notebook.interact.standard_b64decode(\""+encode64(this.checked)+"\"), globals())")'></input></td></tr>
<tr><td align=right><font color="black">raytrace&nbsp;</font></td><td><input type='checkbox'  width=200px onchange='interact(288, "sage.server.notebook.interact.update(288, \"raytrace\", 4, sage.server.notebook.interact.standard_b64decode(\""+encode64(this.checked)+"\"), globals())")'></input></td></tr>
<tr><td align=right><font color="black">seed&nbsp;</font></td><td><table><tr><td>
    	<div id='slider-seed-288' class='ui-slider-3' style='padding:0px;margin:0px;'><span class='ui-slider-handle'></span></div>
    	</td><td><font color='black' id='slider-seed-288-lbl'></font></td></tr></table><script>(function(){ var values = ["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59","60","61","62","63","64","65","66","67","68","69","70","71","72","73","74","75","76","77","78","79","80","81","82","83","84","85","86","87","88","89","90","91","92","93","94","95","96","97","98","99"]; setTimeout(function() {
    $('#slider-seed-288').slider({
    	stepping: 1, minValue: 0, maxValue: 99, startValue: 18,
    	change: function () { var position = Math.ceil($('#slider-seed-288').slider('value')); if(values!=null) $('#slider-seed-288-lbl').text(values[position]); interact(288, "sage.server.notebook.interact.update(288, \"seed\", 5, sage.server.notebook.interact.standard_b64decode(\""+encode64(position)+"\"), globals())"); },
    	slide: function() { if(values!=null) $('#slider-seed-288-lbl').text(values[Math.ceil($('#slider-seed-288').slider('value'))]); }
    });
    if(values != null) $('#slider-seed-288-lbl').text(values[Math.ceil($('#slider-seed-288').slider('value'))]);
    }, 1); })();</script></td></tr>
</table><div id='cell-interact-288'><?__SAGE__START>
        <table border=0 bgcolor='#white' width=100% height=100%>
        <tr><td bgcolor=white align=left valign=top><pre><?__SAGE__TEXT></pre></td></tr>
        <tr><td  align=left valign=top><?__SAGE__HTML></td></tr>
        </table><?__SAGE__END></div></td>
                 </tr></table></div>
                 </html>
CPU time: 0.01 s,  Wall time: 0.50 s
}}}

{{{id=215|

///
}}}

<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><hr>
<font color="#000099"><h1 align=center>Cython and Fortran</h1></font>
<center>
<img src="cython.png">
</center>

We make massive use of Cython to implement Sage. Over 100000 lines of the new Sage library code is written in Cython.

{{{id=216|
%cython

cdef inline double f(double x):
    return x*x*x - 3*x
    
def integrate_f(double a, double b, int N):
    cdef double s = 0
    cdef double dx = (b-a)/N
    cdef int i
    for i in range(N):
        s += f(a+i*dx)
    return s * dx
///
}}}

{{{id=217|
print integrate_f(float(1),float(20),10^4)
timeit('integrate_f(float(1),float(20),10^4)')
///
39393.7054601
625 loops, best of 3: 72.7 µs per loop
}}}

{{{id=312|
reset()
///
}}}

{{{id=277|
%fortran

      SUBROUTINE MANDELBROT(BIT)      
      INTEGER I, J
      INTEGER ITICS0, ITICS1
      REAL CPTIM
      REAL BIT(513,513)
cf2py intent(out) bit
      REAL COUNT
      REAL AA, BB, D
      COMPLEX Z, CC, NEWZ
      DATA NEWZ /(0.0,0.0)/, BB /2.5/, D /1.5/

c mandelbrot set test
      AA = 3.0 / FLOAT(512)
      DO 30 I = 1, 512
       DO 20 J = 1, 512
        CC = CMPLX(AA*FLOAT(I)-BB,AA*FLOAT(J)-D)
        Z = NEWZ
        COUNT = 256
   10   Z = Z * Z + CC
        COUNT = COUNT - 1
        IF (COUNT.GT.0.AND.CABS(Z).LT.4) GOTO 10
        BIT(J,I)=COUNT+1   
   20  CONTINUE
   30 CONTINUE
      AV = 0.0
      DO 50 I = 1, 512
       DO 40 J = 1, 512
        AV = AV + ALOG(1+ABS(BIT(I,J)))
   40  CONTINUE
   50 CONTINUE

      CPTIM = FLOAT(ITICS1-ITICS0) / 100.0

      END
///

None
}}}

{{{id=278|
time n = mandelbrot()
n.shape=(513,513)
matrix_plot(matrix(RDF,n),cmap='spectral')
///


CPU time: 1.33 s,  Wall time: 2.34 s
}}}

{{{id=289|

///
}}}

{{{id=225|

///
}}}

<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><hr>
<font color="#000099"><h1 align=center>Integrating and Plotting Functions</h1></font>

{{{id=219|
var('x')
f = asin(x) * log(x)
g = integral(f)
show(g)
///

<html><div class="math">\log \left( \frac{{2 \sqrt{ 1 - {x}^{2}  }}}{\left| x \right|} + \frac{2}{\left| x \right|} \right) + {\sin^{-1} \left( x \right) \left( {x \log \left( x \right)} - x \right)} + {\sqrt{ 1 - {x}^{2}  } \log \left( x \right)} - {2 \sqrt{ 1 - {x}^{2}  }}</div></html>
}}}

{{{id=110|
# Sage has a Mathematica-like plotting, built on top of matplotlib.
G = plot(f, (0,1), rgbcolor='red', thickness=3) 
G += plot(g - g(0.01), (0,1), thickness=3)
G.show(gridlines='minor')
///
}}}

{{{id=1|
# Very fast float evaluation, even of the very complicated expression g above.
fast = g._fast_float_(x)
z = float(1)
timeit('g(z)')
timeit('fast(z)')
///

125 loops, best of 3: 3.09 ms per loop
625 loops, best of 3: 835 ns per loop
}}}

{{{id=318|
timeit('2 + 2', preparse=False)
///

625 loops, best of 3: 35.1 ns per loop
}}}

{{{id=313|
3.0/(919*10^(-6))
///

3264.41784548422
}}}

{{{id=2|
time integral_numerical(fast, 0, 1)
///

(-0.75714832582414338, 2.8943543802338329e-11)
CPU time: 0.00 s,  Wall time: 0.00 s
}}}

{{{id=279|

///
}}}

{{{id=12|

///
}}}

<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><hr>
<font color="#000099"><h1 align=center>Interfaces</h1>

<table width=80% align=center><tr><td>
Sage has  pseudo-tty based interfaces to everything; this make it is possible to make extensive use of Maple, Mathematica,
Magma, Matlab, GAP, Maxima, Singular, PARI, and many other systems
from Sage.  
</td></tr></table>
<center>
<img src="car.png">
</center>

<br><br> Make it <b><i>much easier</i></b> to do computations using multiple 
math software systems (a good idea; see Alex Marteli's talk).

{{{id=280|
maxima.eval('2 + 3')
///

'5'
}}}

{{{id=281|
a = maxima('5'); a
///

5
}}}

{{{id=319|
a.integrate('x')
///

5*x
}}}

{{{id=320|
a.integrate
///

<bound method MaximaElement.integral of 5>
}}}

{{{id=282|
type(a)
///

<class 'sage.interfaces.maxima.MaximaElement'>
}}}

{{{id=283|
a.name()
///

'sage0'
}}}

{{{id=285|
a = mathematica('5'); a
///

5
}}}

{{{id=284|
type(a)
///

<class 'sage.interfaces.mathematica.MathematicaElement'>
}}}

{{{id=286|
a.name()
///

'sage0'
}}}

{{{id=287|
a.Integrate(x)
///

5*x
}}}

{{{id=57|
x = var('x')
f = sin(x^2) + sqrt(3)/pi^e
show(f)
///

<html><div class="math">\sin \left( {x}^{2}  \right) + \frac{\sqrt{ 3 }}{{\pi}^{e} }</div></html>
}}}

{{{id=243|
m = maxima(f); m
///

sin(x^2)+sqrt(3)/%pi^%e
}}}

{{{id=245|
m.name()
///

'sage4'
}}}

{{{id=132|
m = mathematica(f)  # requires mathematica!!
m
///

Sqrt[3]/Pi^E + Sin[x^2]
}}}

{{{id=7|

///
}}}

<br><br>
<font color="#333">WARNING -- kids, don't try this at home: It's 
a license violation to use Mathematica
from Sage via the notebook, since the EULA for Mathematica 
explicitly disallows any use of Mathematica via http. </font>
<br><br>

{{{id=8|
os.system('ps ax |grep Mathematica.app')
///
}}}

{{{id=60|
type(m)
///
}}}

{{{id=112|
m.name()
///
}}}

{{{id=9|
m.Integrate(x)
///
}}}

{{{id=246|
reset('r')
///
}}}

{{{id=247|
z = r('z <- array(1:20, dim=c(4,5))')
z
///

     [,1] [,2] [,3] [,4] [,5]
[1,]    1    5    9   13   17
[2,]    2    6   10   14   18
[3,]    3    7   11   15   19
[4,]    4    8   12   16   20
}}}

{{{id=248|
type(z)
///

<class 'sage.interfaces.r.RElement'>
}}}

{{{id=249|
z.mean()
///

[1] 10.5
}}}

{{{id=255|
z.sd()
///

[1] 1.290994 1.290994 1.290994 1.290994 1.290994
}}}

{{{id=63|
M = octave('rand(4)'); M
///



 0.230727 0.120852 0.360582 0.596342
 0.94515 0.91126 0.481142 0.481398
 0.188736 0.0326471 0.158264 0.694403
 0.959683 0.763152 0.339965 0.856096
}}}

{{{id=251|
M.eig()
///



 (2.12475,0)
 (-0.00565625,0.252413)
 (-0.00565625,-0.252413)
 (0.0429078,0)
}}}

{{{id=252|

///
}}}

{{{id=61|

///
}}}

{{{id=64|

///
}}}

<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><hr>
<font color="#000099"><h1 align=center>Combinatorics</h1></font>

<center><img src="combinat.png"></center>


<table width=80% align=center><tr><td>
<ol>
<li> Sage is very strong in algebraic combinatorics. 
<b>The MuPAD-Combinat project</b> -- founded by  Nicolas Thiery and Florent Hivert -- has officially decided to switch over to Sage,
and have already ported much of their code over.   Mike Hansen has done a massive amount of work on this.

<br><br><br>
<li>
Mike Hansen is porting Aldor-Combinat to Sage.

<br><br><br>

<li> Sage has a <b>massive amount of graph theory code</b>, including the only open source implementation of 
computation of automorphism groups of graphs (Robert Miller's), a large database (Jason Grout and Emily Kirkman),
and much much more. 
<br><br><br>



<li>


Sage makes extensive use of Symmetrica, Gap, Gfan, and NetworkX. 

</ol>
</td></tr></table>

{{{id=13|
G = graphs.CubeGraph(4); G
///
}}}

{{{id=67|
G.automorphism_group()
///
}}}

{{{id=14|
show(G)
///
}}}

{{{id=65|
G.plot3d(spin=True)
///
}}}

{{{id=68|

///
}}}

{{{id=15|

///
}}}

<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><hr>

<font color="#000099"><h1 align=center>Number Theory</h1></font>


<center><img src="number_theory.png"></center>

<table width=80% align=center><tr><td>
<ol>

<li> 
Sage has a wide range of number theory, including algebraic number fields,
modular forms, special functions, way more elliptic curve functionality
than any other open source program, and many elliptic and hyperelliptic curve
functions that are available in no other programs. 
<br><br>

<li>
Sage tightly builds on PARI, NTL, lcalc, Dokchiter, all of Cremona's code (both for curves and modular
symbols), sympow, genus2reduction, and other
number theory programs and libraries. 

</ol>
</td></tr></table>

{{{id=17|
show(factor(29308203480928340982340820934820983402348))
///
}}}

{{{id=71|
# The only existing open source implementation of "finding 
# all integral points on cubics", and is also the fastest money 
# can buy!

E = EllipticCurve('5077a')
html('<h1>$%s$</h1>'%latex(E))
print "ALL Integral Solutions:"
print E.integral_points()   # (new, thanks Nagel, Mardaus, and Cremona!!)
plot(E, thickness=3, rgbcolor='orange').show()
///

<html><font color='black'><h1><span class="math">y^2 + y = x^3 - 7x + 6 </span></h1></font></html>
ALL Integral Solutions:
[(-3 : 0 : 1), (-2 : 3 : 1), (-1 : 3 : 1), (0 : 2 : 1), (1 : 0 : 1), (2 : 0 : 1), (3 : 3 : 1), (4 : 6 : 1), (8 : 21 : 1), (11 : 35 : 1), (14 : 51 : 1), (21 : 95 : 1), (37 : 224 : 1), (52 : 374 : 1), (93 : 896 : 1), (342 : 6324 : 1), (406 : 8180 : 1), (816 : 23309 : 1)]
}}}

{{{id=19|

///
}}}

<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><hr>
<font color="#000099"><h1 align=center>Exact Linear Algebra</h1></font>

<center><img src="rref.png"></center>

<table width=80% align=center><tr><td>
<ol>

<li> 
Sage has optimized exact dense and sparse linear algebra over the rationals, integers, finite fields (especially GF(2)).  

<li>
Sage contains a large amount of new linear algebra code 
tightly integrated with Linbox, IML, NTL, Numpy, M4RI, and ATLAS.


</ol>
</td></tr></table>

{{{id=22|
a = random_matrix(ZZ,200, x=-2^16,y=2^16)  # 16-bit entries
#set_verbose(2)
s = cputime()
d = a.determinant()      # Uses Linbox, ATLAS, IML, and new Sage code.
print d
print "time: ", cputime(s)
#set_verbose(0)
///

-27400720853998693305091279018178326437040083072654254754258644334055210847668374953174531792869459826275202817685360160844872168772880571665877393090307312467466400278047826210376409534090623399789725730895732526349287828811106713560225670946256162498476492000839053322893359099760352527176630707330994587067771902651824987419048756051527486611464547292024855828204019133633588926713994970905086380307817818169427184718002997152056355956021038505735625361338568751552839664170656394717791191501765621060739270278210648004736091861394669240016581155841494842925956948166029779491965801852940979652249891563674441247155241179583517582155514307641261035783767955791910944243859794407121487964933297532312646857182721023343435711754416091178994115788200885493001145629586706865517864095731976452004857339497590737757279555467576455238099089892398244172053358837913185609184104212859972138522087827974222710175496197748987189966534526933292400911910773460483923492121729525894380688150509719893797937939018007429951180176193858778221569113496192332285247711041462718623050415081978599176463600127564131086789
time:  0.328561
}}}

{{{id=74|
magma.quit()
b = magma(a)
t = magma.cputime()
d2 = b.Determinant()
print 'Time: ', magma.cputime(t)
///

Time:  0.7
}}}

{{{id=103|
d == d2
///

True
}}}

{{{id=106|
b = mathematica(a)
///
}}}

{{{id=107|
mathematica.eval('Timing[Det[%s];]'%b.name())
///

         {13.9828, Null}
}}}

{{{id=260|
A = random_matrix(GF(2),5000, density=0.001)
///
}}}

{{{id=264|
A.visualize_structure()
///
}}}

{{{id=265|
time B = A^5    # A is a 5000x5000 sparse matrix over GF(2)
B.visualize_structure()
///

CPU time: 6.53 s,  Wall time: 6.88 s
}}}

{{{id=262|
time B.echelonize()
///

CPU time: 3.52 s,  Wall time: 3.72 s
}}}

{{{id=263|
B.visualize_structure()
///
}}}

{{{id=23|

///
}}}

{{{id=261|

///
}}}

<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><hr>
<font color="#000099"><h1 align=center>Numerical Computation and Statistics</h1></font>

<center><img src="numpy.png"> <img src="r.png"></center>

<table width=80% align=center><tr><td>
<ol>

<li> 
<font size=+1>Sage includes Numpy, Scipy, CVXOpt, R (and rpy), and some new code for quantative finance. </font>

</ol>
</td></tr></table>

{{{id=30|
import scipy.stats
scipy.stats.std([1..1000])
///
}}}

{{{id=82|
finance.TimeSeries([1..1000]).standard_deviation()
///
}}}

{{{id=257|
import rpy
print rpy.std([1..1000])
///
}}}

{{{id=314|
# pexpect r interface
sage.interfaces.all.r([1..1000]).sd()
///
}}}

{{{id=88|
time v = finance.TimeSeries(10^6).randomize('normal', 0, 0.01)
v.plot_histogram(100, rgbcolor='orange')
///


CPU time: 0.58 s,  Wall time: 0.64 s
}}}

{{{id=309|
v.sums().plot(150).show(frame=True, figsize=[9,3])
///
}}}

{{{id=315|
# This combines scipy's fft code and Sage's new stats code.
v = finance.fractional_brownian_motion_simulation(0.8,0.01,300,3)
line3d([(v[0][i],v[1][i],v[2][i]) for i in range(len(v[0]))], color='purple', thickness=3)
///
}}}

{{{id=310|

///
}}}

{{{id=31|

///
}}}

<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><hr>
<font color="#000099"><h1 align=center>Nearly Every Imaginable Number System</h1></font>

{{{id=306|
K.<i,j,k> = QuaternionAlgebra(QQ,-1,-1)
print K
i + (i+j+k)^2
///
}}}

{{{id=307|
S.<X,Y,Z> = PolynomialRing(GF(9,'a')); S
///
}}}

{{{id=25|
# insanely fast (we wrote a C++/Cython interface to Singular, which had
# never been usable in library mode before)
f = (X+Y+Z+1)^20
time g = f*(f+1)
///
}}}

{{{id=311|

///
}}}

{{{id=26|

///
}}}

<h1>Interval Arithmetic</h1>
We also have rigorous high precision interval arithmetic based on MPFR and MPFI, which works <b>exactly
the same on any OS/hardware</b>.   But our intervals do not work when their are multiple disjoint
parts, so we might want to create an optimized Cython-ized version of Stefano's interval package for
Sage (For basic arithmetic, it seems that Stefano's interval package is over 50 times slower than Sage's.)

{{{id=276|
RealNumber = float
def f(x,y):
    return ((333.75-x**2)* y**6 + x**2 * (11* x**2 * y**2-121 * y**4 -2) +
               5.5 * y**8 + x/(2*y))
f(77617,33096)
///

-1.1805916207174113e+21
}}}

{{{id=308|
@interact
def _(bits=(53..200)):
    RealNumber = RealField(bits)
    def f(x,y):
        return ((333.75-x**2)* y**6 + x**2 * (11* x**2 * y**2-121 * y**4 -2) +
                   5.5 * y**8 + x/(2*y))
    print f(77617,33096)
///

<html><div padding=6 id='div-interact-308'> <table width=800px height=400px bgcolor='#c5c5c5'
                 cellpadding=15><tr><td bgcolor='#f9f9f9' valign=top align=left><table><tr><td align=right><font color="black">bits&nbsp;</font></td><td><table><tr><td>
    	<div id='slider-bits-308' class='ui-slider-3' style='padding:0px;margin:0px;'><span class='ui-slider-handle'></span></div>
    	</td><td><font color='black' id='slider-bits-308-lbl'></font></td></tr></table><script>(function(){ var values = ["53","54","55","56","57","58","59","60","61","62","63","64","65","66","67","68","69","70","71","72","73","74","75","76","77","78","79","80","81","82","83","84","85","86","87","88","89","90","91","92","93","94","95","96","97","98","99","100","101","102","103","104","105","106","107","108","109","110","111","112","113","114","115","116","117","118","119","120","121","122","123","124","125","126","127","128","129","130","131","132","133","134","135","136","137","138","139","140","141","142","143","144","145","146","147","148","149","150","151","152","153","154","155","156","157","158","159","160","161","162","163","164","165","166","167","168","169","170","171","172","173","174","175","176","177","178","179","180","181","182","183","184","185","186","187","188","189","190","191","192","193","194","195","196","197","198","199","200"]; setTimeout(function() {
    $('#slider-bits-308').slider({
    	stepping: 1, minValue: 0, maxValue: 147, startValue: 0,
    	change: function () { var position = Math.ceil($('#slider-bits-308').slider('value')); if(values!=null) $('#slider-bits-308-lbl').text(values[position]); interact(308, "sage.server.notebook.interact.update(308, \"bits\", 13, sage.server.notebook.interact.standard_b64decode(\""+encode64(position)+"\"), globals())"); },
    	slide: function() { if(values!=null) $('#slider-bits-308-lbl').text(values[Math.ceil($('#slider-bits-308').slider('value'))]); }
    });
    if(values != null) $('#slider-bits-308-lbl').text(values[Math.ceil($('#slider-bits-308').slider('value'))]);
    }, 1); })();</script></td></tr>
</table><div id='cell-interact-308'><?__SAGE__START>
        <table border=0 bgcolor='#white' width=100% height=100%>
        <tr><td bgcolor=white align=left valign=top><pre><?__SAGE__TEXT></pre></td></tr>
        <tr><td  align=left valign=top><?__SAGE__HTML></td></tr>
        </table><?__SAGE__END></div></td>
                 </tr></table></div>
                 </html>
}}}

{{{id=299|
@interact
def _(bits=(100..130)):
    RealNumber = RealIntervalField(bits)
    def f(x,y):
        return ((333.75-x**2)* y**6 + x**2 * (11* x**2 * y**2-121 * y**4 -2) +
                   5.5 * y**8 + x/(2*y))
    print f(77617,33096)
///

<html><div padding=6 id='div-interact-299'> <table width=800px height=400px bgcolor='#c5c5c5'
                 cellpadding=15><tr><td bgcolor='#f9f9f9' valign=top align=left><table><tr><td align=right><font color="black">bits&nbsp;</font></td><td><table><tr><td>
    	<div id='slider-bits-299' class='ui-slider-3' style='padding:0px;margin:0px;'><span class='ui-slider-handle'></span></div>
    	</td><td><font color='black' id='slider-bits-299-lbl'></font></td></tr></table><script>(function(){ var values = ["100","101","102","103","104","105","106","107","108","109","110","111","112","113","114","115","116","117","118","119","120","121","122","123","124","125","126","127","128","129","130"]; setTimeout(function() {
    $('#slider-bits-299').slider({
    	stepping: 1, minValue: 0, maxValue: 30, startValue: 0,
    	change: function () { var position = Math.ceil($('#slider-bits-299').slider('value')); if(values!=null) $('#slider-bits-299-lbl').text(values[position]); interact(299, "sage.server.notebook.interact.update(299, \"bits\", 14, sage.server.notebook.interact.standard_b64decode(\""+encode64(position)+"\"), globals())"); },
    	slide: function() { if(values!=null) $('#slider-bits-299-lbl').text(values[Math.ceil($('#slider-bits-299').slider('value'))]); }
    });
    if(values != null) $('#slider-bits-299-lbl').text(values[Math.ceil($('#slider-bits-299').slider('value'))]);
    }, 1); })();</script></td></tr>
</table><div id='cell-interact-299'><?__SAGE__START>
        <table border=0 bgcolor='#white' width=100% height=100%>
        <tr><td bgcolor=white align=left valign=top><pre><?__SAGE__TEXT></pre></td></tr>
        <tr><td  align=left valign=top><?__SAGE__HTML></td></tr>
        </table><?__SAGE__END></div></td>
                 </tr></table></div>
                 </html>
}}}

{{{id=303|
RealNumber = float
def f1(x):
    return sqrt(x+1) - sqrt(x)
f1(9876543.21)
///
}}}

{{{id=302|
RealNumber = RealIntervalField(53)
def f1(x):
    return sqrt(x+1) - sqrt(x)
f1(9876543.21)
///
}}}

{{{id=301|
reset('RealNumber')
///
}}}

{{{id=304|
random_matrix(RIF, 10)
///

[-2.0000000000000000?              0.?e-17  1.0000000000000000?              0.?e-17 -2.0000000000000000?              0.?e-17  1.0000000000000000?  2.0000000000000000?  2.0000000000000000?  2.0000000000000000?]
[ 1.0000000000000000? -1.0000000000000000?  1.0000000000000000? -1.0000000000000000?  1.0000000000000000?  2.0000000000000000? -2.0000000000000000?              0.?e-17              0.?e-17 -1.0000000000000000?]
[             0.?e-17  1.0000000000000000?              0.?e-17  2.0000000000000000?  1.0000000000000000? -2.0000000000000000? -1.0000000000000000?  2.0000000000000000?  1.0000000000000000? -2.0000000000000000?]
[             0.?e-17  2.0000000000000000?              0.?e-17 -2.0000000000000000?  2.0000000000000000?  2.0000000000000000? -1.0000000000000000?  2.0000000000000000? -2.0000000000000000?  2.0000000000000000?]
[-1.0000000000000000?              0.?e-17 -2.0000000000000000?              0.?e-17 -1.0000000000000000?              0.?e-17 -1.0000000000000000? -1.0000000000000000? -1.0000000000000000?              0.?e-17]
[-2.0000000000000000?  2.0000000000000000? -2.0000000000000000?              0.?e-17 -2.0000000000000000?  1.0000000000000000? -2.0000000000000000?  2.0000000000000000? -1.0000000000000000?  1.0000000000000000?]
[-1.0000000000000000? -1.0000000000000000? -2.0000000000000000? -2.0000000000000000? -1.0000000000000000? -1.0000000000000000?  2.0000000000000000?              0.?e-17 -1.0000000000000000? -2.0000000000000000?]
[ 1.0000000000000000? -1.0000000000000000?              0.?e-17  2.0000000000000000?              0.?e-17 -2.0000000000000000?  1.0000000000000000?  1.0000000000000000?  2.0000000000000000?              0.?e-17]
[ 1.0000000000000000?              0.?e-17 -2.0000000000000000?              0.?e-17 -1.0000000000000000? -1.0000000000000000?  2.0000000000000000? -1.0000000000000000? -2.0000000000000000? -1.0000000000000000?]
[             0.?e-17              0.?e-17 -2.0000000000000000? -1.0000000000000000?  2.0000000000000000?  2.0000000000000000? -2.0000000000000000?  2.0000000000000000?              0.?e-17 -1.0000000000000000?]
}}}

{{{id=305|

///
}}}

{{{id=295|

///
}}}

{{{id=300|

///
}}}

<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><hr>
<font color="#000099"><h1 align=center>Hidden Markov Models</h1></font>

The next version of Sage will include GHMM with new Cython bindings, for very
efficient computation with generalized hidden Markov models.   GHMM is a C library
developed by the Algorithmics group at the Max Planck Institute for Molecular Genetics
over the last ten years.  It's extremely useful in computational biology, machine
learning, etc.

{{{id=294|
@interact
def foo(phrase = 'numpy scipy matplotlib sage', states=(3,(1..40)), 
        output = (1000,(100..2000)),
        show_model=False, seed=(0..100)):
    print "Type in a some text.  This will train a Hidden Markov Model with %s states to generate similar text."%states
    set_random_seed(seed)
    A = random_matrix(RDF, states).apply_map(abs)
    B = [[random() for _ in range(27)] for _ in range(states)]
    letters = [chr(97+i) for i in range(26)] + [' ']
    H = hmm.DiscreteHiddenMarkovModel(A,B, [1]*states, letters)
    H.normalize()
    phrase = (' ' + phrase + ' ').lower()
    phrase = [x for x in phrase if x in letters]
    try:
        H.baum_welch(phrase)
    except Exception, msg:
        pass
    print "Here is the text:\n\n"
    print ''.join(H.sample(output))
    print '\n'*2
    if show_model:
        show(matrix_plot(H.transition_matrix()))
        show(matrix_plot(H.emission_matrix()))        
        dx = dict([ (i, [j for j in range(A.ncols()) if abs(A[i,j])>0.2])   for i in range(A.nrows())])
        show(plot(Graph(dx)))
///

<html><div padding=6 id='div-interact-294'> <table width=800px height=400px bgcolor='#c5c5c5'
                 cellpadding=15><tr><td bgcolor='#f9f9f9' valign=top align=left><table><tr><td align=right><font color="black">phrase&nbsp;</font></td><td><input type='text' value='numpy scipy matplotlib sage' size=80 onchange='interact(294, "sage.server.notebook.interact.update(294, \"phrase\", 15, sage.server.notebook.interact.standard_b64decode(\""+encode64(this.value)+"\"), globals())")'></input></td></tr>
<tr><td align=right><font color="black">states&nbsp;</font></td><td><table><tr><td>
    	<div id='slider-states-294' class='ui-slider-3' style='padding:0px;margin:0px;'><span class='ui-slider-handle'></span></div>
    	</td><td><font color='black' id='slider-states-294-lbl'></font></td></tr></table><script>(function(){ var values = ["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40"]; setTimeout(function() {
    $('#slider-states-294').slider({
    	stepping: 1, minValue: 0, maxValue: 39, startValue: 2,
    	change: function () { var position = Math.ceil($('#slider-states-294').slider('value')); if(values!=null) $('#slider-states-294-lbl').text(values[position]); interact(294, "sage.server.notebook.interact.update(294, \"states\", 16, sage.server.notebook.interact.standard_b64decode(\""+encode64(position)+"\"), globals())"); },
    	slide: function() { if(values!=null) $('#slider-states-294-lbl').text(values[Math.ceil($('#slider-states-294').slider('value'))]); }
    });
    if(values != null) $('#slider-states-294-lbl').text(values[Math.ceil($('#slider-states-294').slider('value'))]);
    }, 1); })();</script></td></tr>
<tr><td align=right><font color="black">output&nbsp;</font></td><td><table><tr><td>
    	<div id='slider-output-294' class='ui-slider-3' style='padding:0px;margin:0px;'><span class='ui-slider-handle'></span></div>
    	</td><td><font color='black' id='slider-output-294-lbl'></font></td></tr></table><script>(function(){ var values = ["100","103","107","111","115","119","122","126","130","134","138","141","145","149","153","157","160","164","168","172","176","179","183","187","191","195","198","202","206","210","214","218","221","225","229","233","237","240","244","248","252","256","259","263","267","271","275","278","282","286","290","294","297","301","305","309","313","317","320","324","328","332","336","339","343","347","351","355","358","362","366","370","374","377","381","385","389","393","396","400","404","408","412","416","419","423","427","431","435","438","442","446","450","454","457","461","465","469","473","476","480","484","488","492","495","499","503","507","511","515","518","522","526","530","534","537","541","545","549","553","556","560","564","568","572","575","579","583","587","591","594","598","602","606","610","614","617","621","625","629","633","636","640","644","648","652","655","659","663","667","671","674","678","682","686","690","693","697","701","705","709","713","716","720","724","728","732","735","739","743","747","751","754","758","762","766","770","773","777","781","785","789","792","796","800","804","808","812","815","819","823","827","831","834","838","842","846","850","853","857","861","865","869","872","876","880","884","888","891","895","899","903","907","911","914","918","922","926","930","933","937","941","945","949","952","956","960","964","968","971","975","979","983","987","990","994","998","1002","1006","1010","1013","1017","1021","1025","1029","1032","1036","1040","1044","1048","1051","1055","1059","1063","1067","1070","1074","1078","1082","1086","1089","1093","1097","1101","1105","1109","1112","1116","1120","1124","1128","1131","1135","1139","1143","1147","1150","1154","1158","1162","1166","1169","1173","1177","1181","1185","1188","1192","1196","1200","1204","1208","1211","1215","1219","1223","1227","1230","1234","1238","1242","1246","1249","1253","1257","1261","1265","1268","1272","1276","1280","1284","1287","1291","1295","1299","1303","1307","1310","1314","1318","1322","1326","1329","1333","1337","1341","1345","1348","1352","1356","1360","1364","1367","1371","1375","1379","1383","1386","1390","1394","1398","1402","1406","1409","1413","1417","1421","1425","1428","1432","1436","1440","1444","1447","1451","1455","1459","1463","1466","1470","1474","1478","1482","1485","1489","1493","1497","1501","1505","1508","1512","1516","1520","1524","1527","1531","1535","1539","1543","1546","1550","1554","1558","1562","1565","1569","1573","1577","1581","1584","1588","1592","1596","1600","1604","1607","1611","1615","1619","1623","1626","1630","1634","1638","1642","1645","1649","1653","1657","1661","1664","1668","1672","1676","1680","1683","1687","1691","1695","1699","1703","1706","1710","1714","1718","1722","1725","1729","1733","1737","1741","1744","1748","1752","1756","1760","1763","1767","1771","1775","1779","1782","1786","1790","1794","1798","1802","1805","1809","1813","1817","1821","1824","1828","1832","1836","1840","1843","1847","1851","1855","1859","1862","1866","1870","1874","1878","1881","1885","1889","1893","1897","1901","1904","1908","1912","1916","1920","1923","1927","1931","1935","1939","1942","1946","1950","1954","1958","1961","1965","1969","1973","1977","1980","1984","1988","1992","1996","2000"]; setTimeout(function() {
    $('#slider-output-294').slider({
    	stepping: 1, minValue: 0, maxValue: 499, startValue: 236,
    	change: function () { var position = Math.ceil($('#slider-output-294').slider('value')); if(values!=null) $('#slider-output-294-lbl').text(values[position]); interact(294, "sage.server.notebook.interact.update(294, \"output\", 17, sage.server.notebook.interact.standard_b64decode(\""+encode64(position)+"\"), globals())"); },
    	slide: function() { if(values!=null) $('#slider-output-294-lbl').text(values[Math.ceil($('#slider-output-294').slider('value'))]); }
    });
    if(values != null) $('#slider-output-294-lbl').text(values[Math.ceil($('#slider-output-294').slider('value'))]);
    }, 1); })();</script></td></tr>
<tr><td align=right><font color="black">show_model&nbsp;</font></td><td><input type='checkbox'  width=200px onchange='interact(294, "sage.server.notebook.interact.update(294, \"show_model\", 18, sage.server.notebook.interact.standard_b64decode(\""+encode64(this.checked)+"\"), globals())")'></input></td></tr>
<tr><td align=right><font color="black">seed&nbsp;</font></td><td><table><tr><td>
    	<div id='slider-seed-294' class='ui-slider-3' style='padding:0px;margin:0px;'><span class='ui-slider-handle'></span></div>
    	</td><td><font color='black' id='slider-seed-294-lbl'></font></td></tr></table><script>(function(){ var values = ["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59","60","61","62","63","64","65","66","67","68","69","70","71","72","73","74","75","76","77","78","79","80","81","82","83","84","85","86","87","88","89","90","91","92","93","94","95","96","97","98","99","100"]; setTimeout(function() {
    $('#slider-seed-294').slider({
    	stepping: 1, minValue: 0, maxValue: 100, startValue: 0,
    	change: function () { var position = Math.ceil($('#slider-seed-294').slider('value')); if(values!=null) $('#slider-seed-294-lbl').text(values[position]); interact(294, "sage.server.notebook.interact.update(294, \"seed\", 19, sage.server.notebook.interact.standard_b64decode(\""+encode64(position)+"\"), globals())"); },
    	slide: function() { if(values!=null) $('#slider-seed-294-lbl').text(values[Math.ceil($('#slider-seed-294').slider('value'))]); }
    });
    if(values != null) $('#slider-seed-294-lbl').text(values[Math.ceil($('#slider-seed-294').slider('value'))]);
    }, 1); })();</script></td></tr>
</table><div id='cell-interact-294'><?__SAGE__START>
        <table border=0 bgcolor='#white' width=100% height=100%>
        <tr><td bgcolor=white align=left valign=top><pre><?__SAGE__TEXT></pre></td></tr>
        <tr><td  align=left valign=top><?__SAGE__HTML></td></tr>
        </table><?__SAGE__END></div></td>
                 </tr></table></div>
                 </html>
}}}

{{{id=293|

///
}}}

{{{id=270|

///
}}}

<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><hr>
<font color="#000099"><h1 align=center>Easy Parallelization</h1></font>
<br><br>
Sage ships the awesome pyprocessing with a little decorator to make it easier to use.
<br><br>

{{{id=122|
# For example, simple parallel computing:
@parallel(2)
def foo(n):
    k = 0
    for i in range(10^7):
        k += n
    return k
///
}}}

{{{id=123|
time foo(5)
///
}}}

{{{id=121|
%time
for z in foo([1,2]): print z
///
}}}

{{{id=292|

///
}}}

{{{id=291|

///
}}}

{{{id=290|

///
}}}

{{{id=273|

///
}}}

<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><hr>

<font color="#000099"><h1  align='center'>The Sage Website</h1></font>

<br><br>
We have a new webmaster: Harald Schilly. 

<br><br>
<h1>Quick tour of website... <a href="http://sagemath.org">http://sagemath.org</a></h1> and also 


<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><hr>

<font color="#000099"><h1  align='center'>Every Single Copy of Sage Includes...</h1></font>

<table width=80% bgcolor="#fafafa" color="#222" align=center><tr><td>
 <ol>
  <li><a target="_blank"
     href="http://math-atlas.sourceforge.net/">ATLAS</a>: Automatically Tuned Linear Algebra
     Software</li>

  <li><a target="_blank"
     href="http://www.netlib.org/blas">BLAS</a>: Basic Fortan 77 linear algebra routines</li>

  <li><a target="_blank"
     href="http://www.bzip.org/">Bzip2</a>: High-quality data compressor</li>

  <li><a target="_blank"
     href="http://www.ifor.math.ethz.ch/%7Efukuda/cdd_home">Cddlib</a>: Double Description Method
     of Motzkin</li>


  <li><a target="_blank"
     href="http://clisp.cons.org/">Common Lisp</a>: Multiparadigm and general-purpose programming
     language</li>

  <li><a target="_blank"
     href="http://abel.ee.ucla.edu/cvxopt">CVXOPT</a>: Convex optimization, linear programming,
     least squares, etc.</li>

  <li><a target="_blank"
     href="http://www.cython.org">Cython</a>: C-Extensions for Python</li>

  <li><a target="_blank"
     href="http://www.netlib.org/f2c/">F2c</a>: Converts Fortran 77 to C code</li>

  <li><a target="_blank"
     href="http://www.flintlib.org/">Flint</a>: Fast Library for Number Theory</li>

  <li><a target="_blank"
     href="http://perso.ens-lyon.fr/damien.stehle/english.html#software">FpLLL</a>: Euclidian
     lattice reduction</li>

  <li><a target="_blank"
     href="http://www.freetype.org/">FreeType</a>: A Free, High-Quality, and Portable Font
     Engine</li>

  <li><a target="_blank"

     href="http://www.g95.org">G95</a>: Open source Fortran 95 compiler</li>

  <li><a target="_blank"
     href="http://www-groups.dcs.st-and.ac.uk/%7Egap/">GAP</a>: Groups, Algorithms,
     Programming</li>

  <li><a target="_blank"
     href="http://www.libgd.org/Main_Page">GD</a>: Dynamic graphics generation tool</li>

  <li><a target="_blank"
     href="http://www.math.u-bordeaux.fr/%7Eliu/G2R/">Genus2reduction</a>: Curve data
     computation</li>

  <li><a target="_blank"
     href="http://www.math.tu-berlin.de/%7Ejensen/software/gfan/gfan.html">Gfan</a>: Grbner fans
     and tropical varieties</li>

  <li><a target="_blank"
     href="http://ljk.imag.fr/CASYS/LOGICIELS/givaro/">Givaro</a>: C++ library for arithmetic and
     algebra</li>

  <li><a target="_blank"
     href="http://www.swox.com/gmp/">GMP</a>: GNU Multiple Precision Arithmetic Library</li>

  <li><a target="_blank"






     href="http://gforge.inria.fr/projects/ecm/">GMP-ECM</a>: Elliptic Curve Method for Integer
     Factorization</li>

  <li><a target="_blank"
     href="http://www.gnu.org/software/gnutls/">GNU TLS</a>: Secure networking</li>

  <li><a target="_blank"
     href="http://www.gnu.org/software/gsl/">GSL</a>: Gnu Scientific Library</li>

  <li><a target="_blank"
     href="http://www.math.union.edu/%7Edpvc/jsMath/">JsMath</a>: JavaScript implementation of
     LaTeX</li>

  <li><a target="_blank"
     href="http://www.cs.uwaterloo.ca/%7Ez4chen/iml.html">IML</a>: Integer Matrix Library</li>

  <li><a target="_blank"
     href="http://ipython.scipy.org/">IPython</a>: Interactive Python shell</li>

  <li><a target="_blank"
     href="http://www.netlib.org/lapack/">LAPACK</a>: Fortan 77 linear algebra library</li>

  <li><a target="_blank"
     href="http://pmmac03.math.uwaterloo.ca/%7Emrubinst/L_function_public/CODE/">Lcalc</a>:
     L-functions calculator</li>

  <li><a target="_blank"
     href="http://directory.fsf.org/project/libgcrypt/">Libgcrypt</a>: General purpose
     cryptographic library</li>


  <li><a target="_blank"
     href="http://www.gnupg.org/related_software/libgpg-error/">Libgpg-error</a>: Common error
     values for GnuPG components</li>

  <li><a target="_blank"
     href="http://www.linalg.org/">Linbox</a>: C++ linear algebra library</li>

  <li><a href="http://m4ri.sagemath.org/"
     target="_blank">M4RI</a>: Linear Algebra over GF(2)</li>

  <li><a target="_blank"
     href="http://matplotlib.sourceforge.net/">Matplotlib</a>: Python plotting library</li>

  <li><a target="_blank"
     href="http://maxima.sourceforge.net/">Maxima</a>: computer algebra system</li>

  <li><a target="_blank"
     href="http://www.selenic.com/mercurial/wiki/index.cgi">Mercurial</a>: Revision control
     system</li>

  <li><a target="_blank"
     href="http://moinmoin.wikiwikiweb.de/">MoinMoin Wiki</a></li>



  <li><a target="_blank"
     href="http://perso.ens-lyon.fr/nathalie.revol/software.html">MPFI</a>: Multiple Precision
     Floating-point Interval library</li>

  <li><a target="_blank"
     href="http://www.mpfr.org/">MPFR</a>: C library for multiple-precision floating-point
     computations with correct rounding</li>

  <li>ECLib:Cremona's Programs for Elliptic curves</li>


  <li><a target="_blank"
     href="https://networkx.lanl.gov/wiki">NetworkX</a>: Graph theory</li>

  <li><a target="_blank"
     href="http://www.shoup.net/ntl/">NTL</a>: Number theory C++ library</li>

  <li><a target="_blank"
     href="http://numpy.scipy.org/">Numpy</a>: Numerical linear algebra</li>

  <li><a target="_blank"
     href="http://www.gnu.org/software/gnutls/">OpenCDK</a>: Open Crypto Development Kit</li>

  <li><a target="_blank"
     href="http://hep.itp.tuwien.ac.at/%7Ekreuzer/CY/CYpalp.html">PALP</a>: A Package for Analyzing
     Lattice Polytopes</li>


  <li><a target="_blank"
     href="http://pari.math.u-bordeaux.fr/">PARI/GP</a>: Number theory calculator</li>

  <li><a target="_blank"
     href="http://pexpect.sourceforge.net/">Pexpect</a>: Pseudo-tty control for Python</li>

  <li><a target="_blank"
     href="http://www.libpng.org/pub/png/libpng.html">PNG</a>: Bitmap image support</li>

  <li><a target="_blank"
     href="http://polybori.sourceforge.net/">PolyBoRi</a>: Polynomials Over Boolean Rings</li>

  <li><a target="_blank"
     href="http://www.amk.ca/python/code/crypto">PyCrypto</a>: Python Cryptography Toolkit</li>

  <li><a target="_blank"
     href="http://www.python.org/">Python</a>: Interpreted language</li>

  <li><a target="_blank"
     href="http://www.cs.berkeley.edu/%7Eyozo/">Qd</a>: Quad-double/Double-double Computation
     Package</li>

  <li><a target="_blank"
     href="http://www.r-project.org/">R</a>: Statistical Computing</li>

  <li><a target="_blank"
     href="http://cnswww.cns.cwru.edu/%7Echet/readline/rltop.html">Readline</a>: Line-editing</li>

  <li><a target="_blank"
     href="http://rpy.sourceforge.net/">Rpy</a>: Python interface to R</li>

  <li><a target="_blank"
     href="http://www.scipy.org/">Scipy</a>: Python library for scientific computation</li>


  <li><a target="_blank"
     href="http://www.singular.uni-kl.de/">Singular</a>: fast commutative and noncommutative
     algebra</li>

  <li><a target="_blank"
     href="http://www.scons.org/">Scons</a>: Software construction tool</li>

  <li><a target="_blank"
     href="http://www.sqlite.org/">SQLite</a>: Relation database</li>

  <li><a target="_blank"
     href="http://www.maths.bris.ac.uk/%7Emamjw/">Sympow</a>: L-function calculator</li>

  <li><a target="_blank"
     href="http://www.mathe2.uni-bayreuth.de/axel/symneu_engl.html">Symmetrica</a>: Representation
     theory</li>

  <li><a target="_blank"
     href="http://code.google.com/p/sympy/">Sympy</a>: Python library for symbolic computation</li>

  <li><a target="_blank"
     href="http://jedi.ks.uiuc.edu/%7Ejohns/raytracer/">Tachyon</a>: lightweight 3d ray tracer</li>

  <li><a target="_blank"
     href="http://www.catb.org/%7Eesr/terminfo/">Termcap</a>: Simplifies the process of writing
     portable text mode applications</li>

  <li><a target="_blank"
     href="http://twistedmatrix.com/trac/">Twisted</a>: Python networking library</li>

  <li><a target="_blank"
     href="http://www.scipy.org/Weave">Weave</a>: Tools for including C/C++ code within Python</li>

  <li><a target="_blank"
     href="http://www.zlib.net/">Zlib</a>: Data compression library</li>

  <li><a target="_blank"
     href="http://www.zope.org/Wikis/ZODB/">ZODB</a>: Object-oriented database</li>
 </ol>
</td></tr></table>

<br><br>
This is over <font color='darkblue'><b>over five million</b></font> lines of source code.
<b>You</b> can build this on almost any Linux or OS X box out there as follows:
<font size=+3><pre>
@ tar xf sage-3.1.1.tar
@ cd sage-3.1.1
@ make
...
real    105m8.635s
SAGE build/upgrade complete!

@ ./sage
----------------------------------------------------------------------
| SAGE Version 3.1.1, Release Date: 2008-07-11                       |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------


sage: notebook()
</pre></font>

<table border=1 align=center><tr><td>
<img width=450 src="nb.png">
</td></tr></table>



<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><hr>
<font color="#000099"><h1 align=center>Debianization of Sage</h1></font>
<center>
I want <font size=+2><tt>apt-get install sagemath</tt></font>!
</center>

<table width=50% align=center><tr><td>
<font size=+2><pre>
From: Tim Abbot <tabbott@mit.edu>
Date: Tue, Jul 22, 2008 at 4:44 AM

I figured I'd give everyone an update on how things are going with the
Sage packages.  I believe (but am not certain) that all of the Sage
dependencies that I want to get into Lenny will make it, though I'm still
waiting on final review for 5 of them that had copyright problems in the
past.

On the other hand, Debian is freezing everything starting in around 5 
or 6 days.  So, I need to have a presentable Sage package in the very 
near future.

There are currently a few showstopper problems:

 * [M4Ri problems...]

 * [Linbox problems...]

 -Tim Abbott
</pre></font></td></tr></table>
<center>
<font color="#333">
Sage has got tons of math
software into Debian that might <i>never</i> otherwise got in.
</font>
</center>



<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><hr>
<font color="#000099"><h1 align='center'>Around 100 Developers</h1></font>
<center>
<font size=+2><b>Sage is an international project with around <font color='darkred'>100 developers</font></b></font>
<br>
<br>
<a href="http://sagemath.org/development-map.html" target="_new"><img src="map.png"></a>


</center>

<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><hr>
<font color="#000099"><h1 align=center>Sage Days Workshops</h1></font>
<br><br>
<table align=center border=1 cellpadding=20 bgcolor="#fafafa" color="#222" width=75%><tr><td>
<ol>
<li> February 2006: Sage Days 1 at UC San Diego
<li> October 2006: Sage Days 2 at University of Washington
<li> February 2007: Sage Days 3 at UC Los Angeles (IPAM)
<li> June 2007: Sage Days 4 at University of Washington
<li> October 2007: Sage Days 5 at the Clay Mathematics Institute
<li> November 2007: Sage Days 6 at Bristol, UK
<li> February 2008: Sage Days 7 at UC Los Angeles (IPAM)
<li> March 2008: Sage Days 8 at Austin, Texas (Enthought)
<li> June 2008: Sage Days 8.5 at University of Washington
<li> August 2008: Sage Days 9 in Vancouver (SFU)
<li> October 2008: Sage Days 10 in Nancy, France (INRIA)
<li> November 2008: Sage Days 11 in Austin, Texas (UT Austin)
<li> January 2009: Sage Days 12 in San Diego, CA
<li> March 2009: Sage Days 13 in Athens, Georgia (UGA)
</ol>
</td></tr></table>
<center>
<img src="sagedays2moment.png">
</center>

<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><hr>
<font color="#000099"><h1 align=center>Funding</h1></font>

Funded by NSF, Microsoft, Google, DoD, UW, and other universities 
and institutes.
<br>
<center>
 <img height=100 src="msr.png"> <img height=100 src="nsf.png"> <img height=100 src="google.png">
 <img height=100 src="dod.png">
</center>



<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><hr>
<br><br><br>
<font color="#000099" size=+1><h1 align='center'>Main Short-term Goals</h1></font>

<table align=center border=1 cellpadding=20 bgcolor="#fafafa" color="#222" width=75%><tr><td>
<ol>
<li> Switch from Maxima to a Python-based version of 
Ginac as the backend for Calculus-style symbolic manipulation.  Also replace clisp by ecl. 
<li> Port Sage to <b>32/64-bit MSVC Windows (funded by Microsoft)</b>.  Unfortunately, Enthought
<i>so far won't collaborate with us on this</i>. <b>LAME.</b>
<li> Port Sage to <b>64-bit OS X</b>
<li> Port Sage to <b>Solaris</b>
<li> Increase <b>doctest coverage</b> to 100% (currently 56.2% of the 20850 functions in Sage are doctested, or
65648 lines of input tests).  
<li> Redo our documentation using <b>Sphinx</b>: <a href="http://wiki.sagemath.org/SphinxSEP">Sphinx SEP</a>. 
<li> 100,000 Users
</ol>
</td></tr></table>

<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><hr>
<br><br><br>
<font color="#000099" size=+4><h1 align='center'>Questions?</h1></font>

{{{id=6|

///
}}}

{{{id=111|

///
}}}