Differences between revisions 4 and 149 (spanning 145 versions)
Revision 4 as of 2021-08-31 23:32:17
Size: 2256
Editor: mkoeppe
Comment: symbolic_expression
Revision 149 as of 2022-02-01 16:49:16
Size: 32484
Editor: mkoeppe
Comment: Link to doc.sagemath.org
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
current development cycle (2021)

<<TableOfContents>>
released Jan 30, 2022

<<TableOfContents()>>
Line 9: Line 8:

=== Changes to symbolic expressions ===
Line 29: Line 30:
=== Interface to Mathics, a free implementation of the Wolfram language ===

Sage now has an optional package providing [[https://mathics.org/|Mathics]], a free (open-source) general-purpose computer algebra system featuring Mathematica-compatible syntax and functions, and an interface to it.[[https://trac.sagemath.org/ticket/31778|#31778]]
Line 32: Line 37:
 * The Cholesky decomposition for sparse RDF/CDF matrices now uses a specialized fast algorithm when cvxopt is available. [[https://trac.sagemath.org/ticket/13674|#13674]]
 * The `is_hermitian()` method for sparse RDF/CDF matrices now uses a small tolerance by default to mitigate numerical issues. This brings it to parity with its dense counterpart. [[https://trac.sagemath.org/ticket/33031|#33031]]
Line 35: Line 42:
The full list of changes is available in this [[https://sagemanifolds.obspm.fr/changelog.html|changelog]].

=== De Rham cohomology and characteristic classes ===

The [[https://doc.sagemath.org/html/en/reference/manifolds/sage/manifolds/differentiable/de_rham_cohomology.html|de Rham cohomology]] has been made an algebra ([[https://trac.sagemath.org/ticket/32270|#32270]]).

The method `characteristic_class` for vector bundles is now outdated and replaced by the method `characteristic_cohomology_class`. This change reflects the difference between characteristic classes, seen as natural transformations, and [[https://doc.sagemath.org/html/en/reference/manifolds/sage/manifolds/differentiable/characteristic_cohomology_class.html|characteristic cohomology classes]] in a more rigorous way (see [[https://trac.sagemath.org/ticket/29581|#29581]]). The previous usability and syntax remains intact. Among other things, the following has been changed:

 * The performance of computing characteristic forms has been improved significantly by using a [[https://en.wikipedia.org/wiki/Faddeev%E2%80%93LeVerrier_algorithm|Faddeev-LeVerrier]]-like algorithm.
 * The characteristic forms of Pontryagin/Chern/Euler classes w.r.t. to a given connection are cached in order to speed up computations of all characteristic forms w.r.t. the same connection.

Furthermore, new features have been added. For example, characteristic cohomology classes now form an algebra:

{{{
sage: M = Manifold(4, 'M')
sage: E = M.vector_bundle(2, 'E', field='complex')
sage: R = E.characteristic_cohomology_class_ring(); R
Algebra of characteristic cohomology classes of the Differentiable complex vector bundle E -> M of rank 2 over the base space 4-dimensional differentiable manifold M
sage: R.gens()
[Characteristic cohomology class (c_1)(E) of the Differentiable complex vector bundle E -> M of rank 2 over the base space 4-dimensional differentiable manifold M,
 Characteristic cohomology class (c_2)(E) of the Differentiable complex vector bundle E -> M of rank 2 over the base space 4-dimensional differentiable manifold M]
sage: c_1, c_2 = R.gens()
}}}

Therefore, elements can be added and multiplied:

{{{
sage: c_1 + c_2
Characteristic cohomology class (c_1 + c_2)(E) of the Differentiable complex vector bundle E -> M of rank 2 over the base space 4-dimensional differentiable manifold M
sage: c_1 * c_1
Characteristic cohomology class (c_1^2)(E) of the Differentiable complex vector bundle E -> M of rank 2 over the base space 4-dimensional differentiable manifold M
}}}

Additive, multiplicative and Pfaffian cohomology classes are now related to the generators of the characteristic cohomology class ring via additive/multiplicative sequences:

{{{
sage: ch = E.characteristic_cohomology_class('ChernChar'); ch
Characteristic cohomology class ch(E) of the Differentiable complex vector bundle E -> M of rank 2 over the base space 4-dimensional differentiable manifold M
sage: ch == 2 + c_1 + c_1^2 / 2 - c_2 # additive sequence of exp(x)
True
}}}

As for the tangent bundle of a manifold, as long as an orientation and a metric is provided, the characteristic form of the Euler class (and therefore all Pfaffian classes) w.r.t. the Levi-Civita connection is now computed automatically (previously, a compatible curvature form matrix had to be provided by the user):

{{{
sage: M.<x,y> = manifolds.Sphere(2, coordinates='stereographic')
sage: g = M.metric()
sage: nab = g.connection()
sage: nab.set_immutable()
sage: TM = M.tangent_bundle()
sage: e = TM.characteristic_cohomology_class('Euler'); e
Characteristic cohomology class e(TS^2) of the Tangent bundle TS^2 over the 2-sphere S^2 of radius 1 smoothly embedded in the Euclidean space E^3
sage: e_form = e.get_form(nab)
sage: e_form
Mixed differential form e(TS^2, nabla_g) on the 2-sphere S^2 of radius 1 smoothly embedded in the Euclidean space E^3
sage: e_form.display_expansion()
e(TS^2, nabla_g) = 2/(pi + pi*x^4 + pi*y^4 + 2*pi*x^2 + 2*(pi + pi*x^2)*y^2) dx∧dy
}}}

=== Automatic coordinate change in curve plots ===

The method `plot` of [[https://doc.sagemath.org/html/en/reference/manifolds/sage/manifolds/differentiable/curve.html|curves]] is now allowed to perform a coordinate change to make the plot in terms of the coordinates specified via the argument `chart`, in case the curve is not known in these coordinates ([[https://trac.sagemath.org/ticket/32578|#32578]]). For example, a cardioid is defined in terms of polar coordinates:
{{{
sage: E.<r, phi> = EuclideanSpace(coordinates='polar')
sage: c = E.curve((1 + cos(phi), phi), (phi, 0, 2*pi))
sage: c.display()
(0, 2*pi) → E^2
   phi ↦ (r, phi) = (cos(phi) + 1, phi)
}}}
and its plot in terms of Cartesian coordinates can now be obtained simply by
{{{
sage: c.plot(chart=E.cartesian_coordinates(), aspect_ratio=1)
}}}
The above command has triggered the computation of the curve's expression in terms of Cartesian coordinates:
{{{
sage: c.display()
(0, 2*pi) → E^2
   phi ↦ (r, phi) = (cos(phi) + 1, phi)
   phi ↦ (x, y) = (cos(phi)^2 + cos(phi), (cos(phi) + 1)*sin(phi))
}}}

=== Internal code improvements and bug fixes ===

Various improvements have been performed in the internal code, some of them in view of !SageMath modularization:

 * faster generation of non-redundant indices ([[https://trac.sagemath.org/ticket/32318|#32318]])
 * unnecessary uses of symbolic functions removed from `sage.tensor.modules` ([[https://trac.sagemath.org/ticket/32415|#32415]])
 * doctests involving `SR` marked optional in `sage.tensor.modules` ([[https://trac.sagemath.org/ticket/32712|#32712]])
 * `sage.tensor.modules` made independent from `sage.manifolds` ([[https://trac.sagemath.org/ticket/32708|#32708]]).

Some bugs have been fixed: [[https://trac.sagemath.org/ticket/31781|#31781]], [[https://trac.sagemath.org/ticket/32457|#32457]], [[https://trac.sagemath.org/ticket/32355|#32355]], [[https://trac.sagemath.org/ticket/32929|#32929]].

== Number theory ==

=== Logarithms ===

 * Logarithms modulo composite integers are now dramatically faster in some important cases (such as prime-power moduli). [[https://trac.sagemath.org/ticket/32375|#32375]]
 * Logarithms in binary finite fields now use index calculus instead of generic-group algorithms when appropriate (via PARI's [[https://pari.math.u-bordeaux.fr/dochtml/html/Arithmetic_functions.html#se:fflog|fflog()]]). [[https://trac.sagemath.org/ticket/32842|#32842]]

=== Binary quadratic forms ===

 * Binary quadratic forms' [[https://doc.sagemath.org/html/en/reference/quadratic_forms/sage/quadratic_forms/binary_qf.html#sage.quadratic_forms.binary_qf.BinaryQF.solve_integer|.solve_integer()]] method now uses PARI's [[https://pari.math.u-bordeaux.fr/dochtml/html-stable/Arithmetic_functions.html#se:qfbsolve|qfbsolve()]] instead of a brute-force search, which is often exponentially faster. [[https://trac.sagemath.org/ticket/32782|#32782]]

=== Prime counting ===

 * Prime counting and related functions, in particular [[https://doc.sagemath.org/html/en/reference/functions/sage/functions/prime_pi.html|prime_pi]], are now implemented using external libraries, [[https://github.com/kimwalisch/primecount|primecount]] and [[https://github.com/kimwalisch/primesieve|primesieve]]. This improved performance and fixed a long-standing bug [[https://trac.sagemath.org/ticket/24960|#24960]]

=== Elliptic curves and isogenies ===

 * Composite isogenies of elliptic curves have been added as an experimental feature. This includes support for compact smooth-degree isogenies. [[https://trac.sagemath.org/ticket/32744|#32744]]
 * Isomorphisms of elliptic curves now expose the same interface as other isogenies. [[https://trac.sagemath.org/ticket/32502|#32502]]
 * The `.abelian_group()` method for elliptic curves over finite fields is now much faster (with an exponential speedup in some cases). [[https://trac.sagemath.org/ticket/32312|#32312]]
 * Mutability of elliptic-curve isogenies is now deprecated. [[https://trac.sagemath.org/ticket/32388|#32388]]
   (This affects the methods `.switch_sign()`, `.set_pre_isomorphism()`, and `.set_post_isomorphism()`.)

Bugfixes:

 * The `.multiplication_by_m_isogeny()` method used to be correct only up to isomorphism. [[https://trac.sagemath.org/ticket/32490|#32490]]
 * Computing isomorphisms between elliptic curves in characteristic 2 used to fail in some cases. [[https://trac.sagemath.org/ticket/32632|#32632]]

=== Modular and quasimodular forms ===

[[https://davidayotte.github.io/posts/2021/08/gsoc-final/|David Ayotte's project]] in the [[https://summerofcode.withgoogle.com/archive/2021/organizations/5180088957534208/|2021 Google Summer of Code]] has brought major new features and improvements to modular forms:

 * The class `ModularFormsRing` (now in `sage.modular.modform.ring`) now follows the `Parent`/`Element` structure. [[https://trac.sagemath.org/ticket/31559|#31559]].
 * Rings of quasimodular forms for a given congruence subgroups are now implemented. [[https://trac.sagemath.org/ticket/31512|#31512]]
 * One can now convert a modular form ring element and a quasimodular form ring element to a polynomial in the generator of the ring. [[https://trac.sagemath.org/ticket/32135|#32135]], [[https://trac.sagemath.org/ticket/32336|#32336]]
 * It is now possible to take derivatives of modular forms and quasimodular forms. [[https://trac.sagemath.org/ticket/32343|#32343]], [[https://trac.sagemath.org/ticket/32357|#32357]]

Also a conversion bug between spaces of modular forms was fixed. See [[https://trac.sagemath.org/ticket/31560|Meta-ticket #31560]] for an overview of tickets.
Line 38: Line 175:
=== Lie algebras ===

 * The Lie algebras e,,7,, and e,,8,, now have [[https://trac.sagemath.org/ticket/32082|implementations]] as matrix Lie algebras.

=== New lazy Laurent series backend ===

The lazy Laurent series has been nearly completely rewritten using a new backend coefficient stream with a cache has both sparse and dense formatted input. This has been designed to increase speed and be very flexible. This has also been extensively doctested to make sure the code is robust. This constituted Tejavsi Chebrolu's 2021 [[https://trac.sagemath.org/ticket/31651|GSoC project (metaticket)]]. This is meant to be the eventual replacement of the coefficient streams used in the species code (including for lazy power series), which is known to be buggy (see, e.g., [[https://trac.sagemath.org/ticket/15673|#15673]]). This also extends the functionality to include:

 * formal power series defined by functional equations;
 * [[https://trac.sagemath.org/ticket/32345|special functions]] such as `sin(f)`;
 * dense and sparse implementations;
 * more robust checks for equality.

=== Lazy Dirichlet series ===

As a demonstration of the flexibility for the coefficient stream framework for lazy Laurent series, we also implement [[https://trac.sagemath.org/ticket/32309|lazy Dirichlet series]]. We also give this a structure of a valuation ring by using the log of degree of the lowest nonzero coefficient.

=== Invariant algebras ===

A specialization of the invariant rings for finite dimensional vector spaces under an group actions were implemented for the [[https://trac.sagemath.org/ticket/32027|Orlik-Solomon]] and [[https://trac.sagemath.org/ticket/32293|Orlik-Terao]] algebras as part of Trevor Karn's [[https://trac.sagemath.org/ticket/31929|GSoC project]].

== Package upgrades ==

Sage 9.5 continues to support system installations of Python 3.7.x, 3.8.x, and 3.9.x.
New in Sage 9.5 is experimental support for system [[https://www.python.org/downloads/release/python-3100/|Python 3.10.x]].
If no suitable system Python is found, Sage builds its own copy from source; the
SPKG has been upgraded to version [[https://docs.python.org/release/3.9.9/whatsnew/changelog.html#python-3-9-9-final|3.9.9]]. [[https://trac.sagemath.org/ticket/30766|#30766]], [[https://trac.sagemath.org/ticket/32853|#32853]]

[[https://gitlab.com/sagemath/lcalc|lcalc]] has been upgraded to the new 2.x series maintained by the Sage team ([[https://gitlab.com/sagemath/lcalc/-/blob/2.0.5/doc/ChangeLog|Release notes]]). [[https://trac.sagemath.org/ticket/32037|#32037]], [[https://trac.sagemath.org/ticket/33043|#33043]]

[[https://numpy.org/|NumPy]] has been upgraded from 1.20.3 to the 1.21 series, see the [[https://numpy.org/doc/stable/release.html|release notes]].

[[https://scipy.org/|SciPy]] has been upgraded from 1.6.3 to the 1.7 series, see the [[http://scipy.github.io/devdocs/release.1.7.0.html|release notes]].

[[https://matplotlib.org/|Matplotlib]] has been upgraded from 3.3.4 to the 3.5 series. [[https://trac.sagemath.org/ticket/31580|#31580]], [[https://trac.sagemath.org/ticket/33040|#33040]]

[[https://networkx.org/|NetworkX]] has been upgraded from 2.5.1 to the 2.6 series, bringing various new features and improvements, see the [[https://networkx.org/documentation/stable/release/release_2.6.html|changelog]].

[[https://www.sympy.org/en/index.html|SymPy]] has been upgraded from 1.8 to 1.9, see the [[https://github.com/sympy/sympy/wiki/release-notes-for-1.9|release notes]].

[[https://polymake.org/doku.php|polymake]] has been upgraded from 4.4 to 4.5, see the [[https://polymake.org/doku.php/news/release_4_5|release notes]]. On macOS, Sage is now also able to use a polymake installation made via Homebrew.

IPython and Jupyter packages have been upgraded. In particular, `notebook` has been upgraded from 6.1.1 to the 6.4 series, see the [[https://jupyter-notebook.readthedocs.io/en/stable/changelog.html#changelog|changelog]]. [[https://trac.sagemath.org/ticket/31280|#31280]], [[https://trac.sagemath.org/ticket/32930|#32930]], [[https://trac.sagemath.org/ticket/33020|#33020]]

For a list of all packages and their versions, see
 * https://repology.org/projects/?inrepo=sagemath_stable

== Configuration changes ==

=== Separate virtual environment for Python packages ===

In non-incremental builds from source, Sage now defaults to setting up the virtual environment for the Python packages in a directory separate from `SAGE_ROOT/local`. [[https://trac.sagemath.org/ticket/32442|#32442]]

At the end of a run of `./configure`, you will see messages like the following:
{{{
config.status: executing links commands
config.status: creating convenience symlink prefix -> local
config.status: creating convenience symlink venv -> local/var/lib/sage/venv-python3.9
}}}
The symbolic link `SAGE_ROOT/venv` points to the location of the virtual environment. It depends on the version of Python that is in use. The symbolic link is not needed for build or runtime; it is only provided for convenience.

The previous behavior can be restored by using `./configure --without-sage-venv`.

Thanks to this new default, it has become easier for developers to work with several Python versions: There is no need to run `make distclean` or similar if you want to switch to a different Python version; just reconfigure using `./configure --with-python3=....`. The !SageMath distribution keeps the installation records for Python packages separately for each venv.

=== New default: configure --with-system-gcc=force ===

The Sage distribution no longer attempts to build its own `gcc` if no suitable C/C++ compilers can be found. Instead, `configure` will exit with an error in this situation. [[https://trac.sagemath.org/ticket/32060|#32060]]

The previous behavior can be restored by using `./configure --with-system-gcc=yes`; alternatively, you can use `./configure --with-system-gcc=no`.

=== New option: configure --disable-doc ===

If you do not intend to build the Sage documentation from source, you can now use `./configure --disable-doc`.
It suppresses the installation of several packages that are only needed for docbuilding and makes `make` (or `make all`) equivalent to `make build`. [[https://trac.sagemath.org/ticket/32759|#32759]]

=== Packages atlas and mpir removed ===

The package `atlas`, which could be used as an alternative to `openblas`, and the corresponding `configure` options have been removed. [[https://trac.sagemath.org/ticket/30350|#30350]]


The package `mpir`, which could be used as an alternative to `gmp`, and the corresponding `configure` options have been removed. [[https://trac.sagemath.org/ticket/32549|#32549]], [[https://trac.sagemath.org/ticket/32727|#32727]]

=== psutil package removed ===

The psutil (memory management) python package has been removed. The version within sage was heavily patched and no longer feasible to maintain, and the upstream version is incompatible with one of our supported platforms. [[https://trac.sagemath.org/ticket/32656|#32656]]

=== System singular detection ===

Sage is now able to use a suitable version of the Singular package from the system if one is detected by the `./configure` script. [[https://trac.sagemath.org/ticket/29024|#29024]]

== For developers and packagers: Modularization and packaging changes ==

Sage 9.5 contains many changes that were made as part of the modularization project described in [[https://trac.sagemath.org/ticket/29705|#29705]] and in the new section of the developer's guide, [[https://doc.sagemath.org/html/en/developer/packaging_sage_library.html|Packaging the Sage Library]].

=== New distribution package on PyPI: sage-setup ===

The build system of the Sage library, `sage_setup`, is now provided by a separate [[https://pypi.org/project/sage-setup/|distribution package sage-setup]]. The source tree is the subdirectory [[https://github.com/sagemath/sage/tree/develop/pkgs/sage-setup|pkgs/sage-setup/]] of the Sage git repository. [[https://trac.sagemath.org/ticket/29847|#29847]]

Since 9.5.rc0, the distribution packages [[https://pypi.org/project/sage-conf/|sage-conf]], [[https://pypi.org/project/sage-docbuild/|sage-docbuild]], [[https://pypi.org/project/sage-setup/|sage-setup]], [[https://pypi.org/project/sage-sws2rst/|sage-sws2rst]], and [[https://pypi.org/project/sagemath-standard/|sagemath-standard]] are uploaded automatically to PyPI on each release tag by a !GitHub Actions workflow. [[https://trac.sagemath.org/ticket/32062|#32062]]

=== Pynac merged into the Sage library ===

The core of the symbolic expressions subsystem of Sage, an adaptation of the [[https://www.ginac.de/|GiNaC]] library to Python known as [[http://pynac.org/|Pynac]], has been merged into the Sage library source code as [[https://github.com/sagemath/sage/tree/develop/src/sage/symbolic/ginac|src/sage/symbolic/ginac/]]; all future development of Pynac is intended to happen here. [[https://trac.sagemath.org/ticket/32386|#32386]], [[https://trac.sagemath.org/ticket/32387|#32387]]

  This removes an obstacle to Python packaging: Pynac was a shared library with a dependency on the Python C API but not an extension module, and it could not be installed using standard Python tools. Now the shared library is gone; all of Pynac (about 60kLOC of C++ code spread over 100 *.h and *.cpp files) is put in a single extension module `sage.symbolic.expression`. All other extension modules that used to link to libpynac (`sage.libs.pynac.pynac`, `sage.symbolic.function`, `sage.symbolic.series` etc.) have either been merged into `sage.symbolic.expression`, or the dependency has been resolved through refactoring.

  The integration of Pynac into the Sage source tree will also make it easier for Sage developers to make changes to symbolics.

=== Doctest annotation "# optional - FEATURE" for portions of the Sage library ===

In the Sage doctesting framework, a line of tests can be [[https://doc.sagemath.org/html/en/developer/doctesting.html#run-optional-doctests|conditionalized on the presence of a feature]], such as an installed optional package, using a comment of the form `# optional - FEATURE`.

In Sage 9.5, doctests can also be conditionalized on the presence of certain parts of the Sage library. [[https://trac.sagemath.org/ticket/32614|#32614]]

For example, doctests that depend on the Symbolic Ring can be marked `# optional - sage.symbolic`, and doctests that need number fields can be marked `# optional - sage.rings.number_field`.

Also various runtime tests for external programs have been rewritten as `Feature`s. [[https://trac.sagemath.org/ticket/27744|#27744]], [[https://trac.sagemath.org/ticket/32174|#32174]], [[https://trac.sagemath.org/ticket/32649|#32649]], [[https://trac.sagemath.org/ticket/32650|#32650]], [[https://trac.sagemath.org/ticket/32866|#32866]], [[https://trac.sagemath.org/ticket/32926|#32926]]


=== Module-level annotation "# sage.doctest: optional - FEATURE" ===

Moreover, Sage 9.5 extends this mechanism by allowing developers to mark all doctests in a Python file as conditional on a feature. [[https://trac.sagemath.org/ticket/30778|#30778]]

These module-level directives go to the top of the source file and take the form
{{{
# sage.doctest: optional - FEATURE
}}}


=== Abstract base classes for "isinstance" testing ===

The new module `sage.rings.abc` defines a number of abstract base classes that can be used for `isinstance` testing with parent classes instead of importing `is_...` functions from various implementation modules. [[https://trac.sagemath.org/ticket/32566|#32566]], [[https://trac.sagemath.org/ticket/32600|#32600]], [[https://trac.sagemath.org/ticket/32606|#32606]], [[https://trac.sagemath.org/ticket/32610|#32610]], [[https://trac.sagemath.org/ticket/32612|#32612]], [[https://trac.sagemath.org/ticket/32660|#32660]],
[[https://trac.sagemath.org/ticket/32665|#32665]], [[https://trac.sagemath.org/ticket/32719|#32719]], [[https://trac.sagemath.org/ticket/32742|#32742]], [[https://trac.sagemath.org/ticket/32750|#32750]]

In a similar way, `sage.geometry.abc` defines abstract base classes `Polyhedron`, `ConvexRationalPolyhedralCone`, etc. [[https://trac.sagemath.org/ticket/32637|#32637]]

Likewise, `sage.structure.element` now defines an abstract base class `Expression` that can be used for `isinstance` testing, instead of importing `is_Expression` or the implementation class `Expression` from `sage.symbolic.expression`. [[https://trac.sagemath.org/ticket/32638|#32638]], [[https://trac.sagemath.org/ticket/32730|#32730]]


See also Meta-ticket [[https://trac.sagemath.org/ticket/32414|#32414]].
Line 41: Line 319:
 * The package `sage.finance` is now deprecated. (The module `sage.finance.time_series` is now available as `sage.stats.time_series`.) [[https://trac.sagemath.org/ticket/32427|#32427]]

 * The module `sage.interfaces.primecount` is now deprecated. The functionality should now be imported from `primecountpy`, provided by the new standard package [[https://pypi.org/project/primecountpy/|primecountpy]]. [[https://trac.sagemath.org/ticket/32412|#32412]], [[https://trac.sagemath.org/ticket/32894|#32894]]
Line 43: Line 325:

== Package upgrades ==

 * https://repology.org/projects/?inrepo=sagemath_develop

 * The module `sage.stats.basic_stats` is now deprecated. [[https://trac.sagemath.org/ticket/29662|#29662]]

   In the deprecation messages, we point users to suitable [[https://numpy.org/doc/stable/reference/routines.statistics.html|numpy]], and [[https://docs.scipy.org/doc/scipy/reference/stats.html|scipy.stats]], and [[https://pandas.pydata.org/pandas-docs/stable/reference/series.html|pandas]] functions. (Python 3 also comes with a basic ​built-in `stats` module, but much of its functionality is unfortunately incompatible with !SageMath's number types, [[https://trac.sagemath.org/ticket/28234|#28234]].)

 * Many `is_...` functions are now deprecated.

   Use `isinstance` with the new abstract base classes instead (see above).
Line 52: Line 335:
The [[https://groups.google.com/g/sage-release/c/3Kc0y5g-VXs/m/ocUI0ysCAwAJ|first beta release]] in the 9.5 development series was tagged on 2021-08-31.

 * See [[https://groups.google.com/forum/#!forum/sage-devel|sage-devel]] for development discussions and [[https://groups.google.com/forum/#!forum/sage-release|sage-release]] for announcements of beta versions and release candidates.
Sage 9.5 was released on 2022-01-30.

=== Sources ===

The Sage source code is available in the [[https://github.com/sagemath/sage/tree/9.5|sage git repository]], and the self-contained [[http://www.sagemath.org/download-source.html|source tarballs are available]] for download.

!SageMath 9.5 supports most [[https://wiki.sagemath.org/ReleaseTours/sage-9.4#Availability_of_Sage_9.4_and_installation_help|platforms that were supported by Sage 9.4]] and '''adds support for building on recent Linux distributions that use glibc ≥ 2.34''' (`fedora-35`, `ubuntu-impish`, `ubuntu-jammy`, `archlinux-latest`, etc.) [[https://trac.sagemath.org/ticket/32576|#32756]]

Sage 9.5 has dropped support for `debian-jessie` with the default compiler, GCC 4.9.x. This has allowed us to upgrade the package [[https://github.com/kimwalisch/primecount|primecount]] to the latest version, which has stricter requirements for C++ 11, and to make it a standard package. (Sage 9.5 still supports distributions with compilers from the GCC 4.8.x series, such as `ubuntu-trusty`.) [[https://trac.sagemath.org/ticket/25009|#25009]]

Here is a summary of the platforms on which Sage 9.5 is known to build from source. (On platforms marked with the superscript&nbsp;⁺, installing optional packages
is not supported unless you upgrade the toolchain (gcc, binutils).)

 * '''Linux 64-bit''' (x86_64)
   * ubuntu-{[[https://launchpad.net/ubuntu/trusty|trusty]]⁺,[[https://launchpad.net/ubuntu/xenial|xenial]],[[https://launchpad.net/ubuntu/bionic|bionic]],[[https://launchpad.net/ubuntu/focal|focal]],[[https://launchpad.net/ubuntu/hirsute|hirsute]],[[https://launchpad.net/ubuntu/impish|impish]],[[https://launchpad.net/ubuntu/jammy|jammy]]}
   * debian-{[[https://wiki.debian.org/DebianStretch|stretch]], [[https://wiki.debian.org/DebianBuster|buster]],[[https://wiki.debian.org/DebianBullseye|bullseye]],[[https://wiki.debian.org/DebianBookworm|bookworm]],[[https://wiki.debian.org/DebianUnstable|sid]]}
   * linuxmint-{[[https://www.linuxmint.com/edition.php?id=158|17]]⁺,[[https://www.linuxmint.com/edition.php?id=217|18]],[[https://linuxmint.com/rel_tara_cinnamon.php|19]],[[https://linuxmint.com/rel_tricia_cinnamon.php|19.3]],[[https://www.linuxmint.com/rel_ulyssa_cinnamon_whatsnew.php|20.1]],[[https://linuxmint.com/rel_uma_cinnamon.php|20.2]],[[https://linuxmint.com/rel_una_cinnamon.php|20.3]]}
   * fedora-{[[https://docs.fedoraproject.org/en-US/fedora/f26/release-notes/|26]],[[https://docs.fedoraproject.org/en-US/fedora/f27/release-notes/|27]],[[https://docs.fedoraproject.org/en-US/fedora/f28/release-notes/|28]],[[https://docs.fedoraproject.org/en-US/fedora/f29/release-notes/|29]],[[https://docs.fedoraproject.org/en-US/fedora/f30/release-notes/|30]],[[https://docs.fedoraproject.org/en-US/fedora/f31/release-notes/|31]],[[https://docs.fedoraproject.org/en-US/fedora/f32/release-notes/|32]],[[https://docs.fedoraproject.org/en-US/fedora/f33/release-notes/|33]],[[https://docs.fedoraproject.org/en-US/fedora/f34/release-notes/|34]],[[https://docs.fedoraproject.org/en-US/fedora/f35/release-notes/|35]]}
      * Building using the default compiler on [[https://fedoraproject.org/wiki/Releases/36/ChangeSet|fedora-36]] (rawhide), the unreleased GCC 12, is not supported [[https://trac.sagemath.org/ticket/33187|#33187]]
   * centos-{7⁺,[[https://www.centos.org/news-and-events/1322-october-centos-dojo-videos/|8]],[[https://www.centos.org/centos-stream/|stream-8]],[[https://www.centos.org/centos-stream/|stream-9]]}
   * gentoo
   * archlinux
   * opensuse-{15,[[https://doc.opensuse.org/release-notes/x86_64/openSUSE/Leap/15.3/|15.3]]}; [[https://get.opensuse.org/tumbleweed/|tumbleweed]] fixed in [[https://trac.sagemath.org/ticket/33153|#33153]]
   * slackware-14.2
 * '''Linux 32-bit''' (i386/i686)
   * ubuntu-bionic
   * [[https://github.com/pypa/manylinux#manylinux_2_24-debian-9-based|manylinux-2_24]]
   * debian-buster
   * centos-7⁺ (but docbuild is broken, [[https://trac.sagemath.org/ticket/32768|#32768]])
 * '''macOS (Intel)''' (x86_64) - with [[https://brew.sh/|Homebrew]] or without
   * macOS 10.15 (Catalina)
   * macOS 11.x (Big Sur)
   * macOS 12.x (Monterey) [[https://trac.sagemath.org/ticket/32855|#32855]]
 * '''macOS (Apple Silicon, M1)''' [[https://trac.sagemath.org/ticket/30592|#30592]]
   * Building Sage 9.5 from source on Apple Silicon (M1) requires the use of [[https://brew.sh/|Homebrew]] (recommended) or conda-forge, which package versions of `gfortran` 11 with necessary changes for this platform that are not in a released upstream version of GCC. (The `gfortran` package that comes with Sage is not suitable for the M1.)
   * Make sure that `/usr/local` does not contain an old copy of homebrew (or other software) for x86_64 that you may have copied from an old machine. Homebrew for the M1 is installed in `/opt/homebrew`, not `/usr/local`.
   * Be sure to follow the [[https://github.com/sagemath/sage/blob/develop/README.md|README]] and the instructions that the `./configure` command issues regarding the installation of system packages from Homebrew or conda.
 * '''Cygwin''' (x86_64)
   * use with system Python 3.9 needs Cygwin test package python39 3.9.9-3, see [[https://trac.sagemath.org/ticket/33078|#33078]]

Sage 9.5 has initial support for system [[https://docs.python.org/3/whatsnew/3.10.html|Python 3.10.x]]. It continues to support Python 3.7.x, 3.8.x, 3.9.x. [[https://trac.sagemath.org/ticket/30766|#30766]]

=== Availability as binaries and in distributions ===

 * The easiest way to install Sage 9.5 on Linux is through a distribution that provides it, see [[https://repology.org/project/sagemath/versions|repology.org: sagemath]].

 * [[https://github.com/3-manifolds/Sage_macOS/releases/tag/v1.3-rc1|Binary package for 9.5.rc2 on macOS]] from the 3-manifolds project
   * separate disk images for Intel (x86_64) and Apple Silicon (M1, arm64)
   * also includes many optional Sage packages

=== Help ===

See [[https://github.com/sagemath/sage/blob/9.4/README.md|README.md]] in the source distribution for installation instructions.

See [[https://groups.google.com/forum/#!forum/sage-release|sage-release]], [[https://groups.google.com/forum/#!forum/sage-devel|sage-devel]].
Line 58: Line 393:
 * [[https://trac.sagemath.org/query?status=needs_info&status=needs_review&status=needs_work&status=new&summary=~Meta&col=id&col=summary&col=status&col=type&col=priority&col=milestone&col=component&order=priority|Open Meta-Tickets]]
Line 61: Line 394:

 * [[https://github.com/sagemath/sage/compare/9.4...9.5#files_bucket|Diff from 9.4]]

Sage 9.5 Release Tour

released Jan 30, 2022

Symbolics

Changes to symbolic expressions

  • symbolic_expression is now able to create vectors and matrices of symbolic expressions for more general inputs. #16761

    • For example, if the input is a list or tuple of lists/tuples/vectors:
      • sage: M = symbolic_expression([[1, x, x^2], (x, x^2, x^3), vector([x^2, x^3, x^4])]); M
        [  1   x x^2]
        [  x x^2 x^3]
        [x^2 x^3 x^4]
        sage: M.parent()
        Full MatrixSpace of 3 by 3 dense matrices over Symbolic Ring
  • Symbolic expressions can no longer be called with positional arguments. #14270

    • This was deprecated since Sage 4.0, although a bug prevented the deprecation warning from being issued in Sage versions 8.4 to 9.3. #32319

      Instead of (x+1)(2), write either (x+1)(x=2), or (x+1).subs(x=2), or ((x+1).function(x))(2).

Interface to Mathics, a free implementation of the Wolfram language

Sage now has an optional package providing Mathics, a free (open-source) general-purpose computer algebra system featuring Mathematica-compatible syntax and functions, and an interface to it.#31778

Linear Algebra

  • The Cholesky decomposition for sparse RDF/CDF matrices now uses a specialized fast algorithm when cvxopt is available. #13674

  • The is_hermitian() method for sparse RDF/CDF matrices now uses a small tolerance by default to mitigate numerical issues. This brings it to parity with its dense counterpart. #33031

Manifolds

The full list of changes is available in this changelog.

De Rham cohomology and characteristic classes

The de Rham cohomology has been made an algebra (#32270).

The method characteristic_class for vector bundles is now outdated and replaced by the method characteristic_cohomology_class. This change reflects the difference between characteristic classes, seen as natural transformations, and characteristic cohomology classes in a more rigorous way (see #29581). The previous usability and syntax remains intact. Among other things, the following has been changed:

  • The performance of computing characteristic forms has been improved significantly by using a Faddeev-LeVerrier-like algorithm.

  • The characteristic forms of Pontryagin/Chern/Euler classes w.r.t. to a given connection are cached in order to speed up computations of all characteristic forms w.r.t. the same connection.

Furthermore, new features have been added. For example, characteristic cohomology classes now form an algebra:

sage: M = Manifold(4, 'M')
sage: E = M.vector_bundle(2, 'E', field='complex')
sage: R = E.characteristic_cohomology_class_ring(); R
Algebra of characteristic cohomology classes of the Differentiable complex vector bundle E -> M of rank 2 over the base space 4-dimensional differentiable manifold M
sage: R.gens()
[Characteristic cohomology class (c_1)(E) of the Differentiable complex vector bundle E -> M of rank 2 over the base space 4-dimensional differentiable manifold M,
 Characteristic cohomology class (c_2)(E) of the Differentiable complex vector bundle E -> M of rank 2 over the base space 4-dimensional differentiable manifold M]
sage: c_1, c_2 = R.gens()

Therefore, elements can be added and multiplied:

sage: c_1 + c_2
Characteristic cohomology class (c_1 + c_2)(E) of the Differentiable complex vector bundle E -> M of rank 2 over the base space 4-dimensional differentiable manifold M
sage: c_1 * c_1
Characteristic cohomology class (c_1^2)(E) of the Differentiable complex vector bundle E -> M of rank 2 over the base space 4-dimensional differentiable manifold M

Additive, multiplicative and Pfaffian cohomology classes are now related to the generators of the characteristic cohomology class ring via additive/multiplicative sequences:

sage: ch = E.characteristic_cohomology_class('ChernChar'); ch
Characteristic cohomology class ch(E) of the Differentiable complex vector bundle E -> M of rank 2 over the base space 4-dimensional differentiable manifold M
sage: ch == 2 + c_1 + c_1^2 / 2 - c_2  # additive sequence of exp(x)
True

As for the tangent bundle of a manifold, as long as an orientation and a metric is provided, the characteristic form of the Euler class (and therefore all Pfaffian classes) w.r.t. the Levi-Civita connection is now computed automatically (previously, a compatible curvature form matrix had to be provided by the user):

sage: M.<x,y> = manifolds.Sphere(2, coordinates='stereographic')
sage: g = M.metric()
sage: nab = g.connection()
sage: nab.set_immutable()
sage: TM = M.tangent_bundle()
sage: e = TM.characteristic_cohomology_class('Euler'); e
Characteristic cohomology class e(TS^2) of the Tangent bundle TS^2 over the 2-sphere S^2 of radius 1 smoothly embedded in the Euclidean space E^3
sage: e_form = e.get_form(nab)
sage: e_form
Mixed differential form e(TS^2, nabla_g) on the 2-sphere S^2 of radius 1 smoothly embedded in the Euclidean space E^3
sage: e_form.display_expansion()
e(TS^2, nabla_g) = 2/(pi + pi*x^4 + pi*y^4 + 2*pi*x^2 + 2*(pi + pi*x^2)*y^2) dx∧dy

Automatic coordinate change in curve plots

The method plot of curves is now allowed to perform a coordinate change to make the plot in terms of the coordinates specified via the argument chart, in case the curve is not known in these coordinates (#32578). For example, a cardioid is defined in terms of polar coordinates:

sage: E.<r, phi> = EuclideanSpace(coordinates='polar')
sage: c = E.curve((1 + cos(phi), phi), (phi, 0, 2*pi))
sage: c.display()
(0, 2*pi) → E^2
   phi ↦ (r, phi) = (cos(phi) + 1, phi)

and its plot in terms of Cartesian coordinates can now be obtained simply by

sage: c.plot(chart=E.cartesian_coordinates(), aspect_ratio=1)

The above command has triggered the computation of the curve's expression in terms of Cartesian coordinates:

sage: c.display()
(0, 2*pi) → E^2
   phi ↦ (r, phi) = (cos(phi) + 1, phi)
   phi ↦ (x, y) = (cos(phi)^2 + cos(phi), (cos(phi) + 1)*sin(phi))

Internal code improvements and bug fixes

Various improvements have been performed in the internal code, some of them in view of SageMath modularization:

  • faster generation of non-redundant indices (#32318)

  • unnecessary uses of symbolic functions removed from sage.tensor.modules (#32415)

  • doctests involving SR marked optional in sage.tensor.modules (#32712)

  • sage.tensor.modules made independent from sage.manifolds (#32708).

Some bugs have been fixed: #31781, #32457, #32355, #32929.

Number theory

Logarithms

  • Logarithms modulo composite integers are now dramatically faster in some important cases (such as prime-power moduli). #32375

  • Logarithms in binary finite fields now use index calculus instead of generic-group algorithms when appropriate (via PARI's fflog()). #32842

Binary quadratic forms

Prime counting

  • Prime counting and related functions, in particular prime_pi, are now implemented using external libraries, primecount and primesieve. This improved performance and fixed a long-standing bug #24960

Elliptic curves and isogenies

  • Composite isogenies of elliptic curves have been added as an experimental feature. This includes support for compact smooth-degree isogenies. #32744

  • Isomorphisms of elliptic curves now expose the same interface as other isogenies. #32502

  • The .abelian_group() method for elliptic curves over finite fields is now much faster (with an exponential speedup in some cases). #32312

  • Mutability of elliptic-curve isogenies is now deprecated. #32388

    • (This affects the methods .switch_sign(), .set_pre_isomorphism(), and .set_post_isomorphism().)

Bugfixes:

  • The .multiplication_by_m_isogeny() method used to be correct only up to isomorphism. #32490

  • Computing isomorphisms between elliptic curves in characteristic 2 used to fail in some cases. #32632

Modular and quasimodular forms

David Ayotte's project in the 2021 Google Summer of Code has brought major new features and improvements to modular forms:

  • The class ModularFormsRing (now in sage.modular.modform.ring) now follows the Parent/Element structure. #31559.

  • Rings of quasimodular forms for a given congruence subgroups are now implemented. #31512

  • One can now convert a modular form ring element and a quasimodular form ring element to a polynomial in the generator of the ring. #32135, #32336

  • It is now possible to take derivatives of modular forms and quasimodular forms. #32343, #32357

Also a conversion bug between spaces of modular forms was fixed. See Meta-ticket #31560 for an overview of tickets.

Algebra

Lie algebras

  • The Lie algebras e7 and e8 now have implementations as matrix Lie algebras.

New lazy Laurent series backend

The lazy Laurent series has been nearly completely rewritten using a new backend coefficient stream with a cache has both sparse and dense formatted input. This has been designed to increase speed and be very flexible. This has also been extensively doctested to make sure the code is robust. This constituted Tejavsi Chebrolu's 2021 GSoC project (metaticket). This is meant to be the eventual replacement of the coefficient streams used in the species code (including for lazy power series), which is known to be buggy (see, e.g., #15673). This also extends the functionality to include:

  • formal power series defined by functional equations;
  • special functions such as sin(f);

  • dense and sparse implementations;
  • more robust checks for equality.

Lazy Dirichlet series

As a demonstration of the flexibility for the coefficient stream framework for lazy Laurent series, we also implement lazy Dirichlet series. We also give this a structure of a valuation ring by using the log of degree of the lowest nonzero coefficient.

Invariant algebras

A specialization of the invariant rings for finite dimensional vector spaces under an group actions were implemented for the Orlik-Solomon and Orlik-Terao algebras as part of Trevor Karn's GSoC project.

Package upgrades

Sage 9.5 continues to support system installations of Python 3.7.x, 3.8.x, and 3.9.x. New in Sage 9.5 is experimental support for system Python 3.10.x. If no suitable system Python is found, Sage builds its own copy from source; the SPKG has been upgraded to version 3.9.9. #30766, #32853

lcalc has been upgraded to the new 2.x series maintained by the Sage team (Release notes). #32037, #33043

NumPy has been upgraded from 1.20.3 to the 1.21 series, see the release notes.

SciPy has been upgraded from 1.6.3 to the 1.7 series, see the release notes.

Matplotlib has been upgraded from 3.3.4 to the 3.5 series. #31580, #33040

NetworkX has been upgraded from 2.5.1 to the 2.6 series, bringing various new features and improvements, see the changelog.

SymPy has been upgraded from 1.8 to 1.9, see the release notes.

polymake has been upgraded from 4.4 to 4.5, see the release notes. On macOS, Sage is now also able to use a polymake installation made via Homebrew.

IPython and Jupyter packages have been upgraded. In particular, notebook has been upgraded from 6.1.1 to the 6.4 series, see the changelog. #31280, #32930, #33020

For a list of all packages and their versions, see

Configuration changes

Separate virtual environment for Python packages

In non-incremental builds from source, Sage now defaults to setting up the virtual environment for the Python packages in a directory separate from SAGE_ROOT/local. #32442

At the end of a run of ./configure, you will see messages like the following:

config.status: executing links commands
config.status: creating convenience symlink prefix -> local
config.status: creating convenience symlink venv -> local/var/lib/sage/venv-python3.9

The symbolic link SAGE_ROOT/venv points to the location of the virtual environment. It depends on the version of Python that is in use. The symbolic link is not needed for build or runtime; it is only provided for convenience.

The previous behavior can be restored by using ./configure --without-sage-venv.

Thanks to this new default, it has become easier for developers to work with several Python versions: There is no need to run make distclean or similar if you want to switch to a different Python version; just reconfigure using ./configure --with-python3=..... The SageMath distribution keeps the installation records for Python packages separately for each venv.

New default: configure --with-system-gcc=force

The Sage distribution no longer attempts to build its own gcc if no suitable C/C++ compilers can be found. Instead, configure will exit with an error in this situation. #32060

The previous behavior can be restored by using ./configure --with-system-gcc=yes; alternatively, you can use ./configure --with-system-gcc=no.

New option: configure --disable-doc

If you do not intend to build the Sage documentation from source, you can now use ./configure --disable-doc. It suppresses the installation of several packages that are only needed for docbuilding and makes make (or make all) equivalent to make build. #32759

Packages atlas and mpir removed

The package atlas, which could be used as an alternative to openblas, and the corresponding configure options have been removed. #30350

The package mpir, which could be used as an alternative to gmp, and the corresponding configure options have been removed. #32549, #32727

psutil package removed

The psutil (memory management) python package has been removed. The version within sage was heavily patched and no longer feasible to maintain, and the upstream version is incompatible with one of our supported platforms. #32656

System singular detection

Sage is now able to use a suitable version of the Singular package from the system if one is detected by the ./configure script. #29024

For developers and packagers: Modularization and packaging changes

Sage 9.5 contains many changes that were made as part of the modularization project described in #29705 and in the new section of the developer's guide, Packaging the Sage Library.

New distribution package on PyPI: sage-setup

The build system of the Sage library, sage_setup, is now provided by a separate distribution package sage-setup. The source tree is the subdirectory pkgs/sage-setup/ of the Sage git repository. #29847

Since 9.5.rc0, the distribution packages sage-conf, sage-docbuild, sage-setup, sage-sws2rst, and sagemath-standard are uploaded automatically to PyPI on each release tag by a GitHub Actions workflow. #32062

Pynac merged into the Sage library

The core of the symbolic expressions subsystem of Sage, an adaptation of the GiNaC library to Python known as Pynac, has been merged into the Sage library source code as src/sage/symbolic/ginac/; all future development of Pynac is intended to happen here. #32386, #32387

  • This removes an obstacle to Python packaging: Pynac was a shared library with a dependency on the Python C API but not an extension module, and it could not be installed using standard Python tools. Now the shared library is gone; all of Pynac (about 60kLOC of C++ code spread over 100 *.h and *.cpp files) is put in a single extension module sage.symbolic.expression. All other extension modules that used to link to libpynac (sage.libs.pynac.pynac, sage.symbolic.function, sage.symbolic.series etc.) have either been merged into sage.symbolic.expression, or the dependency has been resolved through refactoring. The integration of Pynac into the Sage source tree will also make it easier for Sage developers to make changes to symbolics.

Doctest annotation "# optional - FEATURE" for portions of the Sage library

In the Sage doctesting framework, a line of tests can be conditionalized on the presence of a feature, such as an installed optional package, using a comment of the form # optional - FEATURE.

In Sage 9.5, doctests can also be conditionalized on the presence of certain parts of the Sage library. #32614

For example, doctests that depend on the Symbolic Ring can be marked # optional - sage.symbolic, and doctests that need number fields can be marked # optional - sage.rings.number_field.

Also various runtime tests for external programs have been rewritten as Features. #27744, #32174, #32649, #32650, #32866, #32926

Module-level annotation "# sage.doctest: optional - FEATURE"

Moreover, Sage 9.5 extends this mechanism by allowing developers to mark all doctests in a Python file as conditional on a feature. #30778

These module-level directives go to the top of the source file and take the form

# sage.doctest: optional - FEATURE

Abstract base classes for "isinstance" testing

The new module sage.rings.abc defines a number of abstract base classes that can be used for isinstance testing with parent classes instead of importing is_... functions from various implementation modules. #32566, #32600, #32606, #32610, #32612, #32660, #32665, #32719, #32742, #32750

In a similar way, sage.geometry.abc defines abstract base classes Polyhedron, ConvexRationalPolyhedralCone, etc. #32637

Likewise, sage.structure.element now defines an abstract base class Expression that can be used for isinstance testing, instead of importing is_Expression or the implementation class Expression from sage.symbolic.expression. #32638, #32730

See also Meta-ticket #32414.

Deprecated and removed functionality

  • The package sage.finance is now deprecated. (The module sage.finance.time_series is now available as sage.stats.time_series.) #32427

  • The module sage.interfaces.primecount is now deprecated. The functionality should now be imported from primecountpy, provided by the new standard package primecountpy. #32412, #32894

  • The package sage.media is now deprecated. #12673

  • The module sage.stats.basic_stats is now deprecated. #29662

    • In the deprecation messages, we point users to suitable numpy, and scipy.stats, and pandas functions. (Python 3 also comes with a basic ​built-in stats module, but much of its functionality is unfortunately incompatible with SageMath's number types, #28234.)

  • Many is_... functions are now deprecated.

    • Use isinstance with the new abstract base classes instead (see above).

Availability of Sage 9.5 and installation help

Sage 9.5 was released on 2022-01-30.

Sources

The Sage source code is available in the sage git repository, and the self-contained source tarballs are available for download.

SageMath 9.5 supports most platforms that were supported by Sage 9.4 and adds support for building on recent Linux distributions that use glibc ≥ 2.34 (fedora-35, ubuntu-impish, ubuntu-jammy, archlinux-latest, etc.) #32756

Sage 9.5 has dropped support for debian-jessie with the default compiler, GCC 4.9.x. This has allowed us to upgrade the package primecount to the latest version, which has stricter requirements for C++ 11, and to make it a standard package. (Sage 9.5 still supports distributions with compilers from the GCC 4.8.x series, such as ubuntu-trusty.) #25009

Here is a summary of the platforms on which Sage 9.5 is known to build from source. (On platforms marked with the superscript ⁺, installing optional packages is not supported unless you upgrade the toolchain (gcc, binutils).)

  • Linux 64-bit (x86_64)

  • Linux 32-bit (i386/i686)

  • macOS (Intel) (x86_64) - with Homebrew or without

    • macOS 10.15 (Catalina)
    • macOS 11.x (Big Sur)
    • macOS 12.x (Monterey) #32855

  • macOS (Apple Silicon, M1) #30592

    • Building Sage 9.5 from source on Apple Silicon (M1) requires the use of Homebrew (recommended) or conda-forge, which package versions of gfortran 11 with necessary changes for this platform that are not in a released upstream version of GCC. (The gfortran package that comes with Sage is not suitable for the M1.)

    • Make sure that /usr/local does not contain an old copy of homebrew (or other software) for x86_64 that you may have copied from an old machine. Homebrew for the M1 is installed in /opt/homebrew, not /usr/local.

    • Be sure to follow the README and the instructions that the ./configure command issues regarding the installation of system packages from Homebrew or conda.

  • Cygwin (x86_64)

    • use with system Python 3.9 needs Cygwin test package python39 3.9.9-3, see #33078

Sage 9.5 has initial support for system Python 3.10.x. It continues to support Python 3.7.x, 3.8.x, 3.9.x. #30766

Availability as binaries and in distributions

  • The easiest way to install Sage 9.5 on Linux is through a distribution that provides it, see repology.org: sagemath.

  • Binary package for 9.5.rc2 on macOS from the 3-manifolds project

    • separate disk images for Intel (x86_64) and Apple Silicon (M1, arm64)
    • also includes many optional Sage packages

Help

See README.md in the source distribution for installation instructions.

See sage-release, sage-devel.

More details