Releases: sagemath/sage
9.1
Release Tour
SageMath 9.1 was released on May 21, 2020 (changelog).
- last release supporting both Python 2 and 3
- major portability improvements
- 551 tickets (PRs) merged, 106 contributors
Python 3 transition
SageMath 9.0 was the first version of Sage running on Python 3 by default. Sage 9.1 continues to support both Python 2 and Python 3.
In Sage 9.1, we have made some further improvements regarding Python 3 support. In particular, SageMath now supports underscored numbers PEP 515 (py3); the fix was done in Trac #28490:
sage: 1_000_000 + 3_000
1003000
The next release, SageMath 9.2, will remove support for Python 2. See Python3-Switch for more details.
Portability improvements, increased use of system packages
The SageMath distribution continues to vendor versions of required software packages ("SPKGs") that work well together.
In order to reduce compilation times and the size of the Sage installation, a development effort ongoing since the 8.x release series has made it possible to use many system packages provided by the OS distribution (or by the Homebrew or conda-forge distributions) instead of building SageMath's own copies.
This so-called "spkg-configure" mechanism runs at the beginning of a build from source, during the ./configure
phase.
(See the sage-devel threads "Brainstorming about Sage dependencies from system packages" (May 2017) and "conditionalise installation of many spkg's?" (Nov 2017) for its origins and Trac #24919 for its initial implementation.)
Sage 9.1 is adding many packages to this mechanism, including openblas
, gsl
, r
, boost
, libatomic
, cddlib
, tachyon
, nauty
, sqlite
, planarity
, fplll
, brial
, flintqs
, ppl
, libbraiding
, cbc
, gfan
, and python3
. As to the latter, SageMath will now make use of a suitable installation of Python 3.7.x in your system by setting up a venv (Python 3 virtual environment).
New in Sage 9.1 is also a database of system packages equivalent to our SPKGs. At the end of a ./configure
run, you will see messages like the following:
configure: notice: the following SPKGs did not find equivalent system packages: arb boost boost_cropped bzip2 ... yasm zeromq zlib
checking for the package system in use... debian
configure: hint: installing the following system packages is recommended and may avoid building some of the above [[SPKGs]] from source:
configure: $ sudo apt-get install libflint-arb-dev ... yasm libzmq3-dev libz-dev
configure: After installation, re-run configure using:
configure: $ ./config.status --recheck && ./config.status
We also use the same database to update our installation manual automatically.
Status of Cygwin support
Thanks to the hard work of our Cygwin maintainers, in particular during the 8.x release cycles, building Sage on Windows using Cygwin64 is fully supported. Sage 9.1 reflects this by integrating the instructions for building from source on Cygwin into its documentation.
For developers
For developers who wish to help improve the portability of SageMath, there is a new power tool: A tox configuration that automatically builds and tests Sage within Docker containers running various Linux distributions (ubuntu-trusty
through -focal
, debian-jessie
through -sid
, linuxmint-17
through -19.3
, fedora-26
through -32
, centos-7
and -8
, archlinux
, slackware-14.2
), each in several configurations regarding what system packages are installed. Thus, it is no longer necessary for developers to have access to a machine running fedora-29
, say, to verify whether the Sage distribution works there; instead, you just type:
tox -e docker-fedora-29-standard -- build ptest
The Dockerfile
s are generated automatically on the fly using the same database of system packages that provides information to users. See the tutorial for developers: Portability testing of the Sage distribution using Docker and the Sage distro-package database from the [Global Virtual SageDays 109](https://researchseminars.org/seminar/SageDays109) and the new section on "testing on multiple platforms" in the Developer's Guide for details.
An entry point for developers who wish to improve the testing infrastructure is the Meta-Ticket #29060: Add Dockerfiles and CI scripts for integration testing. See also the broader Meta-Meta-Ticket #29133.
For packagers
Although we now have continuous integration environments for testing the interaction of the Sage distribution with most major Linux distributions, we are still missing a few. Adding them will enable all Sage developers to check that their changes do not break things on your distribution.
Package updates
We have only made minor updates to standard packages:
- dateutil -- 2.8.1 (from 2.5.3)
- fplll -- 5.3.2 (from 5.2.1)
- fpylll -- 0.5.1.dev (from 0.4.1dev)
- freetype -- 2.10.1
- m4ri -- 20200115
- m4rie -- 20200115
- matplotlib -- 2.2.5 (from 2.2.4)
- ntl -- 11.4.3 (from 11.3.2)
- numpy -- 1.16.6 (from 1.16.1)
- openblas -- 0.3.9
- pkgconfig -- 1.5.1 (from 1.4.0)
- pyzmq -- 19.0.0 (from 18.1)
- sage_brial -- 1.2.5 (this is the python module of the brial package)
- scipy -- 1.2.3 (from 1.2.0)
- sympy -- 1.5 (from 1.4)
- traitlets -- 4.3.3
We expect to make larger package updates in the 9.2 release.
For developers
Preparing and testing package updates has become easier. The new optional field upstream_url
in checksums.ini
holds an URL to the upstream package archive, see for example build/pkgs/numpy/checksums.ini. Note that, like the tarball
field, the upstream_url
is a template; the word VERSION
is substituted with the actual version. The package can be updated by simply typing ./sage -package update numpy 3.14.59
; this will automatically download the archive and update the build/pkgs/
information.
Developers who wish to test a package update from a Trac branch before the archive is available on a Sage mirror can do so by configuring their Sage tree using ./configure \--enable-download-from-upstream-url
.
Every Sage developer now has easy access to "their own" set of 20 (40 for GitHub Pro accounts) two-core virtual machines running Linux, macOS, and Windows through GitHub Actions. To automatically test a branch on a multitude of our supported platforms, it suffices to create a fork of the sagemath/sage repository on GitHub, enable GitHub Actions, add the repository as a remote, create a tag and push the tag to the remote. After ... a ... while, your test results will be available --- like the ones at sagemath/sage Actions. We hope that this new testing infrastructure will reduce the FUD in the process of upgrading packages.
Polyhedral geometry
There is now a catalog for common polyhedral cones, e.g.
sage: cones.nonnegative_orthant(5)
5-d cone in 5-d lattice N
New features for polyhedra:
sage: P = polytopes.cube(intervals='zero_one') # obtain others than the standard cube
sage: P = matrix([[0,1,0],[0,1,1],[1,0,0]])*P # linear transformations
sage: it = P.face_generator() # a (fast and efficient) face generator
sage: next(it)
A 3-dimensional face of a Polyhedron in ZZ^3 defined as the convex hull of 8 vertices
sage: next(it)
A -1-dimensional face of a Polyhedron in ZZ^3
sage: f = next(it)
sage: f.normal_cone() # normal cone for faces
A 1-dimensional polyhedron in ZZ^3 defined as the convex hull of 1 vertex and 1 ray
sage: P.an_affine_basis() # an_affine_basis and a_maximal_chain
[A vertex at (0, 0, 0),
A vertex at (1, 1, 0),
A vertex at (0, 0, 1),
A vertex at (0, 1, 0)]
sage: P = polytopes.hypercube(4)
sage: P.flag_f_vector(0,3) # flag_f_vector is exposed
64
Regarding the optional package normaliz
there are some news as well:
sage: P = polytopes.cube(intervals=[[0,1],[0,2],[0,3]], backend='normaliz')
sage: save(P, '/tmp/this_takes_very_long_so_we_save_it') # saving works now
sage: sage: P.h_star_vector() # compute the h_star_vector with normaliz
[1, 20, 15]
There are also some bug fixes and other improvements. ...
9.0
Release Tour
Sage 9.0 was released on Jan 1, 2020 (changelog), 348 tickets (PRs) merged, 116 contributors.
Python 3 transition
Just in time for the new decade, this is the first version of Sage running on Python 3 by default.
See Python3-Switch for more details
Three.js is the new default 3D viewer
Three.js has become the default viewer for 3D plots, in replacement of Jmol. Note that Jmol is still available, via the option _viewer='jmol' _ in the plot functions.
New plotting capabilities
Polyhedral Geometry
Sage uses a new algorithm to obtain the f-vector for polyhedra. This is the only memory efficient implementation for the f-vector at the time of writing and it is as fast or faster as other implementations:
sage: P = polytopes.permutahedron(7)
sage: %time P.incidence_matrix()
CPU times: user 679 ms, sys: 4.01 ms, total: 683 ms
Wall time: 682 ms
5040 x 127 dense matrix over Integer Ring (use the '.str()' method to see the entries)
sage: %time P.f_vector()
CPU times: user 901 ms, sys: 16 ms, total: 917 ms
Wall time: 916 ms
(1, 5040, 15120, 16800, 8400, 1806, 126, 1)
There is ongoing work to improve this implementation. It is implemented in the combinatorial polyhedron of P
, which is newly exposed:
sage: P.combinatorial_polyhedron()
A 6-dimensional combinatorial polyhedron with 126 facets
Sage has the classical construction of the 120-cell of Coxeter from 1969. This construction is much faster than to realize it as generalized permutahedron so that even without the optional package normaliz
you won't waste much time:
sage: %time P = polytopes.one_hundred_twenty_cell(backend='normaliz')
CPU times: user 942 ms, sys: 81.8 ms, total: 1.02 s
Wall time: 457 ms
sage: %time P = polytopes.one_hundred_twenty_cell(backend='field')
CPU times: user 15.9 s, sys: 87.2 ms, total: 16 s
Wall time: 16 s
sage: %time P = polytopes.one_hundred_twenty_cell(backend='normaliz', construction='as_permutahedron')
CPU times: user 18.6 s, sys: 137 ms, total: 18.8 s
Wall time: 18 s
Ehrhart polynomials are computable for lattice polytopes defined with base ring QQ
:
sage: P = polytopes.cube()*1/1
sage: P.base_ring()
Rational Field
sage: P.ehrhart_polynomial()
8*t^3 + 12*t^2 + 6*t + 1
Note that this computation requires optional package latte_int
or normaliz
.
There is a new method to obtain the boundary of complex simplicial polytopes:
sage: oc = polytopes.octahedron()
sage: oc.boundary_complex()
Simplicial complex with vertex set (0, 1, 2, 3, 4, 5) and 8 facets
Hyperplane arrangements have a new method center
:
sage: H.<x,y> = HyperplaneArrangements(QQ)
sage: A = H()
sage: A.center()
A 2-dimensional polyhedron in QQ^2 defined as the convex hull of 1 vertex and 2 lines
There are also some bug fixes and other improvements. For more details see the release notes for optimization and polyhedral geometry softwares interactions in Sage.
Group Theory
Cubic Braid Groups
Factor groups of the Artin braid groups such that their generators have order three can easily be declared, now. They show a lot of their known properties:
sage: C4 = CubicBraidGroup(4)
sage: C4Cl = C4.as_classical_group(); C4Cl
Subgroup with 3 generators (
[ E(3)^2 0 0] [ 1 -E(12)^7 0]
[-E(12)^7 1 0] [ 0 E(3)^2 0]
[ 0 0 1], [ 0 -E(12)^7 1],
[ 1 0 0]
[ 0 1 -E(12)^7]
[ 0 0 E(3)^2]
) of General Unitary Group of degree 3 over Universal Cyclotomic Field with respect to positive definite hermitian form
[-E(12)^7 + E(12)^11 -1 0]
[ -1 -E(12)^7 + E(12)^11 -1]
[ 0 -1 -E(12)^7 + E(12)^11]
See also the reference manual.
Manifolds
The main novelty is the introduction of vector bundles (ticket #28159). For instance:
sage: M = Manifold(2, 'M')
sage: X.<x,y> = M.chart()
sage: TM = M.tangent_bundle(); TM
Tangent bundle TM over the 2-dimensional differentiable manifold M
sage: v = TM.section([-y, x], name='v'); v
Vector field v on the 2-dimensional differentiable manifold M
sage: v.display()
v = -y d/dx + x d/dy
sage: p = M((2,3), name='p'); p
Point p on the 2-dimensional differentiable manifold M
sage: TM.fiber(p)
Tangent space at Point p on the 2-dimensional differentiable manifold M
sage: v.at(p) in TM.fiber(p)
True
sage: v.at(p).display()
v = -3 d/dx + 2 d/dy
Other new features are
- characteristic classes (ticket #27784)
- the construction of a vector frame from a family of predefined vector fields (ticket #28716)
- the handling of multiple symmetries and multiple contractions with index notation (ticket #28784)
- more control on the numerical ODE solver for integrated curves and geodesics (ticket #28707)
See the full changelog for details, as well as the list of improvements and bug fixes in this release.
EdgesView for graphs
An EdgesView
is a read-only iterable container of edges enabling operations like for e in E
and e in E
. An EdgesView
can be iterated multiple times, and checking membership is done in constant time. It avoids the construction of edge lists and so consumes little memory. It is updated as the graph is updated. Hence, the graph should not be updated while iterating through an EdgesView
.
sage: G = Graph([(0, 1, 'C'), (0, 2, 'A'), (1, 2, 'B')])
sage: E = G.edges()
sage: E
[(0, 1, 'C'), (0, 2, 'A'), (1, 2, 'B')]
sage: type(E)
<class 'sage.graphs.views.EdgesView'>
sage: (0, 2) in E
False
sage: (0, 2, 'A') in E
True
sage: (2, 0, 'A') in E
True
sage: for e in E:
....: for ee in E:
....: print(e, ee)
....:
(0, 1, 'C') (0, 1, 'C')
(0, 1, 'C') (0, 2, 'A')
(0, 1, 'C') (1, 2, 'B')
(0, 2, 'A') (0, 1, 'C')
(0, 2, 'A') (0, 2, 'A')
(0, 2, 'A') (1, 2, 'B')
(1, 2, 'B') (0, 1, 'C')
(1, 2, 'B') (0, 2, 'A')
(1, 2, 'B') (1, 2, 'B')
See http://doc.sagemath.org/html/en/reference/graphs/sage/graphs/views.html for more details.
Availability of Sage 9.0 and installation help
- Release announcements: See sage-release, sage-announce
- Availability in distributions: see repology.org: sagemath
- sagemath.org download page
Installation FAQ
- See sage-support, sage-devel.
- Debian/Ubuntu: Installation prerequisites, Recommended installation
- Sage 9.0 (and earlier) does not support compilation within a conda environment. Deactivate conda before building Sage.
- Sage 9.0 (and earlier) may not compile from source on some cutting edge Linux distributions such as Ubuntu 20.04 LTS (workaround) and Fedora 32. Use either a distribution package of Sage if that is available in your distribution, a binary distribution of 9.0, or compile a development version of Sage leading to the Sage 9.1 release.
Full Changelog: 8.9...9.0