A parallel Python-based library for analysis, model reduction and control of large-scale linear systems.
Project description
Resolvent4py
resolvent4py is a parallel Python toolbox to perform
analysis, model reduction and control of high-dimensional linear systems.
It relies on mpi4py for multi-processing parallelism, and it leverages
the functionalities and data structures provided by petsc4py and slepc4py.
The goal of this project is to provide users with a friendly python-like
experience, while also leveraging the high-performance and parallel-computing
capabilities of the PETSc and SLEPc libraries.
The core of the package is an abstract class, called LinearOperator, which
serves as a blueprint for user-defined child classes that can be used to
define any linear operator.
resolvent4py currently ships with 5 linear operator subclasses:
MatrixLinearOperatorLowRankLinearOperatorLowRankUpdatedLinearOperatorProjectionLinearOperatorProductLinearOperator
Once a linear operator is instantiated, resolvent4py currently allows for
several analyses, including:
- Right and left eigendecomposition using Arnoldi iteration (with shift and invert)
- (Randomized) singular value decomposition (SVD)
- Resolvent analysis via randomized SVD (algebraic and with time stepping)
- Harmonic resolvent analysis via algebraic randomized SVD
- Balanced truncation for time-invariant linear systems using frequential Gramians
Additional functionalities (found in resolvent4py/utils) and available
to the user through the resolvent4py namespace are:
- Support for parallel I/O through
petsc4py - Support for MPI communications using
mpi4py - Support for manipulation of PETSc matrices/vector and SLEPc BVs
Documentation
Click here.
Dependencies
Python>=3.10numpyscipymatplotlibmpi4pypetsc4py >= 3.20(must be installed from source, see below)slepc4py >= 3.20(must be installed from source, see below)
Installation instructions
Installing PETSc, SLEPc, petsc4py and slepc4py
Note
If you have an existing parallel build of PETSc and SLEPc and their 4py counterparts configured with complex scalars (i.e.,--with-scalar-type=complex) and with MUMPS (i.e.,--download-mumps) you can skip this subsection and go directly to "Installingresolvent4pyand building the documentation".
All the dependencies above can be installed straightforwardly with pip,
except for petsc4py and slepc4py whose installation is easier if
PETSc and SLEPc are built from source.
- We recommend creating a clean Python environment.
- Download PETSc. Any version >= 3.20.0 should work. (The latest version that we tested is 3.23.3.)
- Configure PETSc using the command below,
./configure PETSC_ARCH=resolvent4py_arch --download-fblaslapack --download-mumps --download-scalapack --download-parmetis --download-metis --download-ptscotch --with-scalar-type=complex --with-debugging=0 COPTFLAGS=-O3 CXXOPTFLAGS=-O3 FOPTFLAGS=-O3
If some of the libraries above (e.g.,scalapack,metis, etc.) are already available to the user, then see thePETScconfiguration guidelines for details on how to link against them. - Follow the
PETScinstructions (provided during the configuration step) to build the library. Then make sure to export the environment variablesPETSC_DIRandPETSC_ARCH. - Install SLEPc. Any version >= 3.20.0 should work. (The latest version that we tested was 3.23.1.)
- Install
mpi4py,petsc4pyandslepc4pypip install mpi4py petsc4py==petsc-version slepc4py==slepc-version
- Ensure that the installation was successful by running
python -c "from mpi4py import MPI" python -c "from petsc4py import PETSc" python -c "from slepc4py import SLEPc"
Installing resolvent4py
- Install
resolvent4pywithpip install resolvent4py
- Alternatively, clone the repository into the local directory
resolvent4py, navigate to it and runpip install resolvent4py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file resolvent4py-1.0.1.tar.gz.
File metadata
- Download URL: resolvent4py-1.0.1.tar.gz
- Upload date:
- Size: 34.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e654e0a38aa5fd4dc97f5ac48da3fc3de8847d84b8d57f8a3fde18d21a3c566f
|
|
| MD5 |
b484597cd87c22467c29faa3d5b8ef9e
|
|
| BLAKE2b-256 |
266a01af39775aa290afa2f69e5e59df5e9edb351bfd892a76f41d1ef9ceedd8
|
File details
Details for the file resolvent4py-1.0.1-py3-none-any.whl.
File metadata
- Download URL: resolvent4py-1.0.1-py3-none-any.whl
- Upload date:
- Size: 43.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
108b614c08f3099b1be49abf5fe4160d0ab096e008afa3102ce1f80b5777f5ce
|
|
| MD5 |
927d00e189dc2410a3e75c0784ca91c9
|
|
| BLAKE2b-256 |
912184720506510c96743071aaf4d63d1e60d489e0f682b846df494e50ab3af5
|