Skip to main content

passagemath: Combinatorial matrix recognition

Project description

passagemath is open source mathematical software in Python, released under the GNU General Public Licence GPLv2+.

It is a fork of SageMath, which has been developed 2005-2026 under the motto “Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, and MATLAB”.

The passagemath fork uses the motto “Creating a Free Passage Between the Scientific Python Ecosystem and Mathematical Software Communities.” It was created in October 2024 with the following goals:

Moreover, the passagemath project:

  • provides a stable, frequently updated version of the Sage distribution,

  • integrates additional mathematical software, notably Macaulay2, a full set of GAP packages, and the Combinatorial Matrix Recognition library,

  • curates a library of Sage user packages.

Full documentation is available online.

passagemath attempts to support and provides binary wheels suitable for all major Linux distributions and recent versions of macOS.

Binary wheels for native Windows (x86_64, ARM) are are available for a subset of the passagemath distributions. Use of the full functionality of passagemath on Windows currently requires the use of Windows Subsystem for Linux (WSL) or virtualization.

The supported Python versions in the passagemath-10.8.x series are 3.11.x-3.14.x; the passagemath-10.6.x series (EOL 2026-10) still supports Python 3.10.x.

About this pip-installable distribution package

This pip-installable distribution passagemath-cmr is a small optional distribution for use with passagemath-modules and passagemath-graphs.

It provides a Cython interface to the CMR library, which implements recognition and decomposition algorithms for:

  • Totally Unimodular Matrices

  • Network Matrices

  • Complementary Totally Unimodular Matrices

  • (Strongly) Equimodular and Unimodular Matrices

  • Regular Matroids

  • Graphic / Cographic / Planar Matrices

  • Series-Parallel Matroids

Examples

$ pipx run --spec "passagemath-cmr[test]" ipython

In [1]: from passagemath_cmr import *

In [2]: from sage.matrix.matrix_cmr_sparse import Matrix_cmr_chr_sparse

In [3]: M = Matrix_cmr_chr_sparse(MatrixSpace(ZZ, 3, 3, sparse=True), [[1, 0, 1], [0, 1, 1], [1, 2, 3]]); M
Out[3]:
[1 0 1]
[0 1 1]
[1 2 3]

In [4]: M.is_unimodular()
Out[4]: True

In [5]: M.is_strongly_unimodular()
Out[5]: False

Development

$ git clone --origin passagemath https://github.com/passagemath/passagemath.git  # or use your fork
$ cd passagemath
passagemath $ ./bootstrap
passagemath $ source ./.homebrew-build-env         # on macOS when homebrew is in use
passagemath $ export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/wsl/lib  # on WSL
passagemath $ export PIP_CONSTRAINT="$(pwd)/constraints_cmr.txt"
passagemath $ export PIP_BUILD_CONSTRAINT="$(pwd)/constraints_cmr.txt"
passagemath $ echo "passagemath-categories @ file://$(pwd)/pkgs/sagemath-categories" >> constraints_cmr.txt
passagemath $ echo "passagemath-modules @ file://$(pwd)/pkgs/sagemath-modules" >> constraints_cmr.txt
passagemath $ python3 -m venv cmr-venv
passagemath $ source cmr-venv/bin/activate
(cmr-venv) passagemath $ pip install -v -e pkgs/sagemath-cmr        \
                                        -e pkgs/sagemath-modules    \
                                        -e pkgs/sagemath-categories

Modularized use:

(cmr-venv) passagemath $ pip install -v passagemath-repl
(cmr-venv) passagemath $ sage
... sage.all is not available ...
sage: from passagemath_modules import *
sage: matroids.Uniform(3, 4)
U(3, 4): Matroid of rank 3 on 4 elements with circuit-closures
{3: {{0, 1, 2, 3}}}

In plain Python:

(cmr-venv) passagemath $ python3
>>> from passagemath_modules import *
>>> matroids.Uniform(3, 4)
U(3, 4): Matroid of rank 3 on 4 elements with circuit-closures
{3: {{0, 1, 2, 3}}}

For full functionality of Sage:

(cmr-venv) passagemath $ pip install -v passagemath-standard
(cmr-venv) passagemath $ sage
sage: matroids.Uniform(3, 4)
U(3, 4): Matroid of rank 3 on 4 elements with circuit-closures
{3: {{0, 1, 2, 3}}}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

passagemath_cmr-10.8.6-cp314-cp314t-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.14tWindows x86-64

passagemath_cmr-10.8.6-cp314-cp314-win_amd64.whl (3.1 MB view details)

Uploaded CPython 3.14Windows x86-64

passagemath_cmr-10.8.6-cp313-cp313-win_amd64.whl (3.0 MB view details)

Uploaded CPython 3.13Windows x86-64

passagemath_cmr-10.8.6-cp312-cp312-win_amd64.whl (3.0 MB view details)

Uploaded CPython 3.12Windows x86-64

passagemath_cmr-10.8.6-cp311-cp311-win_amd64.whl (3.0 MB view details)

Uploaded CPython 3.11Windows x86-64

File details

Details for the file passagemath_cmr-10.8.6-cp314-cp314t-win_amd64.whl.

File metadata

File hashes

Hashes for passagemath_cmr-10.8.6-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 9c9c521ef18c44c0c621dc800ab49d893bd9cfee69e1599cf1b8dcfbf8ae36eb
MD5 e7188dc9333435ddb80747206a85e89f
BLAKE2b-256 0ca79f26ba1c268adc1e2432d2c939b188fe5fcec9123d0464485a3bdcacf18a

See more details on using hashes here.

File details

Details for the file passagemath_cmr-10.8.6-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for passagemath_cmr-10.8.6-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 3a1c26b93e9601d5bd4dfcb76ca2446a718b96ffe00aef9ad07dc1795c46411f
MD5 d1d6faf64b33c6120df31f32957b958b
BLAKE2b-256 4191cb0124b773de760ab5a959782c7ff14c616ac1751f845bac81c074537c4c

See more details on using hashes here.

File details

Details for the file passagemath_cmr-10.8.6-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for passagemath_cmr-10.8.6-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 f859192595b269a91162ff5ca08a53a9418faa196d8e38ff644db4ee609c92f7
MD5 66247fabdbc207a743cd55f7b934d630
BLAKE2b-256 4df13308717b30aec9f983745522be4ace91bd0c4ac3845ebbd77f9d15059b5c

See more details on using hashes here.

File details

Details for the file passagemath_cmr-10.8.6-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for passagemath_cmr-10.8.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 b2ab58ba3632e608c586fb74761e9a07b111ae4af21b077a8a48c86b76af6bbc
MD5 900b545aa280a8ea04bd1d0e370b5b4b
BLAKE2b-256 f705d1e626756e043c13e2d4a9b1ca717a27f838ad887ff86303f7d7cd965b9e

See more details on using hashes here.

File details

Details for the file passagemath_cmr-10.8.6-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for passagemath_cmr-10.8.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 12bfeffcd0c2d2d09169ba7e6c4b80510fe440d63c9850e156e7ca27096484ba
MD5 42ffd7ad30c955a66d1e03eb45881b27
BLAKE2b-256 241e392249a29526ba4051d6a890ac4320f0d1ea6bc47498856fbe2f5e3a5dea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page