python-mepack (pyMEPACK)
Version: 1.1.2
Copyright 2023-2024 by Martin Köhler, MPI-Magdeburg
Description
Python Interface for MEPACK
- a Fortran software library for the solution of dense Sylvester-like matrix equations.
The pyMEPACK interfaces routines solving the following equations:
- Standard Lyapunov equations (
gelyap) $AX + XA^T = Y$ - Standard Stein (Discrete-Time Lyapunov) equations (
gestein)$AXA^T - X = Y$ - Generalized Lyapunov equations (
gglyap) $AXB^T + BXA^T = Y$ - Generalized Stein (Discrete-Time Lyapunov) Equation (
ggstein) $AXA^T - BXB^T = Y$ - Standard Sylvester equations (
gesylv) $AX + XB = Y$ - Discrete-time Sylvester equations (
gesylv2) $AXB + X = Y$ - Generalized Sylvester equations (
ggsylv) $AXB + CXD = Y$ - Generalized coupled Sylvester equations (
ggcsylv) $AR + LB = E, CR + LD = F$ - Dual generalized coupled Sylvester equations (
ggcsylv_dual) $AR + CL = E, RB + LD = F$
The library includes single and double precision solvers with iterative refinement for the above equations.
Dependencies
To install and run pyMEPACK the following components are required:
- MEPACK Version 1.1.1
- a BLAS and LAPACK implementation
- Python 3.7.0 +
- Cython 0.29.28 +
- numpy 1.20.3 +
- scipy 1.5.4 +
- setuptools 59.0.0 +
- configparser 5.2.0 +
- parameterized 0.8.0 + (only for tests)
- h5py 3.6.0 + (only for benchmarks)
- slycot 0.4.0 (only for benchmarks)
- Sphinx 5.0.2 + (for documentation)
Installation
pyMEPACK requires MEPACK to be installed on your system. See MEPACK's installation guide for detail (https://gitlab.mpi-magdeburg.mpg.de/software/mepack-release/-/blob/master/doc/install.md?ref_type=heads).
If MEPACK is not installed in a default location or the BLAS and LAPACK library
are not named blas and lapack the pymepack.cfg file can be used to setup
these differences. See pymepack.cfg-sample for details.
The installation of pyMEPACK is done by executing the following commands in the root directory of the project:
pip install .
or
pip install --user .
After a successful installation, pyMEPACK can be imported via import pymepack.
Documentation
Documentation of the pyMEPACK functions is accessible in the form of __doc__ strings.
HTML Documentation can be build with Sphinx inside the docs directory:
(cd ./docs && make html)
How to use pyMEPACK
The interface of pyMEPACK is very concise and easy to work with. The following code snippet solves a Lyapunov equation and computes the relative residual of the solution.
#!/usr/bin/env python3
import pymepack as pme
import numpy as np
import scipy as sp
n = 1000
# Prepare
A = np.triu(np.ones((n,n))) + np.diag(np.ones((n)))
X = np.ones((n,n))
Y = A @ X + X @ A.conj().T
# Solve
Xcomp, *_ = pme.gelyap(A, Y)
# Compute the residual
RelRes = pme.res_gelyap(A, Xcomp, Y)
print("Size = {:d} RelRes = {:e}".format(n, RelRes))
Testing
pyMEPACK contains a test suite. This is executed via
(cd /tmp && python3 -m unittest -v pymepack.tests)
The test suite cannot run from the root of source code after installation.
Test data
gelyap , gglyap , gestein and ggstein solvers, as well as their
respective versions with iterative refinement are tested on examples provided
in SLICOT benchmark collections, namely BB03AD and BB04AD [1,2].
All the Sylvester solvers are tested using randomization. We use numpy.random
module and supply the random generator with a seed to avoid build instability.
Last tested with numpy.version = 1.24.1. The non-symmetric stable matrices are
constructed as in the example 4.1 in [1].
Tuning and Benchmarks
See Benchmark and Tuning.
License
pyMEPACK, like MEPACK it self, is license under GPLv3.
Authors
- Martin Köhler, MPI Magdeburg
- Aleksey Maleyko, MPI Magdeburg
Citation
Martin Köhler. (2024). MEPACK: Matrix Equation PACKage (1.1.1). Zenodo. https://doi.org/10.5281/zenodo.10568848
References
[1] Benner, P., 2004. Factorized solution of Sylvester equations with applications in control. sign (H), 1, p.2.
[2] D. Kressner, V. Mehrmann, and T. Penzl. CTLEX - a Collection of Benchmark Examples for Continuous-Time Lyapunov Equations. SLICOT Working Note 1999-6, 1999.
[3] D. Kressner, V. Mehrmann, and T. Penzl. DTLEX - a Collection of Benchmark Examples for Discrete-Time Lyapunov Equations. SLICOT Working Note 1999-7, 1999.
Release files for pymepack 1.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pymepack-1.1.2.tar.gz | 861.7 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| pymepack-1.1.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.14 | CPython 3.14 | Linux glibc 2.17+ x86-64 | Details |
| pymepack-1.1.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.13 | CPython 3.13 | Linux glibc 2.17+ x86-64 | Details |
| pymepack-1.1.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.17+ x86-64 | Details |
| pymepack-1.1.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.17+ x86-64 | Details |
| pymepack-1.1.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.10 | CPython 3.10 | Linux glibc 2.17+ x86-64 | Details |
| pymepack-1.1.2-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.9 | CPython 3.9 | Linux glibc 2.17+ x86-64 | Details |
| pymepack-1.1.2-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.8 | CPython 3.8 | Linux glibc 2.17+ x86-64 | Details |
Total release size:127.7 MB
Release files / pymepack-1.1.2.tar.gz
| Download URL | pymepack-1.1.2.tar.gz |
|---|---|
| Size | 861.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
067edbb9b936a1458a09e2de3f54cace37013d0d98e27b5ec61e914d58238ba8
|
|
BLAKE2b-256 checksum How to use checksums |
34b12717d66bc04ca2d02f315b2b2b25f38e778d95cb0f2f5413f1a733c06849
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / pymepack-1.1.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | pymepack-1.1.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 18.1 MB |
| Tags | CPython 3.14 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
356db3c5ac438500d2b5fbda401520f92413c7c6670f65d27038731ed6717691
|
|
BLAKE2b-256 checksum How to use checksums |
7702b832cb3498d817f24caae1b3e08568000dbcd0d363380071a0618e245d46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / pymepack-1.1.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | pymepack-1.1.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 18.2 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
c3c22274e65ad2cd0d003cd97ee44ebf7b6849928e758e76a2368ac0f0b9e9b2
|
|
BLAKE2b-256 checksum How to use checksums |
432dff0829965b94422466dcbdf8fb8f8692e6dd15b2425158defb371a347870
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / pymepack-1.1.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | pymepack-1.1.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 18.2 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
daf4a75907b1f8db3778e04795190e6c805090670f63a2f9d166f4714ee1e129
|
|
BLAKE2b-256 checksum How to use checksums |
f2a25bf37ad6d16d18b77070cfaeea51b0c6c8e91bafb6f0a146d73b4923abe2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / pymepack-1.1.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | pymepack-1.1.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 18.3 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
6b5a18bcfb4aa1da4e85884f24113068366df48b7f5d742e109aa4f406a0c69c
|
|
BLAKE2b-256 checksum How to use checksums |
74d01ae30d2d42164b73cd271da7435d267a257e6edd0396483fd41ce72ab341
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / pymepack-1.1.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | pymepack-1.1.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 18.0 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
7d5f3f699779b4f8588b1dc69dd4d07402116f31c0ceae0ad476d7c739bcfa02
|
|
BLAKE2b-256 checksum How to use checksums |
464cf687e69a4d0016264be2d772faa9897bcc6aa2c3c86743e1fbd0ff3e4e67
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / pymepack-1.1.2-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | pymepack-1.1.2-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 17.9 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
b7e8b6ae3feebfa04968da040d96c4178d48d72394cef5e2284f1b486a811415
|
|
BLAKE2b-256 checksum How to use checksums |
49cef3ba656568775d5393be1b837c06fb10e367213e5a510903f60960770c04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / pymepack-1.1.2-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | pymepack-1.1.2-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 18.1 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
f3173fecf182e492e5b8d2368529bb0b01c922a97925e8a2cf3472ed85a65a32
|
|
BLAKE2b-256 checksum How to use checksums |
14390db659c2b00da089c011e40bdcacdcbb27ea52600fb04746d2214ccc85ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|