GSoC 2013
Sage Project Proposals

Introduction

Links

UI: Notebook

UI Enhancements

Datasheets

Interactive 2d plots

Additional Notebook Ideas

Virtual Machine GUI

Back-end

Easy Server Deployment

Greatly improve the pseudo-tty interfaces between Sage and the big Ma's: Mathematica, Maple, and Matlab.

Improving Startup Time

Piecewise Functions

Advanced Symbolic Expression Manipulation

Symbolic Expressions

Mathematical Function Library

Semidefinite Programming and sums of squares of real multivariate polynomials

UI: Mobile Applications

Android & Android Tablets

Apple iOS/iPad

Regression Testing Framework

Get Sage ready for Linux distributions (Debian)

Libs: Underlying Libraries

Maxima/Numerical Mathematics

Combinatorics

Matroid theory

Student’s Proposal Template

Contact

Introduction

Sage is a GPLed open-source mathematical software system. It is designed to be not just a computer algebra system, but more like a complete environment for doing mathematics and related calculations. It is based on a vast collection of existing open-source software tools and libraries and ties them together via Python. This is also the primary interface language for the user and its object-oriented way of expressing concepts is used to express calculations - of course, there are also many “normal” functions :-) Behind the scenes, the Sage library executes the commands and calculations by its own algorithms or by accessing appropriate routines from the included software packages. On top of that, there are various ways how users can interact with Sage, most notably a dynamic web-site called “Notebook”.

All projects will start with an introduction phase to learn about Sage’s internal organization and to get used to its established development process. This is documented in the documentation for developers and all students will be instructed by the mentors on how to get their hands dirty. We use Mercurial for revision control and trac for organizing development and code review. Our license is GPLv2+. Feel free to contact Mentors before you send us project proposals, contact details are at the bottom. Feel free to introduce yourself and your project idea in our mailing list. To get a better feeling of Sage’s features, please check out the documentation, especially the thematic tutorials.

 Student’s proposal template at the bottom.

Links


Project Proposals

This list of possible projects is organized into categories, starting with the web-based notebook interface.

UI: Notebook

The Sage Notebook is the primary graphical interface for Sage. It consists of a Python-based server back-end evaluating the computations and a rich interactive Ajax-based website. It has a user management, each user has a list of worksheets and each worksheet consists of cells that are evaluated on the server and the output is sent back to the website. The following batch of notebook specific proposals outline projects for improving the notebook on different levels.

The core team behind the notebook consists of several people who very welcome new contributors. You can access a Sage Notebook at www.sagenb.org or demo.sagenb.org, which has proven to be a very successful way of enabling average users to access an advanced mathematics suite online. Their dedicated mailing list is here.

UI Enhancements

Description

In the Sage Notebook, each user opens a worksheet to interact with Sage for doing mathematics. A worksheet is a list of alternating input/output cells. To actually do computations, one has to know about the commands and basic Python in order to do any calculations. Currently, a new user has to read the tutorial to get started, which needs time and is a barrier for new users.

The aim of this project is to make it easier for novice users to actually use the notebook and help them entering common calculations. This could be done via several independent enhancements:

  • Assessing commonly used functions by examining published notebooks and the written documentation.
  • A menu with entries and sub-entries, collecting common functions by topic - then providing:
  • Code-snippets with adequate descriptions.
  • Wizard dialogs that help accomplishing common calculations or plots.
  • e.g. along the ideas of: http://sagemath.org/eval.html
  • Enhancing the documentation, make it more accessible through the Notebook UI. Cross-Referencing.
  • Enhancing the auto-complete functionality, e.g. containing descriptions for the methods.
  • Interactive step-by-step tutorials to accomplish common calculations.

Mentor

Jason Grout

backup: Dan Drake, William Stein

Difficulty

Easy

Skills

  • HTML/CSS, Javascript (jQuery, AJAX), basic Python
  • UI-Design of online Applications

Datasheets

Description

Currently, the ways to include data from other sources than the notebook  itself is limited to the capabilities of Python (e.g. reading a CSV file via Python’s CSV module)

The goal of this project is to make it easier to import and edit data in the form of simple spreadsheets and databases from within worksheets in the notebook.

  1. The project starts by evaluating existing options for integrating spreadsheets (e.g. http://grridjs.org)
  2. Suitable front-end and back-end code needs to be written for an initial basic integration.
  3. The second part consists of adding more features, like typed columns, database access, creating new Sage specific types (as overlays of Python’s “pandas” library) or integrating Google Docs Spreadsheets, …

Mentor

Jason Grout

backup: Mike Hansen, William Stein

Difficulty

Intermediate

Skills

  • HTML/CSS, JavaScript
  • Python

Interactive 2d plots

Description

Sage’s 3d plots are dynamic: the user can zoom in and out and rotate the image. By contrast, 2d plots are static: the user can see a picture, but cannot zoom in on features of interest, zoom out to obtain a more global perspective, trace along the curve, or pan the view. The goal of this project is to add features like this to 2d plots, at least in the notebook view, making the notebook more suitable for educational purposes.

Mentor

John Perry

backup: William Stein

Difficulty

Intermediate

Skills

  • HTML/CSS, JavaScript
  • Python

Additional Notebook Ideas

Apart from the ones above, other project ideas are also welcome. Here is a selected list of ideas for your inspiration. Contact the possible mentors for more details.:

Description

  • additional widgets, like a 2D locator.
  • flexible layout of controls, and interacts within interacts
  • Master-worksheet, a collection of other worksheets to build, for example, a book.
  • Permanent hyperlinks between worksheets, independent of worksheet numbering
  • Exporting worksheets to LaTeX, creating PDFs, export to ODF.
  • Slide-Show-Mode to make it possible to show interactive presentations.
  • Enhance revision history and snapshot capabilities.
  • Content-editable divs for the code cells, so we can support more complex ways for inputting code (e.g. a wysiwyg formula editor or colored syntax highlighting)
  • Support various types of text cells, so that, at the user's option, we could have a ReST text cell, an HTML (TinyMCE) text cell, a plain text cell, a latex text cell, etc.
  • Chat with exchange of text and code between users logged in on the same Sage server.
  • Wiki-like platform for editing and publishing mathematical, physical, statistical and other content.
  • Tagging support for worksheets, searching within tags
  • Efficiently exchange usage examples, tips and ideas.

Mentor

Jason Grout, Mike Hansen, Dan Drake, William Stein

discussion here: sage-gsoc

Difficulty

Easy to Intermediate, project could consist of one bigger project or several small and independent sub-projects.

Skills

  • HTML/CSS, Javascript (jQuery, Ajax, …)
  • basic Python.

Virtual Machine GUI

Right now Sage is installed on Windows machines as a VirtualBox virtual machine. This approach has some problems that makes some users desist in their intent to use Sage. We would need a simple GUI that deals with this issues. Namely, it should check the VirtualBox installation in the system, check the availability of connection ports, and handle the installed virtual machine status. In particular, it should run rhe virtual machine in headless mode if it is possible to connect from the local web browser.

See the discussion at https://groups.google.com/group/sage-devel/browse_thread/thread/a4808f2cf5b8b79f/03db2e576b21f42e?q=virtualbox&lnk=nl& about it.

Description

Write a GUI program to handle the VirtualBox VM. It should do something like the following:

  • download new Virtual Machines if necessary
  • let the user choose between different versions of the Sage VM
  • diagnose port / firewall issues
  • automatically export notebooks from the VM using a bundled ssh client
  • write the launcher in Python (which we also include) using some Python GUI toolkit (included, too)  

Mentor

Volker Braun

backup: Miguel Marco

Difficulty

Medium

Skills

  • Python, some python GUI toolkit (pyGTK/pyQt/pyTclTk...)
  • VirtualBox VM’s administration

Back-end

Working with Sage is not restricted to a local machine. The web-interface can be made public to other computers over the Intranet/Internet. One very successful example is http://demo.sagenb.org - this is the site behind the Google Chrome Web app for the Sage Notebook. After a bit more than a month of availability in the Chrome Web Store it had more than 2,000 users. Another example is the main Notebook site with more than 40,000 registered users. Sage not only wants to be a comprehensive software suite for mathematics but also wants to be easily accessible.

Consequently, we have to improve the inner parts of Sage to be able to scale for a much broader audience and satisfy online Notebook users from High School and University students doing their homework up to employees of engineering companies sharing their calculations with co-workers. These proposed enhancement projects could have a truly global impact and will certainly drive Sage’s further growth.

Description

Web-server, session management and Notebook storage.

This project addresses the needs for a better scaling Notebook server. There are several layers to consider, each of them could be a project:

  • The served HTML/JavaScript front-end needs to be changed in order to correctly interact with the modified back-end. This would also include writing testing-code to ensure functionality and stress-testing the scalability of the back-end.
  • The server back-end needs to be able to scale across several machines, handle session management, retrieving and storing the data for each user’s Notebook and knowing how to interact with the database. Additionally, Sage-workers need to be orchestrated to modify each user’s session after each calculation is done. This probably would also include coding low-level networking interactions via libraries like ZeroMQ.
  • There needs to be programming logic to handle the storage, the interactions with the database and address their scaling issues. Again, with testing code to ensure functionality and scalability.

Those are just some of the cornerstones that need to be done to make the Sage Notebook more scalable.

Interested applicants are expected to contact Jason Grout, who is currently organizing a larger project dedicated solely to this task. There has already been good progress on this project.

Links: Notebook design

Mentor

Jason Grout, William Stein

backup: Dan Drake

Difficulty

Hard

Skills

  • Python, Cython, maybe C++
  • maybe NoSQL DB MongoDB
  • maybe low-level networking via ZeroMQ
  • probably Linux/Unix administration, Bash programming
  • knowledge about web-servers
  • experience with heterogeneous distributed machines in a cluster or multiprocessor machine

Easy Server Deployment

Description

Setting up a Sage Notebook server “right” is complicated. Although it is easy to start one instance for personal use, it is getting more complicated if it is set up for a classroom setting or as a worldwide server. This involves questions about security, sandboxing and scalability. In conjunction with other improvements, this project aims to make it easy to deploy a server for various applications. This includes the following tasks:

  • Documentation and testing
  • Step-by-Step guides
  • Ready-to-use instances on a virtual image
  • Screencasts
  • Create ways to backup & restore worksheets
  • Improve user-management
  • Improve administrative interface
  • Solve security-related questions
  • Test and explain various web-server configurations

Mentor

Dan Drake

backup: Jason Grout, William Stein

Difficulty

Intermediate

Skills

  • Python
  • Linux/Unix administration, Bash programming
  • Knowledge about web-servers

 

Greatly improve the pseudo-tty interfaces between Sage and the big Ma's: Mathematica, Maple, and Matlab.

Description

A unique feature of Sage is that it is able to communicate with essentially every other math software system out there, and some of that communication is fairly sophisticated, optimized, and debugged.  However, the interfaces between Sage and the most popular commercial  mathematics software systems -- Mathematica, Maple, and Matlab -- could all benefit from substantial additional work.  They are buggy on certain platforms, don't deal well in some cases with large outputs, don't draw plots well, etc.  Currently, the interfaces are all pseudo-tty based, but it may be possible in some cases to create alternative interfaces (with exactly the same API) that use proprietary socket-based protocols, e.g., MathLink (http://www.wolfram.com/solutions/mathlink/) for Mathematica.  

Now that the API of the Sage interfaces is very stable (after 7 years!), the goal of this project is to investigate and implement the best possible ways of implementing this API for each commercial math software system.

Mentor

William Stein

Backup: Mike Hansen

Difficulty

Easy

Skills

Very good knowledge of Python.

Improving Startup Time

Description

When people type "sage" to start Sage, it often takes a long time for Sage to startup.  This is incredibly annoying.  The main reason for this is that Python uses the stat system call to get basic information about files well over 50,000 times every single time Sage starts.  This information is expensive to compute, and almost never changes.  Thus it should be cached.  Volker Braun has written a proof of concept patch that does such caching, but work remains.  The goal of this project would be to finish that patch and get it included in Sage.  

Moreover, the project should go further and look at how to make that caching approach generic so it could be used by other projects outside Sage. This could have the potential impact of making "Python + scientific library" startup time better for millions of people.

Make it so Python cache's module import locations on startup, thus

greatly improving startup time for large Python modules.

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

Mentor

William Stein

Backup: Volker Braun

Difficulty

Intermediate

Skills

Very good knowledge of Python and C

Piecewise Functions

Piecewise functions are essential in approximation theory, numerical analysis, and throughout the classroom. Within a computer algebra system, they are invaluable for translating written mathematics in an understandable way to one’s domain-specific language.

Description

A full list of ideas (a work in progress) is available at the PiecewiseSymbolic SEP (Sage Enhancement Proposal)

  • Symbolic piecewise support from Ginac and/or Maxima.
  • For historical reasons, the current piecewise framework does not integrate well with the rest of symbolics.
  • Very well defined - make piecewise functions behave like all other symbolic functions in Sage.
  • Piecewise functions should support all of the methods that symbolic functions support, with exceptions only where there is a good reason.
  • They should additionally support a set of methods that are applied individually to the constituent functions. For example, it is possible to define a piecewise function, composed of differentiable pieces, that is not differentiable.

Mentor

TBA: sage-gsoc discussion group 

Difficulty

Intermediate

Skills

  • Python
  • C++ (Ginac)
  • Lisp (Maxima)

Advanced Symbolic Expression Manipulation

Description

When working with symbolic expressions, manipulating them in a flexible way is essential. The goal of this project is to extend Sage's functionality of handling substitutions and patterns. This includes the following enhancements:

  • wildcards with restrictions: Such a wildcard matches a symbolic expression only if it is of given type (e.g. an integer, a polynomial) or given "outer function" (e.g. a sum of something), or if it fulfils a given condition (e.g. if it is a prime, if it has no occurrence of a symbol y).
  • default values of wildcards: E.g. if w0 has default value 1, then the pattern w0*w1 matches also x (as 1*x).
  • sequences of wildcards: Patterns can have a variable number of wildcards. Then, for example, it is possible implement the usual manipulation rules for logarithms with one substitution.
  • delayed substitutions: The evaluation of the right-hand side of the rule is hold until after the substitution. E.g. one can then replace each x separately by a random integer.
  • regular expression rules: Building substitution rules and patterns out of regular expressions.

Mentor

Daniel Krenn

Difficulty

Intermediate

Skills

  • Python
  • regular expressions
  • helpful is to know about substitutions and patterns in other computer algebra systems (especially Mathematica)

Symbolic Expressions

Part of a sophisticated mathematical software system is a way to represent symbolic expressions and fast methods to manipulate them.

Description

Pynac/GiNaC is designed for symbolic computations. This project is about enhancing and optimizing this crucial and important part of Sage.

Pynac replaces the numeric coefficients in GiNaC with python objects. The implementation should be extended to use machine longs and doubles as well as the GMP and MPFR libraries for multi precision integers, rationals and floating point numbers. This would provide a significant speed boost since using these types directly instead of the Python wrappers available in Sage is more efficient.

The stubs to use other types as numeric objects are available in the code. The task involves writing the required interfaces to machine types, GMP and MPFR, as well as profiling typical operations to see where the bottlenecks are.

Mentor

Burcin Erocal

Difficulty

Intermediate

Skills

  • C++
  • Python, Cython

Mathematical Function Library

Description

Sage exposes mathematical functions to the user by wrapping lower-level libraries and algorithms. They occur in symbolic expressions and can be evaluated for given arguments. Some of them are not efficient, some of them could be improved and even some are not even exposed at all.

  • Learn and assess the current state of exposed functions, create benchmarks (guided by the mentor) to track improvements.
  • Enhance, add or replace functions in the already existing framework - suitable core libraries already exist.
  • Expand existing range of arguments to new ones, like vector and matrix types.
  • Extensive testing, speed&feature comparisons, ...

Mentor

Burcin Erocal

backup: Martin Albrecht

Difficulty

Intermediate

Skills

  • Python, Cython
  • C++

Combinatorics / Matroid theory

Description

matroids are combinatorial abstractions of a number of mathematical objects, including graphs and matrices. Sage will soon have support for matroids, but lots of work remains to be done. Some projects with high priority are:

* Efficient routines for testing connectivity, and extending matroids while preserving connectivity

* Computing the automorphism group of a matroid

* More efficient minor testing

* Build a framework for collections of matroids. This includes database support (for inspiration, look at Sage's Graph Database).

Mentor

Stefan van Zwam

Backup: Rob Beezer

Difficulty

Intermediate  (some mathematical maturity required)

Skills

  • Python, Cython
  • Background in combinatorics, linear algebra, ideally matroid theory.

Numerical Optimization

Description

Sage has general purpose classes to express and solve linear and mixed-linear optimization problems. The first aim of this project is to enhance  the features of those classes and add more convenience for the user. Additionally, new classes for quadratic and continuous non-linear optimization should be created.

On the back-end side, those classes interface with various specific solvers. This requires code to wrap their functionality or the necessary linking to certain libraries (e.g. which already provide Python-bindings to solvers, and may have been already present in Sage, such as cvxopt). The second part of this project aims to add more clue-code for additional solvers. In this, it overlaps with the next topic, concerning semidefinite programming solvers and interfaces for them.

Mentor

Dmitrii Pasechnik (for some parts)

backup: Martin Albrecht

Difficulty

Intermediate

Skills

  • Python, Cython, maybe C/C++
  • background in Optimization/Operations Research helps

Semidefinite Programming and sums of squares of real multivariate polynomials

Description

Improving the integration of semidefinite programming (and, potentially, other convex conic programming, e.g. 2nd order cone programming) solvers in Sage, creating an interface similar to what we already have for linear programming, hooking up more backends (currently, only cvxopt is integrated into Sage), with an aim to have a M*-free environment for polynomial sums of squares modelling, such as done e.g. by MATLAB-based YALMIP (http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Main.WhatIsYALMIP). Potentially, it is a large project, as one can go quite far with developing modeling tools, adding symmetry treatment, etc.

Mentor

Dima Pasechnik, Mehdi Ghasemi

Difficulty

Intermediate to hard

Skills

  • Python, Cython, maybe C/C++
  • background in Optimization/Operations Research helps

M1RI

Description

M1RI, that's the code Tom wrote for dense linear algebra over GF(3), GF(5) and GF(7), i.e., small finite prime fields.  This implementation is a collection of Sage worksheets at the moment, i.e. a proof of concept. From that we already know that this approach is very fast. Turning this into a proper library would be a huge benefit to the community. It requires C skills but most of the linear algebra business has been solved before, so the mathematics required is not that much.

Mentor

Martin Albrecht

backup: Burcin Erocal

Difficulty

Intermediate

Skills

  • C/C++
  • Python, Cython

UI: Mobile Applications

The traditional way of running Sage is via a “full” personal computer workstation. There are other form factors and devices from where Sage should be accessible, most notably tablets and smartphones. This involves running Sage on a remote server and designing a new user interface for interacting with it.

Android & Android Tablets

http://code.google.com/p/sage-android/

Description

http://code.google.com/p/sage-android/

No hard mathematics involved :-)

Mentor

Volker Braun

backup: Harald Schilly

Difficulty

Easy

Skills

  • Java
  • Android development
  • UI and interface design
  • Client/Server communication

Apple iOS/iPad

Description

https://bitbucket.org/gvol/sage-iphone-app/

  • Adding interactive widget support
  • Creating an iPad version
  • Enhancements for use in a classroom situation
  • Various other enhancements, particularly around text entry

Mentor

Ivan Andrus

Difficulty

Easy

Skills

  • iPhone/iPad development (Objective-C)
  • Possibly HTML, CSS, and JavaScript
  • UI Design skills would be a plus

Regression Testing Framework

Create a tool to check if there are any speed regressions between Sage releases.

Description

Sage uses the standard Python doctest framework to check for correctness. With more than 85% and increasing coverage these tests uncover many potential issues in new contributions.

However, there is no equivalent mechanism to check if changes introduced to the Sage library cause speed regressions.

There are standard solutions such as Codespeed to store timing information and display comparisons between different versions.

This task involves:

  • writing benchmarks for certain functions in Sage
  • adapting Codespeed or a different solution for use within Sage

Mentor

Burcin Erocal

Difficulty

Intermediate

Skills

  • Python
  • XML, JSON, Database
  • (interactive) Web-application

Get Sage ready for Linux distributions (Debian)

Description

Sage is currently shipped and built together with all its dependencies. Linux distributions package the dependencies separately (mainly done in Debian, see Wiki page) and want to obtain from the Sage website only Sage itself. The Sage build system currently only supports using all dependencies bundled with Sage. The idea is to enhance the Sage build system to accept a list of dependencies, for which the version provided by the OS is used instead of the bundled one. Given that Sage robustly supports this scenario, it will not be difficult to create a Debian package of Sage, which is another goal of this project.

Mentor

Tobias Hansen (Debian)

Jeroen Demeyer (Sage)

John Palmieri (Sage)

Julien Puydt

Difficulty

Intermediate

Skills

  • build systems (e.g. Makefiles/autotools/SCons/distutils)
  • Python
  • C/C++
  • shell scripts
  • C libraries

Libs: Underlying Libraries

Maxima/Numerical Mathematics

This project is not directly related to Sage, but Maxima is an important component!

Description

Currently Maxima is exclusively meant for Symbolic computation with support lacking good Numerical facilities. The existing BLAS/LAPACK modules are based upon f2cl-ed code in Common lisp, and hence performance is not portable (SBCL is probably 10x faster than CLisp).

The goal of this project would be enhance Maxima's numerical capabilities by integrating parts of the Foreign-function-interface in Matlisp. One would then be able to interface with the compiled versions of BLAS/LAPACK, ODEPACK and also just about any other C/Fortran libraries.

This would enhance Maxima's ability to do Numerical computation, and will open up new avenues like, implementing Automatic-Differentiation, to be pursued later.

Mentor

Raymond Toy

Difficulty

Hard

Skills

  • Common Lisp
  • Fortran/C would help

Combinatorics

Matroid theory

Description

matroids are combinatorial abstractions of a number of mathematical objects, including graphs and matrices. Sage will soon have support for matroids, but lots of work remains to be done. Some projects with high priority are:

  • Efficient routines for testing connectivity, and extending matroids while preserving connectivity
  • Computing the automorphism group of a matroid
  • More efficient minor testing
  • Build a framework for collections of matroids. This includes database support (for inspiration, look at Sage's Graph Database).

Mentor

Stefan van Zwam

Backup: Rob Beezer

Difficulty

Easy (programming), intermediate to hard (mathematics)

Skills

  • Python
  • Background in combinatorics, linear algebra, ideally matroid theory.


Student’s Proposal Template

We recommend you to join our sage-gsoc mailing list and introduce yourself and ask to help you for your submission.

Contact

We suggest you to introduce yourself and discuss your project idea in our mailing list. Only contact the possible mentors below if you have really specific questions!

Name

Topics

E-Mail

Harald Schilly

(Oversight)

general questions

harald+gsoc@schil.ly

William Stein
(BDFL)

Notebook, Back-end

 

Mentors

Dan Drake

general projects

drake@kaist.edu
dr.dan.drake@gmail.com

Burcin Erocal

Symbolics, low-level Cython

burcin@erocal.org

Jason Grout

Notebook, Back-end

jason-sage@creativetrax.com

Martin Albrecht

low-level Cython, crypto stuff, linear algebra

martinralbrecht@googlemail.com

Mike Hansen

Notebook, general projects

mhansen@gmail.com

Volker Braun

Android, Python, low-level Cython

vbraun.name@gmail.com

Daniel Krenn

krenn@aon.at

Ivan Andrus

iOS/iPhone App

darthandrus@gmail.com

Alexander Dreyer

PolyBoRi

alexander.dreyer@itwm.fraunhofer.de

Raymond Toy

Maxima

toy.raymond@gmail.com

Dmitrii Pasechnik

Optimization, semidefinite programming

dimpase@gmail.com

Tobias Hansen

Debian

thansen@debian.org

Julien Puydt

Debian

julien.puydt@laposte.net

John Palmieri

Debian

palmieri@math.washington.edu

John Perry

Linear programming, commutative algebra, general

john.perry@usm.edu

Miguel Marco

Algebra, PyQt

mmarco@unizar.es

Stefan van Zwam

 Matroid theory

svanzwam@math.princeton.edu