Skip to main content

Mpseudo Build Status

Mpseudo performs multicore and precise computation of pseudospectra of (square or rectangular) matricies. It uses pseudospectra definition and find epsilon-values on a regular grid of a complex plane. It uses multiprocessing module to share computations between cpu-cores, and mpmath module to make calculations with high precision.

Dependencies

Mpmath module is needed to perform computations with high precision.

pip install mpmath

If you don’t need ability of high precision pseudospectra computation (more than 15 digits), the mpseudo can work without mpmath. The only requirement - NumPy. It should be installed on your system or in virtual environment.

Installation

git clone https://github.com/scidam/mpseudo.git

Example

The pseudospectrum of the gallery(5) MatLab matrix looks like this (up to 100-digits of accuracy used for a matrix resolvent computation):

Pseudospectrum of gallery(5) MatLab matrix

Pseudospectrum of gallery(5) MatLab matrix

The pseudospectra above is obtained via the following lines of code:

from matplotlib import pyplot
from mpseudo import pseudo

# Gallery(5) MatLab matrix (exact eigenvalue is 0 (the only!))
A = [[-9, 11, -21, 63, -252],
     [70, -69, 141, -421, 1684],
     [-575, 575, -1149, 3451, -13801],
     [3891, -3891, 7782, -23345, 93365],
     [1024, -1024, 2048, -6144, 24572]]

# compute pseudospectrum in the bounding box [-0.05,0.05,-0.05,0.05] with
# resolution 100x100 (ncpu = 2 processes) and 50-digits precision.
psa, X, Y = pseudo(A, ncpu=2, digits=50, ppd=100, bbox=[-0.05,0.05,-0.05,0.05])

# show results
pyplot.conourf(X, Y, psa)
pyplot.show()

Note, if mpmath module is not installed, pseudospectrum of the matrix will be computed with standard (double, 15-digits) precision, which is not sufficient for this case.

Interesting, but Eigtool or PseudoPy tools (along with scipy eigvals function) applied to the matrix A in the example above lead to inaccurate results (due to insufficient (double) precision):

Pseudospectrum of gallery(5) MatLab matrix plotted via PseudoPy

Pseudospectrum of gallery(5) MatLab matrix plotted via PseudoPy

Read about this script in Russian here.

License

Mpseudo is free software licensed under the MIT License.

Metadata

Release files for mpseudo 0.1.4

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

Source distribution (sdist)

Source distribution for mpseudo 0.1.4
File Size Uploaded Provenance Actions
mpseudo-0.1.4.tar.gz 6.3 kB Without provenance Details for mpseudo-0.1.4.tar.gz

Release files / mpseudo-0.1.4.tar.gz

Download URL mpseudo-0.1.4.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
7b182104e400b6b2acc4fbbdbeafd7e499b5c962ffb513f607e2587ea2d54567
BLAKE2b-256 checksum
How to use checksums
9e9525ce4728dd6ddd1354fc200d998ef969c3d6013aaa1058541232a8e8cc1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for mpseudo 0.1.4

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.

Release history Release notifications | RSS feed

This release

0.1.4 This release

1 release file No provenance

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