Differences between revisions 1 and 55 (spanning 54 versions)
Revision 1 as of 2020-05-04 19:03:42
Size: 1153
Editor: mkoeppe
Comment: New page for Sage 9.3 release planning
Revision 55 as of 2021-04-03 07:02:52
Size: 26685
Editor: tscrim
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
in planning (2020) in progress (2021)
Line 7: Line 7:
== Polyhedral geometry ==
=== New features ===

The Schlegel diagrams are now repaired (they previously broke convexity).
Now, one specifies which facet to use to do the projection [[https://trac.sagemath.org/ticket/30015|30015]]:
{{{
#!python
sage: fcube = polytopes.hypercube(4)
sage: tfcube = fcube.face_truncation(fcube.faces(0)[0])
sage: tfcube.facets()[-1]
A 3-dimensional face of a Polyhedron in QQ^4 defined as the convex hull of 8 vertices
sage: sp = tfcube.schlegel_projection(tfcube.facets()[-1])
sage: sp.plot() # The proper Schlegel diagram is shown
}}}

A different values of ``position`` changes the projection:

{{{
#!python
sage: sp = tfcube.schlegel_projection(tfcube.facets()[4],1/2)
sage: sp.plot()
Graphics3d Object
sage: sp = tfcube.schlegel_projection(tfcube.facets()[4],4)
sage: sp.plot()
Graphics3d Object
}}}

New features:
 * [[https://trac.sagemath.org/ticket/30704|30704]]: Upgrade to Normaliz 3.8.9 and PyNormaliz 2.13
 * [[https://trac.sagemath.org/ticket/30946|30946]]: Add "minimal=True" option to affine_hull_projection
 * [[https://trac.sagemath.org/ticket/30954|30954]]: Implement a proper equality check for polyhedron representation objects

=== Implementation improvements ===

The zonotope construction got improved:

Before:

{{{
sage: from itertools import combinations
sage: cu = polytopes.cube()
sage: sgmt = [p.vector()-q.vector() for p,q in combinations(cu.vertices(),2)]
sage: sgmt2 = set(tuple(x) for x in sgmt)
sage: # %time polytopes.zonotope(sgmt) # killed due to memory overflow
sage: %time polytopes.zonotope(sgmt2)
CPU times: user 2.06 s, sys: 23.9 ms, total: 2.09 s
Wall time: 2.09 s
A 3-dimensional polyhedron in ZZ^3 defined as the convex hull of 96 vertices
}}}

With [[https://trac.sagemath.org/ticket/31038|31038]]:

{{{
sage: from itertools import combinations
sage: cu = polytopes.cube()
sage: sgmt = [p.vector()-q.vector() for p,q in combinations(cu.vertices(),2)]
sage: sgmt2 = set(tuple(x) for x in sgmt)
sage: %time polytopes.zonotope(sgmt)
CPU times: user 138 ms, sys: 0 ns, total: 138 ms
Wall time: 138 ms
A 3-dimensional polyhedron in ZZ^3 defined as the convex hull of 96 vertices
sage: %time polytopes.zonotope(sgmt2)
CPU times: user 58 ms, sys: 0 ns, total: 58 ms
Wall time: 57.6 ms
A 3-dimensional polyhedron in ZZ^3 defined as the convex hull of 96 vertices
}}}

Improvements:
 * [[https://trac.sagemath.org/ticket/30040|30040]]: Improve face iterator for simple/simplicial polytopes

There are also some bug fixes and other improvements. For more details see the [[https://trac.sagemath.org/wiki/SagePolyhedralGeometry#release_9.3|release notes for optimization and polyhedral geometry software interactions in Sage]].

== Graph theory ==

Major improvements in the backends:
 * [[https://trac.sagemath.org/ticket/30777|30777]]: Deleting edges
 * [[https://trac.sagemath.org/ticket/30665|30665]]: Edge iterator and copy
 * [[https://trac.sagemath.org/ticket/30776|30776]]: Subgraph and equality check
 * [[https://trac.sagemath.org/ticket/30753|30753]]: Obtaining subgraphs.
 * [[https://trac.sagemath.org/ticket/31117|31117]], [[https://trac.sagemath.org/ticket/31154|31154]]: Breadth First Search
 * [[https://trac.sagemath.org/ticket/31129|31129]]: Depth first search
 * [[https://trac.sagemath.org/ticket/31197|31197]]: Use binary matrix data structure for bitsets.

== Algebra ==

Additions, improvements, and some key bug-fixes:
 * Implement the symplectic derivation Lie algebra following [[https://arxiv.org/abs/2006.06064]]:
   {{{
sage: lie_algebras.SymplecticDerivation(QQ, 4)
Symplectic derivation Lie algebra of rank 4 over Rational Field
   }}}
 * Implement the *-insertion algorithm from ​[[https://arxiv.org/abs/1911.08732]]:
   {{{
sage: from sage.combinat.rsk import RuleStar
sage: p,q = RuleStar().forward_rule([1,1,2,2,4,4], [1,3,2,4,2,4])
sage: ascii_art(p, q)
 1 2 4 1 1 2
 1 4 2 4
 3 4
sage: line1,line2 = RuleStar().backward_rule(p, q)
sage: line1,line2
([1, 1, 2, 2, 4, 4], [1, 3, 2, 4, 2, 4])
   }}}
 * Speedup access items in gf2e dense matrices: [[https://trac.sagemath.org/ticket/29853|29853]]
 * Speedup conjugation of double dense matrices: [[https://trac.sagemath.org/ticket/31283|31283]]
 * Speedup iteration of partitions with parts in a specific set: [[https://trac.sagemath.org/ticket/31319|31319]]
 * Speedup iteration of points in affine and projective space over a finite field: [[https://trac.sagemath.org/ticket/25743|25743]]
 * We can compute the generators for the homology of a cell complex: [[https://trac.sagemath.org/ticket/30838|30838]]
 * Actions can now be pickled: [[https://trac.sagemath.org/ticket/29031|29031]]
 * Fixed bug in tensoring signed with unsigned modules: [[https://trac.sagemath.org/ticket/31266|31266]]
 * Fix the valuation of Puiseux series: [[https://trac.sagemath.org/ticket/30679|30679]]

== Knot theory ==

Fixed some wrong answers for the unknot: [[https://trac.sagemath.org/ticket/31001|31001]]

== Symbolic expressions ==

The predefined constant `I` in interactive sessions is now an element of the (embedded) number field ℚ[i] rather than a symbolic expression:
{{{
sage: I.parent()
Number Field in I with defining polynomial x^2 + 1 with I = 1*I
}}}
This allows it to be used in combination with other Sage objects without the coercion mechanism forcing the result to belong to the symbolic ring. For example, one now has
{{{
sage: (1.0 + I).parent()
Complex Field with 53 bits of precision
}}}
Expressions such as
{{{
sage: I + pi
pi + I
}}}
still yield symbolic results.
The symbolic imaginary unit `I` remains available as `SR(I)` or `SR.I()`, or, for library code, as `sage.symbolic.constants.I`. Importing it from `sage.symbolic` is deprecated. (#18036)

== Manifolds ==

=== Spheres added to the manifold catalog ===

Spheres of arbitrary dimension have been added to the manifold catalog, so that they can be initialized via `manifolds.Sphere(n)` ([[https://trac.sagemath.org/ticket/30804|#30804]]). For instance:
{{{
sage: S3 = manifolds.Sphere(3)
sage: S3
3-sphere S^3 of radius 1 smoothly embedded in the 4-dimensional Euclidean space E^4
}}}
By default, a single chart is initialized: that of spherical coordinates:
{{{
sage: S3.atlas()
[Chart (A, (chi, theta, phi))]
sage: S3.default_chart() is S3.spherical_coordinates()
True
}}}
Note that `A` stands for the domain of spherical coordinates, which is a strict subset of S^3^:
{{{
sage: S3.spherical_coordinates().domain()
Open subset A of the 3-sphere S^3 of radius 1 smoothly embedded in the 4-dimensional Euclidean space E^4
}}}
The sphere S^3^ is considered as an embedded submanifold of the Euclidean space E^4^:
{{{
sage: S3.embedding().display()
iota: S^3 --> E^4
on A: (chi, theta, phi) |--> (x1, x2, x3, x4) = (cos(phi)*sin(chi)*sin(theta), sin(chi)*sin(phi)*sin(theta), cos(theta)*sin(chi), cos(chi))
}}}
S^3^ is a Riemannian manifold, with the metric induced by the Euclidean metric on E^4^:
{{{
sage: g = S3.induced_metric()
sage: g.display()
gamma = dchi*dchi + sin(chi)^2 dtheta*dtheta + sin(chi)^2*sin(theta)^2 dphi*dphi
}}}
Beside spherical coordinates, stereographic coordinates are available too. Those from the North pole (NP) are obtained by
{{{
sage: S3.stereographic_coordinates()
Chart (S^3-{NP}, (y1, y2, y3))
}}}
The above call has augmented the manifold atlas with various charts and subcharts, corresponding to stereographic coordinates from the North pole and from the South pole:
{{{
sage: S3.atlas()
[Chart (A, (chi, theta, phi)),
 Chart (S^3-{NP}, (y1, y2, y3)),
 Chart (S^3-{SP}, (yp1, yp2, yp3)),
 Chart (S^3-{NP,SP}, (y1, y2, y3)),
 Chart (S^3-{NP,SP}, (yp1, yp2, yp3)),
 Chart (A, (y1, y2, y3)),
 Chart (A, (yp1, yp2, yp3))]
}}}
All relevant change-of-coordinate formulas have been initialized. For instance, those relating spherical coordinates to stereographic ones are obtained as follows:
{{{
sage: spher = S3.spherical_coordinates()
sage: stereo = S3.stereographic_coordinates()
sage: A = spher.domain()
sage: stereoA = stereo.restrict(A)
sage: S3.coord_changes()[(spher, stereoA)].display()
y1 = -cos(phi)*sin(chi)*sin(theta)/(cos(chi) - 1)
y2 = -sin(chi)*sin(phi)*sin(theta)/(cos(chi) - 1)
y3 = -cos(theta)*sin(chi)/(cos(chi) - 1)
}}}
The change-of-coordinate formulas are automatically invoked to compute the coordinates of a point from previously known ones in a different chart. For instance:
{{{
sage: p = S3((pi/2, pi/3, pi/4), chart=spher)
sage: p
Point on the 3-sphere S^3 of radius 1 smoothly embedded in the 4-dimensional Euclidean space E^4
sage: spher(p)
(1/2*pi, 1/3*pi, 1/4*pi)
sage: stereo(p)
(1/4*sqrt(3)*sqrt(2), 1/4*sqrt(3)*sqrt(2), 1/2)
}}}

=== Use of ambient metric by default for the Hodge dual of a differential form ===

When asking for the Hodge dual of a differential form on a pseudo-Riemannian manifold without specifying the metric, the manifold's default metric is assumed ([[https://trac.sagemath.org/ticket/31322|#31322]]). For example:
{{{
sage: E.<x,y,z> = EuclideanSpace()
sage: E.cartesian_coordinates().coframe()
Coordinate coframe (E^3, (dx,dy,dz))
sage: dx = E.cartesian_coordinates().coframe()[1]
sage: dx
1-form dx on the Euclidean space E^3
sage: dx.hodge_dual()
2-form *dx on the Euclidean space E^3
sage: dx.hodge_dual().display()
*dx = dy/\dz
}}}

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

Various improvements/refactoring of the code have been performed in this release:

* [[https://doc.sagemath.org/html/en/reference/manifolds/manifold.html|topological part]]: [[https://trac.sagemath.org/ticket/30310|#30310]], [[https://trac.sagemath.org/ticket/31243|#31243]]

* [[https://doc.sagemath.org/html/en/reference/manifolds/diff_manifold.html|differentiable part]]: [[https://trac.sagemath.org/ticket/30284|#30284]], [[https://trac.sagemath.org/ticket/31215|#31215]], [[https://trac.sagemath.org/ticket/31255|#31255]], [[https://trac.sagemath.org/ticket/31273|#31273]], [[https://trac.sagemath.org/ticket/31323|#31323]].


In addition, various bugs and typos have been fixed: [[https://trac.sagemath.org/ticket/30174|#30174]], [[https://trac.sagemath.org/ticket/30830|#30830]], [[https://trac.sagemath.org/ticket/31202|#31202]].

== Numerics ==

Automatic conversions from from floating-point numbers and symbolic expressions to real and complex intervals are deprecated and will be removed in the future. Code that relies on the existence of coercions
  * from `RealField` to `RealIntervalField`,
  * from `SymbolicRing` to `ComplexIntervalField`, or
  * from Python `float`s to `ComplexIntervalField`,
like
{{{
sage: RIF(1/3) + RR(1)
}}}
or
{{{
sage: 1.1*pi*CIF(i)
}}}
needs to be updated. (Other similar conversions, e.g. from `RealField` to `RealBallField` or from `float` to `RealField`, already need to be performed explicitly.) Beside leading to more consistent behavior, the removal of these coercions will make it easier to use interval arithmetic reliably. ([[https://trac.sagemath.org/ticket/15114|#15114]])

== Graphics ==

=== Three.js viewer ===

The `thickness` option for lines is now supported on more platforms, including Windows. It can now also be specified for surfaces in conjunction with {{{mesh=True}}} to control the thickness of the wireframe lines: [[https://trac.sagemath.org/ticket/26410|26410]]

{{{#!highlight python
line = parametric_plot3d([x*cos(x),x*sin(x),x], (x,0,2*pi), thickness=10)
surface = dodecahedron(mesh=True, thickness=10)
show(line + surface)
}}}

A dark theme has been implemented for the viewer. Use {{{theme='dark'}}} for the new theme or {{{theme='light'}}} for the default. If you would prefer the dark theme to be the default, edit your [[https://doc.sagemath.org/html/en/reference/repl/startup.html#the-init-sage-script|Sage start-up script]], adding the following: [[https://trac.sagemath.org/ticket/30462|30462]]

{{{#!highlight python
sage.plot.plot3d.base.SHOW_DEFAULTS['theme'] = 'dark'
}}}

You may now set the title of the HTML pages generated by the viewer, which can be helpful when having several such tabs open at once: [[https://trac.sagemath.org/ticket/30612|30612]]

{{{#!highlight python
show(dodecahedron(), page_title="My Favorite Polyhedron")
}}}

The font and opacity of the axis labels can now be customized similar to what was added in 9.2 for [[https://doc.sagemath.org/html/en/reference/plot3d/sage/plot/plot3d/shapes2.html#sage.plot.plot3d.shapes2.text3d|text3d]]. Pass either a single dictionary of options for all three axes or a list of three dictionaries, one per axis: [[https://trac.sagemath.org/ticket/30628|30628]]

{{{#!highlight python
style = [dict(color='red', fontweight='bold'),
         dict(fontsize=20, fontfamily='Times New Roman, Georgia, serif'),
         dict(fontstyle='italic', opacity=0.5)]
show(dodecahedron(), axes_labels_style=style)
}}}

Fixed clipping issues for plots that are very small or very large. [[https://trac.sagemath.org/ticket/30613|30613]]

== Package upgrades, system packages, user packages ==

=== Python ===

SageMath 9.3 continues to support system Python versions 3.6.x, 3.7.x, 3.8.x, and 3.9.x; support for Python 3.6.x is deprecated and will be removed in the SageMath 9.4 development cycle. If no suitable system Python is found, Sage installs its own copy of Python 3 from source. The version of Python shipped with the Sage distribution has been upgraded from 3.8.5 to 3.9.2. [[https://trac.sagemath.org/ticket/30589|#30589]], [[https://trac.sagemath.org/ticket/31318|#31318]], [[https://trac.sagemath.org/ticket/31419|#31419]]

=== Other package upgrades ===

[[https://trac.sagemath.org/query?summary=~update&milestone=sage-9.3&summary=~upgrade&groupdesc=1&group=status&max=1500&col=id&col=summary&col=component&col=time&col=changetime&col=author&col=reviewer&col=keywords&order=component|Upgrade tickets, milestone 9.3]]

=== SageMath on repology.org ===

The !SageMath distribution is now [[https://repology.org/repository/sagemath|listed as a repository on repology]]. The [[https://repology.org/projects/?inrepo=sagemath|list of packages]] allows developers to see which packages are in need of updating.

=== System package information for OpenSUSE ===

In particular, users of OpenSUSE Tumbleweed will notice the information about system packages that the Sage distribution can use.

=== Chapter on packages in the Sage reference manual ===

We have consolidated the information about packages into a single source, [[https://github.com/sagemath/sage/tree/develop/build/pkgs|build/pkgs/]] in the source tree, from which we generate package lists for the reference manual [[https://trac.sagemath.org/ticket/29655|#29655]], to which also the Sage website points.

A number of user packages have been added as optional packages: `ore_algebra`, `sage_flatsurf`, `admcycles`, `slabbe`, `snappy`, `surface_dynamics`. Meta-ticket [[https://trac.sagemath.org/ticket/31164|#31164]] tracks the task of adding user packages to `build/pkgs/`.

=== For developers and packagers: Version constraints for Python packages ===

For all Python packages in the Sage distribution, `build/pkgs/SPKG/install-requires.txt` now encodes version constraints (such as lower and upper bounds) [[https://trac.sagemath.org/ticket/30719|#30719]].
The constraints are in the format of the `install_requires` key of [[https://setuptools.readthedocs.io/en/latest/userguide/declarative_config.html|setup.cfg]] or [[https://packaging.python.org/discussions/install-requires-vs-requirements/#id5|setup.py]].

The files may include comments (starting with `#`) that explain why a particular lower bound is warranted or why we wish to include or reject certain versions.
For example:
{{{
$ cat build/pkgs/sphinx/package-version.txt
3.1.2.p0
$ cat build/pkgs/sphinx/install-requires.txt
# gentoo uses 3.2.1
sphinx >=3, <3.3
}}}
The comments may include links to Trac tickets, as in the following example:
{{{
$ cat build/pkgs/packaging/install-requires.txt
packaging >=18.0
# Trac #30975: packaging 20.5 is known to work but we have to silence "DeprecationWarning: Creating a LegacyVersion"
}}}
The currently encoded version constraints are merely a starting point.
Downstream packagers and developers are invited to refine the version constraints based on their experience and tests. When a package update is made in order to pick up a critical bug fix from a newer version, then the lower bound should be adjusted.

In Sage 9.3, the new files are included only for documentation purposes and to facilitate development and packaging. An effort is underway in [[https://trac.sagemath.org/ticket/30913|#30913]] to use the new files to generate dependency metadata for the Sage library.
There is no mechanism yet to use system Python packages; see [[https://trac.sagemath.org/ticket/29023|Meta-ticket #29013]] for this task.

=== For developers: Setting up Python packages from PyPI as Sage packages ===

Setting up Python packages from PyPI as Sage packages has become easier [[https://trac.sagemath.org/ticket/30974|#30974]].
{{{
$ ./sage -package create scikit_spatial --pypi
Downloading tarball to /Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/upstream/scikit-spatial-5.0.0.tar.gz
[......................................................................]
$ ls build/pkgs/scikit_spatial/
SPKG.rst dependencies package-version.txt type
checksums.ini install-requires.txt spkg-install.in
$ cat build/pkgs/scikit_spatial/SPKG.rst
scikit_spatial: Spatial objects and computations based on NumPy arrays
======================================================================

Description
-----------

Spatial objects and computations based on NumPy arrays.

License
-------

BSD license

Upstream Contact
----------------

https://pypi.org/project/scikit-spatial/
}}}

Note that this new command does not check the dependencies of the Python package; this still needs to be done manually.

The above command creates a [[https://doc.sagemath.org/html/en/developer/packaging.html#package-source-types|"normal" package]] (with tarball information in `checksums.ini`).
To create a package as a "pip" package (which will be obtained directly from PyPI on an install), use `./sage -package create scikit_spatial --pypi --source pip` instead.


== Cleaning of the Sage codebase to conform to best practices ==

... Status and tools ...

Line 9: Line 386:
 * [[https://groups.google.com/d/msg/sage-devel/M9QTWtln6zU/UHwkrmTKBQAJ|sage-devel: Proposal for Sage 9.3: Modularization of sagelib; in particular, splitting out a sage_objects package]]

 * [[https://trac.sagemath.org/ticket/21507|Meta-ticket #21507: Make sagelib a pip-installable Python source package, listed on PyPI]]
A source tarball of the Sage distribution (or a worktree of the Sage git repository after running the `./bootstrap` script) contains several self-contained source trees of Python distribution packages in `build/pkgs/*/src/`, which can be packaged, built and installed by standard Python procedures:
 * `setup.py sdist` builds a source distribution (it is invoked by the convenience script `build/pkgs/*/spkg-src`), which can afterwards be installed using `pip`.
 * `setup.py install` installs the package directly (this is legacy use of `setuptools` and is not recommended).
 * `setup.py bdist_wheel` builds a wheel, which can afterwards be installed using `pip`.
 * Note, however, that `pip install .` does not work. In order to keep the monolithic structure of the `SAGE_ROOT/src` tree unchanged (for the convenience of Sage developers), the source trees of the Python distribution packages make use of symlinks. These symlinks are not compatible with `pip install .`. However, `setup.py sdist` follows the symlinks - the resulting source distribution contains ordinary files only and is therefore pip-installable.

The following Python distribution packages exist in Sage 9.3:
 * The Sage library is built from [[https://github.com/sagemath/sage/tree/develop/build/pkgs/sagelib|build/pkgs/sagelib]]`/src`. Since 9.3.beta8, the resulting [[https://pypi.org/project/sagemath-standard/|source distribution sagemath-standard]] is available on PyPI.
 * The directory [[https://github.com/sagemath/sage/tree/develop/build/pkgs/sage_docbuild|build/pkgs/sage_docbuild]]`/src` contains a distribution that provides the Python package `sage_docbuild`, moved from `sage_setup.docbuild` in [[https://trac.sagemath.org/ticket/30476|#30476]]. Since 9.3.beta9, the resulting [[https://pypi.org/project/sage-docbuild/|source distribution sage-docbuild]] is available on PyPI.
 * The directory [[https://github.com/sagemath/sage/tree/develop/build/pkgs/sage_sws2rst|build/pkgs/sage_sws2rst]]`/src` contains the source of https://pypi.org/project/sage-sws2rst/
 * The directory [[https://github.com/sagemath/sage/tree/develop/build/pkgs/sage_conf|build/pkgs/sage_conf]]`/src` (after running the top-level `configure` script) contains the source of the [[https://trac.sagemath.org/ticket/21707|Sage configuration package]], which provides:
   * a single Python module, `sage_conf`, providing configuration information to the SageMath library at the time of its installation and at its runtime
   * a console script `sage-config`, for querying the variables of `sage_conf` from the shell
   * the sourcable shell script `sage-env-config`, providing additional configuration information in the form of environment variables.

In the course of the modularization effort of [[https://trac.sagemath.org/ticket/29705|Meta-ticket #29705]], in the Sage 9.4 series we expect to add many more distribution packages in the same format.
 * Splitting out `sage_setup` (the build system of the Sage library) as a separate distribution package (currently it is shipped as part of `sagemath-standard`).
 * Providing alternative implementations of `sage_conf` for different use cases.
 * Splitting `sagemath-standard` into many namespace packages.

== Configuration changes ==

=== Editable ("in-place", "develop") installs of the Sage library ===

Use `./configure --enable-editable` to configure the Sage distribution to install the Sage library in "develop" ("editable", "in-place") mode instead of using the Sage library's custom incremental build system. [[https://trac.sagemath.org/ticket/31377|#31377]]

It has the benefit that to try out changes to Python files, one does not need to run `./sage -b` any more; restarting Sage is enough. It may also have benefits in certain develop environments that get confused by sagelib's custom build system.

Note that in an editable install, the source directory will be cluttered with build artifacts (but they are `.gitignore`d). This is normal.

=== Use of system Jupyter notebook / JupyterLab ===

The Sage Installation Manual now has instructions on how to run the !SageMath Jupyter kernel in a system Jupyter notebook or !JupyterLab [[https://trac.sagemath.org/ticket/30476|#30476]]

 * [[https://trac.sagemath.org/ticket/30306|Meta-ticket #30306: Use system Jupyter notebook / JupyterLab]]

If you intend to (a) only use Sage in a terminal, or (b) only use the !SageMath kernel with your system Jupyter notebook or !JupyterLab, you can now build Sage without the notebook components, by using `./configure --disable-notebook`. [[https://trac.sagemath.org/ticket/30383|#30383]] [[https://trac.sagemath.org/ticket/31278|#31278]]
Line 17: Line 428:
 * [[https://trac.sagemath.org/query?milestone=sage-9.2&groupdesc=1&group=status&max=1500&col=id&col=summary&col=author&col=reviewer&col=time&col=changetime&col=component&col=keywords&order=component|Trac tickets with milestone 9.3]]  * [[https://trac.sagemath.org/query?milestone=sage-9.3&groupdesc=1&group=status&max=1500&col=id&col=summary&col=author&col=reviewer&col=time&col=changetime&col=component&col=keywords&order=component|Trac tickets with milestone 9.3]]
Line 21: Line 432:
The Sage 9.3 series has not been started yet.

 * See [[https://groups.google.com/forum/#!forum/sage-devel|sage-devel]] for development discussions.
[[https://groups.google.com/g/sage-release/c/rjM44KX8pbc/m/QMKYBBZrBwAJ|The first release candidate, 9.3.rc0, was tagged on 2021-03-23.]]

!SageMath 9.3 will support [[https://wiki.sagemath.org/ReleaseTours/sage-9.2#Availability_of_Sage_9.2_and_installation_help|all platforms that were supported by Sage 9.2]]. '''Sage 9.3 adds support for building Sage from source on macOS 11 ("Big Sur").'''

 * 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.3 Release Tour

in progress (2021)

Polyhedral geometry

New features

The Schlegel diagrams are now repaired (they previously broke convexity). Now, one specifies which facet to use to do the projection 30015:

   1 sage: fcube = polytopes.hypercube(4)
   2 sage: tfcube = fcube.face_truncation(fcube.faces(0)[0])
   3 sage: tfcube.facets()[-1]
   4 A 3-dimensional face of a Polyhedron in QQ^4 defined as the convex hull of 8 vertices
   5 sage: sp = tfcube.schlegel_projection(tfcube.facets()[-1])
   6 sage: sp.plot()  # The proper Schlegel diagram is shown

A different values of position changes the projection:

   1 sage: sp = tfcube.schlegel_projection(tfcube.facets()[4],1/2)
   2 sage: sp.plot()
   3 Graphics3d Object
   4 sage: sp = tfcube.schlegel_projection(tfcube.facets()[4],4)
   5 sage: sp.plot()
   6 Graphics3d Object

New features:

  • 30704: Upgrade to Normaliz 3.8.9 and PyNormaliz 2.13

  • 30946: Add "minimal=True" option to affine_hull_projection

  • 30954: Implement a proper equality check for polyhedron representation objects

Implementation improvements

The zonotope construction got improved:

Before:

sage: from itertools import combinations                                                                                                                                            
sage: cu = polytopes.cube()                                                                                                                                                         
sage: sgmt = [p.vector()-q.vector() for p,q in combinations(cu.vertices(),2)]                                                                                                       
sage: sgmt2 = set(tuple(x) for x in sgmt)                                                                                                                                           
sage: # %time polytopes.zonotope(sgmt)  # killed due to memory overflow                                                                                                                                              
sage: %time polytopes.zonotope(sgmt2)                                                                                                                                               
CPU times: user 2.06 s, sys: 23.9 ms, total: 2.09 s
Wall time: 2.09 s
A 3-dimensional polyhedron in ZZ^3 defined as the convex hull of 96 vertices

With 31038:

sage: from itertools import combinations                                                                                                                                            
sage: cu = polytopes.cube()                                                                                                                                                         
sage: sgmt = [p.vector()-q.vector() for p,q in combinations(cu.vertices(),2)]                                                                                                       
sage: sgmt2 = set(tuple(x) for x in sgmt)                                                                                                                                           
sage: %time polytopes.zonotope(sgmt)                                                                                                                                                
CPU times: user 138 ms, sys: 0 ns, total: 138 ms
Wall time: 138 ms
A 3-dimensional polyhedron in ZZ^3 defined as the convex hull of 96 vertices
sage: %time polytopes.zonotope(sgmt2)                                                                                                                                               
CPU times: user 58 ms, sys: 0 ns, total: 58 ms
Wall time: 57.6 ms
A 3-dimensional polyhedron in ZZ^3 defined as the convex hull of 96 vertices

Improvements:

  • 30040: Improve face iterator for simple/simplicial polytopes

There are also some bug fixes and other improvements. For more details see the release notes for optimization and polyhedral geometry software interactions in Sage.

Graph theory

Major improvements in the backends:

  • 30777: Deleting edges

  • 30665: Edge iterator and copy

  • 30776: Subgraph and equality check

  • 30753: Obtaining subgraphs.

  • 31117, 31154: Breadth First Search

  • 31129: Depth first search

  • 31197: Use binary matrix data structure for bitsets.

Algebra

Additions, improvements, and some key bug-fixes:

  • Implement the symplectic derivation Lie algebra following https://arxiv.org/abs/2006.06064:

    • sage: lie_algebras.SymplecticDerivation(QQ, 4)
      Symplectic derivation Lie algebra of rank 4 over Rational Field
  • Implement the *-insertion algorithm from ​https://arxiv.org/abs/1911.08732:

    • sage: from sage.combinat.rsk import RuleStar
      sage: p,q = RuleStar().forward_rule([1,1,2,2,4,4], [1,3,2,4,2,4])
      sage: ascii_art(p, q)
       1  2  4  1  1  2
       1  4     2  4
       3        4
      sage: line1,line2 = RuleStar().backward_rule(p, q)
      sage: line1,line2
      ([1, 1, 2, 2, 4, 4], [1, 3, 2, 4, 2, 4])
  • Speedup access items in gf2e dense matrices: 29853

  • Speedup conjugation of double dense matrices: 31283

  • Speedup iteration of partitions with parts in a specific set: 31319

  • Speedup iteration of points in affine and projective space over a finite field: 25743

  • We can compute the generators for the homology of a cell complex: 30838

  • Actions can now be pickled: 29031

  • Fixed bug in tensoring signed with unsigned modules: 31266

  • Fix the valuation of Puiseux series: 30679

Knot theory

Fixed some wrong answers for the unknot: 31001

Symbolic expressions

The predefined constant I in interactive sessions is now an element of the (embedded) number field ℚ[i] rather than a symbolic expression:

sage: I.parent()
Number Field in I with defining polynomial x^2 + 1 with I = 1*I

This allows it to be used in combination with other Sage objects without the coercion mechanism forcing the result to belong to the symbolic ring. For example, one now has

sage: (1.0 + I).parent()
Complex Field with 53 bits of precision

Expressions such as

sage: I + pi
pi + I

still yield symbolic results. The symbolic imaginary unit I remains available as SR(I) or SR.I(), or, for library code, as sage.symbolic.constants.I. Importing it from sage.symbolic is deprecated. (#18036)

Manifolds

Spheres added to the manifold catalog

Spheres of arbitrary dimension have been added to the manifold catalog, so that they can be initialized via manifolds.Sphere(n) (#30804). For instance:

sage: S3 = manifolds.Sphere(3)
sage: S3
3-sphere S^3 of radius 1 smoothly embedded in the 4-dimensional Euclidean space E^4

By default, a single chart is initialized: that of spherical coordinates:

sage: S3.atlas()
[Chart (A, (chi, theta, phi))]
sage: S3.default_chart() is S3.spherical_coordinates()
True

Note that A stands for the domain of spherical coordinates, which is a strict subset of S3:

sage: S3.spherical_coordinates().domain()                                                           
Open subset A of the 3-sphere S^3 of radius 1 smoothly embedded in the 4-dimensional Euclidean space E^4

The sphere S3 is considered as an embedded submanifold of the Euclidean space E4:

sage: S3.embedding().display()
iota: S^3 --> E^4
on A: (chi, theta, phi) |--> (x1, x2, x3, x4) = (cos(phi)*sin(chi)*sin(theta), sin(chi)*sin(phi)*sin(theta), cos(theta)*sin(chi), cos(chi))

S3 is a Riemannian manifold, with the metric induced by the Euclidean metric on E4:

sage: g = S3.induced_metric()
sage: g.display()
gamma = dchi*dchi + sin(chi)^2 dtheta*dtheta + sin(chi)^2*sin(theta)^2 dphi*dphi

Beside spherical coordinates, stereographic coordinates are available too. Those from the North pole (NP) are obtained by

sage: S3.stereographic_coordinates()
Chart (S^3-{NP}, (y1, y2, y3))

The above call has augmented the manifold atlas with various charts and subcharts, corresponding to stereographic coordinates from the North pole and from the South pole:

sage: S3.atlas()
[Chart (A, (chi, theta, phi)),
 Chart (S^3-{NP}, (y1, y2, y3)),
 Chart (S^3-{SP}, (yp1, yp2, yp3)),
 Chart (S^3-{NP,SP}, (y1, y2, y3)),
 Chart (S^3-{NP,SP}, (yp1, yp2, yp3)),
 Chart (A, (y1, y2, y3)),
 Chart (A, (yp1, yp2, yp3))]

All relevant change-of-coordinate formulas have been initialized. For instance, those relating spherical coordinates to stereographic ones are obtained as follows:

sage: spher = S3.spherical_coordinates()
sage: stereo = S3.stereographic_coordinates()
sage: A = spher.domain()
sage: stereoA = stereo.restrict(A)
sage: S3.coord_changes()[(spher, stereoA)].display()
y1 = -cos(phi)*sin(chi)*sin(theta)/(cos(chi) - 1)
y2 = -sin(chi)*sin(phi)*sin(theta)/(cos(chi) - 1)
y3 = -cos(theta)*sin(chi)/(cos(chi) - 1)

The change-of-coordinate formulas are automatically invoked to compute the coordinates of a point from previously known ones in a different chart. For instance:

sage: p = S3((pi/2, pi/3, pi/4), chart=spher)                                                       
sage: p                                                                                             
Point on the 3-sphere S^3 of radius 1 smoothly embedded in the 4-dimensional Euclidean space E^4
sage: spher(p)                                                                                      
(1/2*pi, 1/3*pi, 1/4*pi)
sage: stereo(p)                                                                                     
(1/4*sqrt(3)*sqrt(2), 1/4*sqrt(3)*sqrt(2), 1/2)

Use of ambient metric by default for the Hodge dual of a differential form

When asking for the Hodge dual of a differential form on a pseudo-Riemannian manifold without specifying the metric, the manifold's default metric is assumed (#31322). For example:

sage: E.<x,y,z> = EuclideanSpace()
sage: E.cartesian_coordinates().coframe()
Coordinate coframe (E^3, (dx,dy,dz))
sage: dx = E.cartesian_coordinates().coframe()[1]
sage: dx
1-form dx on the Euclidean space E^3
sage: dx.hodge_dual()
2-form *dx on the Euclidean space E^3
sage: dx.hodge_dual().display()
*dx = dy/\dz

Internal code improvements and bug fixes

Various improvements/refactoring of the code have been performed in this release:

* topological part: #30310, #31243

* differentiable part: #30284, #31215, #31255, #31273, #31323.

In addition, various bugs and typos have been fixed: #30174, #30830, #31202.

Numerics

Automatic conversions from from floating-point numbers and symbolic expressions to real and complex intervals are deprecated and will be removed in the future. Code that relies on the existence of coercions

  • from RealField to RealIntervalField,

  • from SymbolicRing to ComplexIntervalField, or

  • from Python floats to ComplexIntervalField,

like

sage: RIF(1/3) + RR(1)

or

sage: 1.1*pi*CIF(i)

needs to be updated. (Other similar conversions, e.g. from RealField to RealBallField or from float to RealField, already need to be performed explicitly.) Beside leading to more consistent behavior, the removal of these coercions will make it easier to use interval arithmetic reliably. (#15114)

Graphics

Three.js viewer

The thickness option for lines is now supported on more platforms, including Windows. It can now also be specified for surfaces in conjunction with mesh=True to control the thickness of the wireframe lines: 26410

   1 line = parametric_plot3d([x*cos(x),x*sin(x),x], (x,0,2*pi), thickness=10)
   2 surface = dodecahedron(mesh=True, thickness=10)
   3 show(line + surface)

A dark theme has been implemented for the viewer. Use theme='dark' for the new theme or theme='light' for the default. If you would prefer the dark theme to be the default, edit your Sage start-up script, adding the following: 30462

   1 sage.plot.plot3d.base.SHOW_DEFAULTS['theme'] = 'dark'

You may now set the title of the HTML pages generated by the viewer, which can be helpful when having several such tabs open at once: 30612

   1 show(dodecahedron(), page_title="My Favorite Polyhedron")

The font and opacity of the axis labels can now be customized similar to what was added in 9.2 for text3d. Pass either a single dictionary of options for all three axes or a list of three dictionaries, one per axis: 30628

   1 style = [dict(color='red', fontweight='bold'),
   2          dict(fontsize=20, fontfamily='Times New Roman, Georgia, serif'),
   3          dict(fontstyle='italic', opacity=0.5)]
   4 show(dodecahedron(), axes_labels_style=style)

Fixed clipping issues for plots that are very small or very large. 30613

Package upgrades, system packages, user packages

Python

SageMath 9.3 continues to support system Python versions 3.6.x, 3.7.x, 3.8.x, and 3.9.x; support for Python 3.6.x is deprecated and will be removed in the SageMath 9.4 development cycle. If no suitable system Python is found, Sage installs its own copy of Python 3 from source. The version of Python shipped with the Sage distribution has been upgraded from 3.8.5 to 3.9.2. #30589, #31318, #31419

Other package upgrades

Upgrade tickets, milestone 9.3

SageMath on repology.org

The SageMath distribution is now listed as a repository on repology. The list of packages allows developers to see which packages are in need of updating.

System package information for OpenSUSE

In particular, users of OpenSUSE Tumbleweed will notice the information about system packages that the Sage distribution can use.

Chapter on packages in the Sage reference manual

We have consolidated the information about packages into a single source, build/pkgs/ in the source tree, from which we generate package lists for the reference manual #29655, to which also the Sage website points.

A number of user packages have been added as optional packages: ore_algebra, sage_flatsurf, admcycles, slabbe, snappy, surface_dynamics. Meta-ticket #31164 tracks the task of adding user packages to build/pkgs/.

For developers and packagers: Version constraints for Python packages

For all Python packages in the Sage distribution, build/pkgs/SPKG/install-requires.txt now encodes version constraints (such as lower and upper bounds) #30719. The constraints are in the format of the install_requires key of setup.cfg or setup.py.

The files may include comments (starting with #) that explain why a particular lower bound is warranted or why we wish to include or reject certain versions. For example:

$ cat build/pkgs/sphinx/package-version.txt 
3.1.2.p0
$ cat build/pkgs/sphinx/install-requires.txt
# gentoo uses 3.2.1
sphinx >=3, <3.3

The comments may include links to Trac tickets, as in the following example:

$ cat build/pkgs/packaging/install-requires.txt
packaging >=18.0
# Trac #30975: packaging 20.5 is known to work but we have to silence "DeprecationWarning: Creating a LegacyVersion"

The currently encoded version constraints are merely a starting point. Downstream packagers and developers are invited to refine the version constraints based on their experience and tests. When a package update is made in order to pick up a critical bug fix from a newer version, then the lower bound should be adjusted.

In Sage 9.3, the new files are included only for documentation purposes and to facilitate development and packaging. An effort is underway in #30913 to use the new files to generate dependency metadata for the Sage library. There is no mechanism yet to use system Python packages; see Meta-ticket #29013 for this task.

For developers: Setting up Python packages from PyPI as Sage packages

Setting up Python packages from PyPI as Sage packages has become easier #30974.

$ ./sage -package create scikit_spatial --pypi
Downloading tarball to /Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/upstream/scikit-spatial-5.0.0.tar.gz
[......................................................................]
$ ls build/pkgs/scikit_spatial/
SPKG.rst                dependencies            package-version.txt     type
checksums.ini           install-requires.txt    spkg-install.in
$ cat build/pkgs/scikit_spatial/SPKG.rst 
scikit_spatial: Spatial objects and computations based on NumPy arrays
======================================================================

Description
-----------

Spatial objects and computations based on NumPy arrays.

License
-------

BSD license

Upstream Contact
----------------

https://pypi.org/project/scikit-spatial/

Note that this new command does not check the dependencies of the Python package; this still needs to be done manually.

The above command creates a "normal" package (with tarball information in checksums.ini). To create a package as a "pip" package (which will be obtained directly from PyPI on an install), use ./sage -package create scikit_spatial --pypi --source pip instead.

Cleaning of the Sage codebase to conform to best practices

... Status and tools ...

Modularization and packaging of sagelib

A source tarball of the Sage distribution (or a worktree of the Sage git repository after running the ./bootstrap script) contains several self-contained source trees of Python distribution packages in build/pkgs/*/src/, which can be packaged, built and installed by standard Python procedures:

  • setup.py sdist builds a source distribution (it is invoked by the convenience script build/pkgs/*/spkg-src), which can afterwards be installed using pip.

  • setup.py install installs the package directly (this is legacy use of setuptools and is not recommended).

  • setup.py bdist_wheel builds a wheel, which can afterwards be installed using pip.

  • Note, however, that pip install . does not work. In order to keep the monolithic structure of the SAGE_ROOT/src tree unchanged (for the convenience of Sage developers), the source trees of the Python distribution packages make use of symlinks. These symlinks are not compatible with pip install .. However, setup.py sdist follows the symlinks - the resulting source distribution contains ordinary files only and is therefore pip-installable.

The following Python distribution packages exist in Sage 9.3:

In the course of the modularization effort of Meta-ticket #29705, in the Sage 9.4 series we expect to add many more distribution packages in the same format.

  • Splitting out sage_setup (the build system of the Sage library) as a separate distribution package (currently it is shipped as part of sagemath-standard).

  • Providing alternative implementations of sage_conf for different use cases.

  • Splitting sagemath-standard into many namespace packages.

Configuration changes

Editable ("in-place", "develop") installs of the Sage library

Use ./configure --enable-editable to configure the Sage distribution to install the Sage library in "develop" ("editable", "in-place") mode instead of using the Sage library's custom incremental build system. #31377

It has the benefit that to try out changes to Python files, one does not need to run ./sage -b any more; restarting Sage is enough. It may also have benefits in certain develop environments that get confused by sagelib's custom build system.

Note that in an editable install, the source directory will be cluttered with build artifacts (but they are .gitignored). This is normal.

Use of system Jupyter notebook / JupyterLab

The Sage Installation Manual now has instructions on how to run the SageMath Jupyter kernel in a system Jupyter notebook or JupyterLab #30476

If you intend to (a) only use Sage in a terminal, or (b) only use the SageMath kernel with your system Jupyter notebook or JupyterLab, you can now build Sage without the notebook components, by using ./configure --disable-notebook. #30383 #31278

Tickets

Availability of Sage 9.3 and installation help

The first release candidate, 9.3.rc0, was tagged on 2021-03-23.

SageMath 9.3 will support all platforms that were supported by Sage 9.2. Sage 9.3 adds support for building Sage from source on macOS 11 ("Big Sur").

  • See sage-devel for development discussions and sage-release for announcements of beta versions and release candidates.

ReleaseTours/sage-9.3 (last edited 2022-05-14 16:52:08 by mkoeppe)