Skip to content

Sage 10.4 Release Tour

Matthias Köppe edited this page Aug 29, 2024 · 119 revisions

Sage 10.4 was released on July 19, 2024. This is the current stable release.

Here is an overview of some of the main changes in this version.

Linear algebra

The FreeModule constructor was recently generalized so that it can create CombinatorialFreeModule objects. In particular,

sage: ZZ^3
Ambient free module of rank 3 over the principal ideal domain Integer Ring
sage: ZZ^['a','b','c']
Free module generated by {'a', 'b', 'c'} over Integer Ring

Now MatrixSpace and matrix have been extended in a similar way: When lists or enumerated sets of row indices and column indices are given using the new parameters row_keys and column_keys, it constructs CombinatorialFreeModules whose bases are indexed by these index sets, and then returns the homset (or an element of it). #37514 #37692

sage: M = matrix([[1,2,3], [4,5,6]],
....:            column_keys=['a','b','c'], row_keys=['u','v']);

In particular, this enables the construction:

sage: ZZ^(2, 3)
Full MatrixSpace of 2 by 3 dense matrices over Integer Ring
sage: ZZ^(['x','y'], ['a', 'b', 'c'])
Set of Morphisms 
 from Free module generated by {'a', 'b', 'c'} over Integer Ring 
   to Free module generated by {'x', 'y'} over Integer Ring 
   in Category of finite dimensional modules with basis over Integer Ring

As a first application, the methods incidence_matrix, [weighted_]adjacency_matrix, and kirchhoff_matrix of Graph and DiGraph have been extended to support constructing a free module morphism instead of a matrix. #37692 #37955

sage: D12 = posets.DivisorLattice(12).hasse_diagram()
sage: phi_VE = D12.incidence_matrix(vertices=True, edges=True); phi_VE
Generic morphism:
  From: Free module generated by
          {(1, 2), (1, 3), (2, 4), (2, 6), (3, 6), (4, 12), (6, 12)}
        over Integer Ring
  To:   Free module generated by {1, 2, 3, 4, 6, 12} over Integer Ring
sage: print(phi_VE._unicode_art_matrix())
    (1, 2)  (1, 3)  (2, 4)  (2, 6)  (3, 6) (4, 12) (6, 12)
 1-1      -1       0       0       0       0       021       0      -1      -1       0       0       030       1       0       0      -1       0       040       0       1       0       0      -1       060       0       0       1       1       0      -1120       0       0       0       0       1       1

This style of printing the morphism as a "border matrix" suggests the viewpoint as "matrices whose rows and columns are labeled with arbitrary objects rather than numerical indices". To support this, we equip the morphisms of CombinatorialFreeModules with various methods pulled back from matrices.

  • Endomorphisms of CombinatorialFreeModule (and all other finite-dimensional modules with basis) now have methods for the invariants charpoly, det, fcp, minpoly, trace, delegating to the methods of the representing matrices. #37731

Jordan decomposition of a matrix and is_semisimple() test #37710

Tensor products of combinatorial free modules now have a functorial construction. #37451

Free modules of finite rank without distinguished basis (defined in sage.tensor) have also seen a few improvements:

  • FiniteRankFreeModule.isomorphism_with_fixed_basis now gives an instance of the new class SetIsomorphism, and its inverse is defined. #37512
  • The new method FiniteRankFreeModuleMorphism.display shows the matrix with rows and columns decorated with the names of the basis elements. #37825
  • FreeModuleAutomorphism and FiniteRankFreeModuleEndomorphism (a new subclass of FiniteRankFreeModuleMorphism) now define more methods providing invariants det, charpoly, fcp, trace, etc. #37826, delegating to the methods of the representing matrices in some basis #37831

Matroids

The SetSystem representation is now more informative. #37904

sage: M = matroids.CompleteGraphic(7)
sage: M.bases()
SetSystem of 16807 sets over 21 elements

The methods independent_sets and independent_r_sets got combined into one method with an optional argument. Similarly, dependent_r_sets was renamed to dependent_sets (here the argument remains mandatory). #38057

sage: M = matroids.catalog.Fano()
sage: M.independent_sets()
SetSystem of 57 sets over 7 elements
sage: M.independent_sets(3)
SetSystem of 28 sets over 7 elements
sage: M.dependent_sets(3)
SetSystem of 7 sets over 7 elements

Matroids got relabel method. #37775

We improved the performance of GraphicMatroid (#37839), CircuitsMatroid (#37930), FlatsMatroid (#38027), and DualMatroid (#38013).

LinearMatroid.representation now supports constructing a free module morphism instead of a matrix, and the Matroid constructor accepts such morphisms as input. #37692 #37940

sage: M = matroids.catalog.Fano()
sage: A = M.representation(order=True); A
Generic morphism:
  From: Free module generated by {'a', 'b', 'c', 'd', 'e', 'f', 'g'} over Finite Field of size 2
  To:   Free module generated by {0, 1, 2} over Finite Field of size 2
sage: Matroid(A)
Binary matroid of rank 3 on 7 elements, type (3, 0)

Polyhedral geometry

Method measuring maximal angles between convex cones was added. #37854

Arithmetic geometry

A projective curve has now its Jacobian, whose rational points form a group isomorphic to the Picard group of degree 0 of the curve. It works via divisors of the function field and has no scheme structure (of course). #35467

sage: A2.<x,y> = AffineSpace(QQ, 2)
sage: f = y^3 + x^4 - 5*x^2*y + 2*x*y - x^2 - 5*y - 4*x + 1
sage: C = Curve(f, A2)
sage: X = C.projective_closure()
sage: X.genus()
3
sage: X.rational_points(bound=5)
[(0 : 0 : 1), (1/3 : 1/3 : 1)]
sage: Q = X(0,0,1).place()
sage: P = X(1,1,3).place()
sage: D = P - Q
sage: D.degree()
0
sage: J = X.jacobian(model='hess', base_div=3*Q)
sage: G = J.group()  
sage: p = G.point(D)  # a rational point of the Jacobian represented by D
sage: 2*p + 3*p == 5*p
True

Elliptic and hyperelliptic curves have had their own Jacobians. The "new" Jacobian is accessible from points of the "native" Jacobian:

sage: k.<a> = GF((5,2))
sage: E = EllipticCurve(k,[1,0]); E
Elliptic Curve defined by y^2 = x^3 + x over Finite Field in a of size 5^2
sage: E.order()
32
sage: P = E([a, 2*a + 4])  # elliptic curve is its own Jacobian
sage: P
(a : 2*a + 4 : 1)
sage: P.order()
8
sage: p = P.point_of_jacobian_of_curve()
sage: p
[Place (x + 4*a, y + 3*a + 1)]
sage: p.order()
8
sage: Q = 3*P
sage: q = Q.point_of_jacobian_of_curve()
sage: q == 3*p
True
sage: G = p.parent()
sage: G.order()
32
sage: G
Group of rational points of Jacobian over Finite Field in a of size 5^2 (Hess model)

Modular forms

Rings of Drinfeld modular forms of any ranks for the full modular group $\mathrm{GL}_r(\mathbb{F}_q(T))$ are now implemented as symbolic objects in terms of the coefficient forms: #36538

sage: q = 5
sage: A = GF(q)['T']
sage: K.<T> = Frac(A)
sage: M = DrinfeldModularForms(K, rank=3); M
Ring of Drinfeld modular forms of rank 2 over 
 Fraction Field of Univariate Polynomial Ring in T over Finite Field of size 5
sage: M.gens()  # the generators are the coefficient forms
[g1, g2, g3]
sage: M.basis(20*(q - 1))  # basis generating the subspace of any given weight
[g1^2*g2^3, g1^8*g2^2, g1^14*g2, g1^20]
sage: (1/T)*M.0 + 3*(M.2*M.1)/T
-2/T*g2*g3 + 1/T*g1

Documentation

Links to source code

The Reference Manual in HTML format now provides links for each class, function, and method back to the source code on GitHub. This makes it convenient to make small edits to the docstring directly on GitHub, or just to inspect the source code. #37589 #38121

Screenshot 2024-04-25 at 4 06 29 PM

Version selector

The documentation in HTML format now offers a dropdown menu for selecting a different version of the documentation. We strive to maintain documentations for stable releases up to last 2 years. #38285

Tabs in EXAMPLES

Example code is now available also in pure Python form, along with Sage code (and live Sage code if live doc is available), in tabs for each EXAMPLES block. #37083

tabs-animation

Package list by category

The package lists in the Reference Manual have been reorganized by categories. #37315

Standard packages Optional Packages Experimental Packages
Mathematics Mathematics Mathematics
Front-end, graphics, document preparation Front-end, graphics, document preparation
Other dependencies Other dependencies Other dependencies

The dependency graph and SBOM provided by GitHub for SageMath now includes all Python packages that Sage uses. #36999

Translations

"Καλώς ήρθατε στο Sage" a Greek version of "A Tour of Sage" was added to our documentation. #37198

Documentation server for JupyterLab

If the Sage documentation has been built locally, sage -n jupyterlab now launches a documentation server that makes the documentation available in the Help menu in JupyterLab. Otherwise the online official documentation http://doc.sagemath.org is used as before. #37878

New developer tools

Please read our updated Sage Developer Guide. #30201 #37399 #37401 #37444 #37485 #37487 #37508 #38117

Improvements to the automatic tests of PRs

The Lint workflow, automatically run on every pull request, now additionally runs the Python linter Ruff. Any codestyle warnings are annotated in the "Files changed" tab. The minimal configuration used by the CI can be also used locally with ./sage -tox -e ruff-minimal and also runs as part of the default tests in ./sage -tox. A full configuration can be run using ./sage -tox -e ruff. #37453

The Build & Test workflow, automatically run on every pull request, now gives a much faster feedback to developers. Both the static check with Pyright and the doctests of the files changed in the PR (sage -t --new) now run in separate jobs, and the green checkmark or the red X are now shown within 10–20 minutes. #36498 #37926 #37988 #38046 #38144

The annotations of doctest failures in the "Files changed" tab become available when the run of the whole testsuite (sage -t --long) has been completed. To reduce the wait, sage -t --long has been split into multiple parallel jobs. Crashes during doctests, for example segmentation faults, are now annotated in the source code as well. #37738 #38090

The banner of the documentation preview now displays links back to the PR and to the diff of the generated documentation. #38127 #38129 #38213 #38332 #38353 #38378

The "CI Fix" mechanism has been switched from the "p: blocker" label to the new "p: CI Fix" label. #37950

Automatic PR size labeler

The size of our pull requests is now classified by a new type of labels with the v: prefix. #37262 #38114

Linking to external package documentation

Sage now provides a standardized way for developers to enrich the Sage documentation by linking to the online documentation of many external packages. #37598 #37575

The section on hyperlinks in the Sage Developer Guide explains the two mechanisms:

Linking to Sage repository files has been standardized using the new Sphinx role :sage_root:. #37546

Modularization changes

Our GH Actions running on every release now build platform-independent wheels for the distribution packages sagemath-environment, sage-setup, sage-sws2rst. We provide platform wheels for more modularized distributions: To sagemath-objects and sagemath-categories, we add sagemath-bliss, sagemath-coxeter3, sagemath-mcqd, and sagemath-tdlib. Also, macOS arm64 wheels are now additionally built. #36525 #37099 #37503 #38200

Many source files now carry # sage_setup: distribution directives. These directives at the top of the source files inform developers about the assignment of modules to the existing pip-installable distributions. #38088

More information about the modularization project: Meta-ticket #29705

Improvements to sage --package create --pypi

It is now possible to refer to Python packages via their PURL (see draft PEP 725) instead of their SPKG name. For now a string of the form pkg:pypi/DISTRO-NAME is simply a nickname for the (unique) SPKG that has DISTRO-NAME in their version_requirements.txt or requirements.txt file. The scheme can also be omitted: pypi/DISTRO-NAME also works. We also map pkg:generic/PACKAGE-NAME to PACKAGE_NAME. #37500

sage --package create --pypi now also fills dependencies from the PyPI metadata of wheel packages. When some of the Python dependencies obtained in this way do not have SPKGs yet, they are also automatically created. #37500

Package upgrades

Standard packages

The LinBox suite has been upgraded to givaro 4.2.0, fflas-ffpack 2.5.0, linbox 1.7.0. #37938 #38020 #38025 #38136

Singular has been upgraded to version 4.4.0. #37492 #37570

NTL has been upgraded from 11.4.3 to 11.5.1. #37251

SciPy has been upgraded to 1.12 (release notes). #37266

FLINT has been upgraded to 3.1.3. The new optional package python_flint provides alternative bindings to the FLINT library. We have added it as preparation for a later upgrade of SymPy. #37203 #37224

SymPy has been upgraded to 1.12.1, a small maintenance update (release notes). #38141

gnumake_tokenpool #37498

gc 8.2.6, libatomic_ops 7.8.2 #37249 #37931

ECL 24.5.10 #38009

openssl 3.2.2 #38157

Various Python package upgrades #37637 #38101 #38226

Python and Cython

Sage continues to support system Python installations of versions 3.9.x to 3.12.x; support for Python 3.12 is now considered stable. The version of Python that is installed when no suitable system Python is available has been updated to 3.12.4 (release notes). #37834 #37914

The Sage distribution now builds wheels of Python packages using build, version 1.2.1, which has been made a standard package. Other Python build and packaging tools upgraded include: pip 24, setuptools 69.5.1, hatchling 1.22.5, platformdirs 4.2.0, packaging 24.0, setuptools_scm 8.1.0, trove_classifiers 2024.4.10, wheel 0.43.0. #35618 #37277 #37300 #38226

Cython has been upgraded to 3.0.10. #37584

cypari2 2.1.5, memory_allocator 0.1.4 #37665

Optional packages

The SCIP Optimization Suite has been updated to version 9. This includes updates of scip to 9.0.1, scip_sdp to 4.4, soplex to 7.0.1, papilo to 2.2.1, PySCIPOpt to 5, and of the dependency onetbb to 2021.12.0. #37392 #37494 #38147

The packages igraph and python_igraph have been upgraded to versions 0.10.12, 0.11.5 (release notes). #37819

The packages normaliz and pynormaliz have been upgraded to 3.10.3, 2.20. #38140 #38260

polymake has been upgraded to 4.12 (release notes). #38140

The polynomial system solver msolve has been upgraded from 0.5.0 to 0.6.5. #37673

The package fricas has been upgraded to 1.3.10 and now uses SBCL (if a suitable version is installed as a system package) instead of ECL as the Common Lisp implementation. #37041

The package tdlib (treedec) has been upgraded to 0.9.3. #38163

The packages sage_numerical_backends_coin, sage_numerical_backends_cplex, and sage_numerical_backends_gurobi have been upgraded to 10.4. This upgrade makes these packages compatible with Cython 3. #38319

pycryptosat has been reduced to a "pip" package. #37669

More details

Sage now uses cryptographically secure SHA-256 hashes for authenticating downloaded upstream tarballs. #37726

For a list of all packages and their versions, see

Deprecations

Classes sage.groups.old.Group #37449, sage.rings.ring.CommutativeAlgebra #37464

Numerous is_... functions have been deprecated in favor of using either isinstance or testing membership in a category:

  • is_Cone, is_Polyhedron, is_LatticePolytope #37057
  • is_Hecke... #37895
  • is_FreeAlgebra, is_QuaternionAlgebra, is_SymmetricFunctionAlgebra #37896
  • is_Monoid, is_FreeMonoid, is_FreeAbelianMonoid #37897
  • is_AbelianGroup, is_DualAbelianGroup, is_MatrixGroup #37898
  • is_Category, is_Endset, is_Homset, is_Parent, is_RingHomset, is_SimplicialComplexHomset #37922
  • is_FGP_Module, is_FilteredVectorSpace, is_FreeQuadraticModule, is_FreeModule, is_FreeModuleHomspace, is_MatrixSpace, is_Module, is_VectorSpace, is_VectorSpaceHomspace #37924,
  • is_AffineScheme, is_AffineSpace, is_AlgebraicScheme, is_AmbientSpace is_Berkovich, is_Berkovich_Cp, is_CPRFanoToricVariety, is_DivisorGroup, is_EllipticCurve, is_HyperellipticCurve, is_ProductProjectiveSpaces, is_ProjectiveSpace, is_QuarticCurve, is_Scheme, is_SchemeHomset, is_ToricVariety #38022
  • is_Automaton, is_FiniteStateMachine, is_FSMProcessIterator, is_FSMState, is_FSMTransition, is_Transducer #38032
  • is_ArithmeticSubgroup, is_CongruenceSubgroup, is_DirichletGroup, is_Gamma, is_Gamma0, is_Gamma1, is_GammaH, is_ModularAbelianVariety, is_ModularFormsSpace, is_ModularSymbolsSpace, is_SL2Z #38035
  • is_AdditiveGroupElement, is_AlgebraElement, is_CommutativeAlgebraElement, is_CommutativeRingElement, is_DedekindDomainElement, is_Element, is_EuclideanDomainElement, is_FieldElement, is_InfinityElement, is_IntegralDomainElement, is_Matrix, is_ModuleElement, is_MonoidElement, is_MultiplicativeGroupElement, is_PrincipalIdealDomainElement, is_RingElement, is_Vector #38077
  • is_AbelianGroupMorphism, is_ChainComplexMorphism, is_Map, is_Morphism, is_PermutationGroupMorphism, is_SimplicialComplexMorphism #38103
  • is_AbsoluteNumberField, is_NumberFieldFractionalIdeal, is_NumberFieldFractionalIdeal_rel, is_NumberFieldIdeal, is_NumberFieldOrder, is_RelativeNumberField #38124
  • is_MutablePoset #38125
  • is_Fan, is_NefPartition, is_PointCollection, is_ToricLattice, is_ToricLatticeElement, is_ToricLatticeQuotient #38126
  • is_AlgebraicNumber, is_AlgebraicReal, is_ComplexDoubleElement, is_ComplexIntervalFieldElement, is_ComplexNumber, is_FractionField, is_FractionFieldElement, is_Integer, is_IntegerMod, is_IntegerRing, is_Rational, is_RationalField, is_RealDoubleElement, is_RealIntervalField, is_RealIntervalFieldElement, is_RealNumber #38128
  • is_AbelianGroupElement, is_ChainComplexHomspace, is_DirichletCharacter, is_DiscreteProbabilitySpace, is_DiscreteRandomVariable, is_DualAbelianGroupElement, is_FreeAbelianMonoidElement, is_FreeAlgebraQuotientElement, is_FreeModuleElement, is_FreeMonoidElement, is_Functor, is_Graphics, is_LinearConstraint, is_LinearFunction, is_LinearTensor, is_LinearTensorConstraint, is_ManinSymbol, is_ModularFormElement, is_ModularSymbolsElement, is_PermutationGroupElement, is_ProbabilitySpace, is_RandomVariable #38184

Previously deprecated functionality has been removed. #37312 #37722 #37855 #37856 #37867 #37868 #37869 #37870 #38095 #38099

Availability of Sage 10.4 and installation help

Please read our updated Sage Installation Guide. #37184 #37309 #37411

Sources

The source code is available in the Sage GitHub repository.

Sage builds successfully on the following platforms:

  • Linux 64-bit (x86_64)
  • Linux 32-bit (i386/i686)
    • debian-bullseye
  • macOS (Intel) (x86_64) - with Homebrew or without
    • macOS 12.x (Monterey)
    • macOS 13.x (Ventura)
    • macOS 14.x (Sonoma)
  • macOS (Apple Silicon, M1/M2/M3) - with Homebrew or without
    • 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/M2/M3 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.

You can also build Sage on top of conda-forge on Linux and macOS.

Configuration changes

./configure --disable-editable now implies --enable-wheels; Sage no longer supports the outdated, distutils-style direct installation of the Sage library in site-packages. #37973 #38304

The optional parts of the Sage library that use the optional packages bliss, coxeter3, mcqd, meataxe, sirocco, tdlib are no longer built automatically. Please use ./configure --enable-sagemath_bliss etc. before building, or use ./sage -i sagemath_bliss or make sagemath_bliss. #37857

Support of ubuntu-trusty, debian-buster, and centos-stream-8 has been dropped, as the platforms have reached their end of life. #37351 #38008 #38179

Support for fedora-40 has been added, as GCC 14.x is now accepted from the system. The gcc/gfortran packages have been upgraded from 12.3.0 to 13.2.0. #37537 #37646 #38008

Sage 10.x does not support Cygwin; use Windows Subsystem for Linux instead. The support code for Cygwin was removed in the Sage 10.3 development cycle. Users on Windows 10 and 11 should migrate to using WSL as described in our installation guide. A convenient way to use such an installation of Sage is via VS Code's Dev Containers or WSL remote.

Availability in distributions

Thanks to the work of downstream packagers, Sage 10.4 is already available in Arch Linux and Void Linux. See https://repology.org/project/sagemath/versions

Known problems and workarounds

On ubuntu-mantic, the Maxima package may fail to build when system ECL is in use. Workaround: Use ./configure --without-system-ecl #36672

OpenJPEG 2.5.1 is broken and leads to a build failure in Pillow. Upgrade OpenJPEG to 2.5.2 or use #37505 as a workaround.

No latex display in the Jupyter notebook when offline. Workaround: Use ./sage -pip uninstall jupyterlab-mathjax2. #36914

Help

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

Visit sage-support for installation help.

More details

Clone this wiki locally