Skip to main content

Python-MUMPS

Python bindings for the MUMPS: a parallel sparse direct solver.

Scope

This package targets MUMPS packaged by conda-forge using Cython bindings. It aims to provide a full wrapper of the MUMPS sequential API. Its primary target OS is Linux.

Next steps include:

  • Support for Windows and OSX
  • Support for distributed (MPI) MUMPS

Installation

python-mumps works with Python 3.12 and higher on Linux, Windows and Mac.

The recommended way to install python-mumps is using mamba/conda.

mamba install -c conda-forge python-mumps

python-mumps can also be installed from PyPI, however this is a more involved procedure that requires separately installing the MUMPS library and a C compiler.

Usage example

The following example shows how Python-MUMPS can be used to implement sparse diagonalization with Scipy.

import scipy.sparse.linalg as sla
from scipy.sparse import identity
import mumps


def sparse_diag(matrix, k, sigma, **kwargs):
    """Call sla.eigsh with mumps support.

    See scipy.sparse.linalg.eigsh for documentation.
    """
    class LuInv(sla.LinearOperator):
        def __init__(self, A):
            inst = mumps.Context()
            inst.analyze(A, ordering='pord')
            inst.factor(A)
            self.solve = inst.solve
            sla.LinearOperator.__init__(self, A.dtype, A.shape)

        def _matvec(self, x):
            return self.solve(x.astype(self.dtype))

    opinv = LuInv(matrix - sigma * identity(matrix.shape[0]))
    return sla.eigsh(matrix, k, sigma=sigma, OPinv=opinv, **kwargs)

Development

Pixi

python-mumps recommends pixi.

After installing pixi, use

pixi run test -v  # (Pytest arguments go after test)

This will also install the necessary dependencies.

pre-commit

python-mumps uses pre-commit to enforce code style. After installing it, run

pre-commit install

or if you want to use pre-commit provided by pixi, run

pixi run pre-commit install

Metadata

Release files for python-mumps 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-mumps 0.0.6
File Size Uploaded Provenance Actions
python_mumps-0.0.6.tar.gz 58.3 kB Without provenance Details for python_mumps-0.0.6.tar.gz

Release files / python_mumps-0.0.6.tar.gz

Download URL python_mumps-0.0.6.tar.gz
Size 58.3 kB
Tags Source
SHA-256 checksum
How to use checksums
58c33104f77c448e127e9e6da316f71dfb1a17719ecf022634669d513306b1fa
BLAKE2b-256 checksum
How to use checksums
d372bc0e855f424877e54eb665b1c59e27146d56b37546b4acd49daff804a543
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Security for python-mumps 0.0.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page