pyMOR 2019.2 (December 16, 2019)¶
We are proud to announce the release of pyMOR 2019.2! For this release we have worked hard to make implementing new models and reduction algorithms with pyMOR even easier. Further highlights of this release are an extended VectorArray interface with generic support for complex numbers, vastly extended and improved system-theoretic MOR methods, as well as builtin support for model outputs and parameter sensitivities.
Over 700 single commits have entered this release. For a full list of changes see here.
pyMOR 2019.2 contains contributions by Linus Balicki, Dennis Eickhorn and Tim Keil. See here for more details.
Implement new models and reductors more easily¶
As many users have been struggling with the notion of
Discretization in pyMOR
and to account for the fact that not every full-order model needs to be a discretized
PDE model, we have decided to rename
ModelInterface and all deriving classes accordingly
[#568]. Consequently, the variable names
fom will now be found throughout pyMOR’s code to refer to an arbitrary
Model, a reduced-order
Model or a full-order
Moreover, following the Zen of Python’s
‘Explicit is better than implicit’ and ‘Simple is better than complex’, we have
completely revamped the implementation of
to facilitate the implementation of new model types and reduction methods
[#592]. In particular, the complicated
and error-prone approach of trying to automatically correctly project the
of any given
GenericPGReductor has been replaced
Model-adapted reductors which explicitly state with which bases each
Operator shall be projected. As a consequence, we could remove the
and the notion of
vastly simplifying its implementation and the definition of new
Extended VectorArray interface with generic complex number support¶
VectorArrayInterface has been extended to
allow the creation of non-zero vectors using the
[#612]. Vectors with random values can
be created using the
method [#618]. All
implementations shipped with pyMOR support these new interface methods.
As an important step to improve the support for system-theoretic MOR methods with
external PDE solvers, we have implemented facilities to provide generic support
VectorArrays even for PDE solvers that do not support complex
vectors natively [#755].
Improved and extended support for system-theoretic MOR methods¶
To increase compatibility between input-output models in
iosys and the
InstationaryModel, support for models with
parametric operators has been added
[#626], which also enables
implementation of parametric MOR methods for such models.
state_space attribute was removed in favor of
solution_space [#648] to make
more explicit the result of the
Further improvements in naming has been renaming attributes
[#578] and the
bode method to
numerous improvements ([#656],
[#807]) and variants of one-sided
IRKA have been added [#579].
As for Lyapunov equations, a low-rank solver for Riccati equations has been
Model outputs and parameter sensitivities¶
The notion of a
Model’s output has been formally added to the
The output of a
Model is defined to be a
VectorArray of the model’s
can be computed using the new
solve method can
now be called with
return_output=True to return the output alongside the state space
To compute parameter sensitivities, we have added
d_mu methods to
which return the partial derivative with respect to a given parameter component
Additional new features¶
Extended FEniCS bindings¶
FEniCS support has been improved by adding support for nonlinear
an implementation of
to enable fast local evaluation of the operator for efficient
[#819]. Moreover the parallel implementations
dofs have been fixed
solver_options are now correctly
Improved greedy algorithms¶
pyMOR’s greedy algorithms have been refactored into
adaptive_weak_greedy functions that
use a common
WeakGreedySurrogate to estimate
the approximation error and extend the greedy bases. This allows these functions to be
used more flexible, e.g. for goal-oriented basis generation, by implementing a new
Numerical linear algebra algorithms¶
algorithm can now also be used to compute a QR decomposition of a given
gram_schmidt can be used as a more accurate
(but often more expensive) alternative for computing the
VectorArray. Both, the older method-of-snapshots approach as well as the QR decomposition
are now available for computing a truncated SVD of a
VectorArray via the newly added
svd_va module [#718].
Basic randomized algorithms for approximating the image of a linear
implemented in the
Support for low-rank operators¶
Operators and as well as sums of arbitrary
Operators with a low-rank
Operator can now be represented by
LowRankUpdatedOperator. For the latter,
apply_inverse_adjoint are implemented
via the Sherman-Morrison-Woodbury formula [#743].
Improved string representations of pyMOR objects¶
__str__ special methods have been implemented for all
Model classes shipped with
pyMOR [#652]. Moreover, we have added a generic
__repr__ implementation to
BasicInterface which recursively prints all class attributes
corresponding to an
__init__ argument (with a non-default value)
Easier working with immutable objects¶
A new check in
ImmutableMeta enforces all
immutable object to be available as object attributes, thus ensuring that
~pymor.core.interfaces.ImmutableInterface.with_ works reliably with all
in pyMOR [#694]. To facilitate the initialization
of these attributes in
method has been added to
~pymor.core.interfaces.ImmutableInterface.with_ now has a
which allows to change the class of the object returned by it
project and assemble_lincomb are easier to extend¶
In pyMOR 0.5, we have introduced
RuleTables to make central algorithms in
pyMOR, like the projection of an
project, easier to trace and
For pyMOR 2019.2, we have further simplified
project by removing the
argument from the underlying
As the inheritance-based implementation of
assemble_lincomb was showing similar
complexity issues as the old inheritance-based implementation of
moved all backend-agnostic logic into the
RuleTable-based free function
assemble_lincomb, leaving the remaining backend
Improvements to pyMOR’s discretization toolbox¶
pyMOR’s builtin discretization toolbox as seen multiple minor improvements:
Backward incompatible changes¶
Dropped Python 3.5 support¶
As Python 3.6 or newer now ships with the current versions of all major Linux distributions, we have decided to drop support for Python 3.6 in pyMOR 2019.2. This allows us to benefit from new language features, in particular f-strings and class attribute definition order preservation [#553], [#584].
pyMOR now has a (mutable) global default
RandomState. This means
sample_randomly is called
repeatedly without specifying a
seed argument, different
samples will be returned in contrast to the (surprising) previous behavior where the
same samples would have been returned. The same
used by the newly introduced
method of the
Space id handling¶
Further notable improvements¶
pyMOR 0.5 (January 17, 2019)¶
After more than two years of development, we are proud to announce the release
of pyMOR 0.5! Highlights of this release are support for Python 3, bindings for
the NGSolve finite element library, new linear algebra algorithms, various
VectorArray usability improvements, as well as a redesign of pyMOR’s
projection algorithms based on
Especially we would like to highlight the addition of various system-theoretic
reduction methods such as Balanced Truncation or IRKA. All algorithms are
implemented in terms of pyMOR’s
allowing their application to any model implemented using one of the PDE solver
supported by pyMOR. In particular, no import of the system matrices is
Over 1,500 single commits have entered this release. For a full list of changes see here.
pyMOR 0.5 contains contributions by Linus Balicki, Julia Brunken and Christoph Lehrenfeld. See here for more details.
Python 3 support¶
pyMOR is now compatible with Python 3.5 or greater. Since the use of Python 3 is
now standard in the scientific computing community and security updates for
Python 2 will stop in less than a year (https://pythonclock.org), we decided to
no longer support Python 2 and make pyMOR 0.5 a Python 3-only release. Switching
to Python 3 also allows us to leverage newer language features such as the
binary operator for concatenation of
Operators, keyword-only arguments or
improved support for asynchronous programming.
System-theoretic MOR methods¶
With 386 commits, [#464] added
systems-theoretic methods to pyMOR. Module
contains new discretization classes for input-output systems, e.g.
TransferFunction. At present, methods related to these
classes mainly focus on continuous-time, non-parametric systems.
Since matrix equation solvers are important tools in many system-theoretic
methods, support for Lyapunov, Riccati and Sylvester equations has been added in
pymor.algorithms.sylvester. A generic low-rank ADI (Alternating Direction
Implicit) solver for Lyapunov equations is implemented in
pymor.algorithms.lradi. Furthermore, bindings to low-rank and dense
solvers for Lyapunov and Riccati equations from
Py-M.E.S.S. are provided in
pymor.bindings.pymess. A generic Schur decomposition-based solver for
sparse-dense Sylvester equations is implemented in
Balancing Truncation (BT) and Iterative Rational Krylov Algorithm (IRKA) are
IRKAReductor. LQG and Bounded Real variants of BT
are also available (
BRBTReductor). Bitangential Hermite interpolation
(used in IRKA) is implemented in
LTI_BHIReductor. Two-Sided Iteration
Algorithm (TSIA), a method related to IRKA, is implemented in
Several structure-preserving MOR methods for second-order systems have been
implemented. Balancing-based MOR methods are implemented in
pymor.reductors.sobt, bitangential Hermite interpolation in
SO_BHIReductor and Second-Order Reduced
IRKA (SOR-IRKA) in
For more general transfer functions, MOR methods which return
also available. Bitangential Hermite interpolation is implemented in
TFInterpReductor and Transfer Function
IRKA (TF-IRKA) in
Usage examples can be found in the
string_equation demo scripts.
We now ship bindings for the NGSolve finite element
library. Wrapper classes for
VectorArrays and matrix-based
Operators can be
found in the
pymor.bindings.ngsolve module. A usage example can be found
thermalblock_simple demo script.
New linear algebra algorithms¶
pyMOR now includes an implementation of the
HAPOD algorithm for fast distributed
or incremental computation of the Proper Orthogonal Decomposition
pymor.algorithms.hapod). The code allows for arbitrary sub-POD trees,
on-the-fly snapshot generation and shared memory parallelization via
concurrent.futures. A basic usage example can be found in the
In addition, the Gram-Schmidt biorthogonalization algorithm has been included in
VectorArrays in pyMOR have undergone several usability improvements:
The somewhat dubious concept of a
subtypehas been superseded by the concept of
VectorSpaceswhich act as factories for
VectorArrays. In particular, instead of a
VectorSpacescan now hold meaningful attributes (e.g. the dimension) which are required to construct
VectorArrayscontained in the space. The
idattribute allows to differentiate between technically identical but mathematically different spaces [#323].
VectorArrayscan now be indexed to select a subset of vectors to operate on. In contrast to advanced indexing in
NumPy, indexing a
VectorArraywill always return a view onto the original array data [#299].
Inner products between
VectorArraysw.r.t. to a given inner product
Operatoror their norm w.r.t. such an operator can now easily be computed by passing the
Operatoras the optional
productargument to the new
norm2have been introduced to compute the squared vector norms [#237].
RuleTable based algorithms¶
In pyMOR 0.5, projection algorithms are implemented via recursively applied
tables of transformation rules. This replaces the previous inheritance-based
approach. In particular, the
projected method to perform a (Petrov-)Galerkin
projection of an arbitrary
Operator has been removed and replaced by a free
project function. Rule-based algorithms are implemented by deriving from the
RuleTable base class [#367],
This approach has several advantages:
The entire mathematical algorithm can be specified in a single file even when the definition of the possible classes the algorithm can be applied to is scattered over various files.
The precedence of rules is directly apparent from the definition of the
Users can implement or modify
RuleTableswithout modification of the classes shipped with pyMOR.
Additional new features¶
Reduction algorithms are now implemented using mutable reductor objects, e.g.
GenericRBReductor, which store and
extendthe reduced bases onto which the model is projected. The only return value of the reductor’s
reducemethod is now the reduced discretization. Instead of a separate reconstructor, the reductor’s
reconstructmethod can be used to reconstruct a high-dimensional state-space representation. Additional reduction data (e.g. used to speed up repeated reductions in greedy algorithms) is now managed by the reductor [#375].
The handling of complex numbers in pyMOR is now more consistent. See [#458], [#362], [#447] for details. As a consequence of these changes, the
StationaryDiscretizationis now a vector-like
Operatorinstead of a functional.
The analytical problems and discretizers of pyMOR’s discretization toolbox have been reorganized and improved. All problems are now implemented as instances of
InstationaryProblem, which allows an easy exchange of data
Functionsof a predefined problem with user-defined
Functions. Affine decomposition of
Functionsis now represented by specifying a
LincombFunctionas the respective data function [#312], [#316], [#318], [#337].
A compiler toolchain is no longer necessary to install pyMOR as we are now distributing binary wheels for releases through the Python Package Index (PyPI). Using the
extras_requiremechanism the user can select to install either a minimal set:
pip install pymor
or almost all, including optional, dependencies:
pip install pymor[full]
A docker image containing all of the discretization packages pyMOR has bindings to is available for demonstration and development purposes:
docker run -it pymor/demo:0.5 pymor-demo -h docker run -it pymor/demo:0.5 pymor-demo thermalblock --fenics 2 2 5 5
Backward incompatible changes¶
dim_outerhas been removed from the grid interface [#277].
All wrapper code for interfacing with external PDE libraries or equation solvers has been moved to the
pymor.bindingspackage. For instance,
FenicsMatrixOperatorcan now be found in the
ei_discretizationhave been replaced by
ei_dthroughout pyMOR [#416].
NumpyMatrixOperatorhas been renamed to
NumPy arraythis array is automatically made read-only to prevent accidental modification of the
BoundaryTypeclass has been removed in favor of simple strings [#305].
The complicated and unused mapping of local parameter component names to global names has been removed [#306].
Further notable improvements¶
pyMOR 0.4 (September 28, 2016)¶
With the pyMOR 0.4 release we have changed the copyright of pyMOR to
Copyright 2013-2016 pyMOR developers and contributors. All rights reserved.
Moreover, we have added a Contribution guideline to help new users with starting to contribute to pyMOR. Over 800 single commits have entered this release. For a full list of changes see here. pyMOR 0.4 contains contributions by Andreas Buhr, Michael Laier, Falk Meyer, Petar Mlinarić and Michael Schaefer. See here for more details.
FEniCS and deal.II support¶
pyMOR now includes wrapper classes for integrating PDE solvers
written with the
dolfin library of the FEniCS
project. For a usage example, see
Experimental support for deal.II can be
found in the pymor-deal.II
repository of the pyMOR GitHub organization.
Parallelization of pyMOR’s reduction algorithms¶
We have added a parallelization framework to pyMOR which allows
parallel execution of reduction algorithms based on a simple
WorkerPool interface [#14].
ei_greedy algorithms [#162]
have been refactored to utilize this interface.
WorkerPool implementations are shipped with pyMOR:
IPythonPool utilizes the parallel
computing features of IPython, allowing
parallel algorithm execution in large heterogeneous clusters of
MPIPool can be used
to benefit from existing MPI-based parallel HPC computing architectures
Support classes for MPI distributed external PDE solvers¶
interfaces are agnostic to the concrete (parallel) implementation
of the corresponding objects in the PDE solver, external solvers
are often integrated by creating wrapper classes directly corresponding
to the solvers data structures. However, when the solver is executed
in an MPI distributed context, these wrapper classes will then only
correspond to the rank-local data of a distributed
To facilitate the integration of MPI parallel solvers, we have added
MPI helper classes [#163]
pymor.discretizations.mpi that allow an automatic
wrapping of existing sequential bindings for MPI distributed use.
These wrapper classes are based on a simple event loop provided
pymor.tools.mpi, which is used in the interface methods of
the wrapper classes to dispatch into MPI distributed execution
of the corresponding methods on the underlying MPI distributed
The resulting objects can be used on MPI rank 0 (including interactive
Python sessions) without any further changes to pyMOR or the user code.
For an example, see
New reduction algorithms¶
reduce_parabolicreduces linear parabolic problems using
reduce_generic_rband assembles an error estimator similar to [GP05], [HO08]. The
parabolic_mordemo contains a simple sample application using this reductor [#190].
estimate_image_hierarchicalalgorithms can be used to find an as small as possible space in which the images of a given list of operators for a given source space are contained for all possible parameters
mu. For possible applications, see
reduce_residualwhich now uses
estimate_image_hierarchicalfor Petrov-Galerkin projection of the residual operator [#223].
Copy-on-write semantics for
VectorArray interface is now assumed to have copy-on-write
semantics. I.e., the returned
VectorArray will contain a reference to the same
data as the original array, and the actual data will only be copied when one of
the arrays is changed. Both
ListVectorArray have been
updated accordingly [#55].
As a main benefit of this approach,
immutable objects having a
an attribute now can safely create copies of the passed
VectorArrays (to ensure
the immutability of their state) without having to worry about unnecessarily
increased memory consumption.
Improvements to pyMOR’s discretizaion tookit¶
An unstructured triangular
Gridis now provided by
UnstructuredTriangleGrid. Such a
Gridcan be obtained using the
discretize_gmshmethod, which can parse Gmsh output files. Moreover, this method can generate
Gmshinput files to create unstructured meshes for an arbitrary
Basic support for parabolic problems has been added. The
discretize_parabolic_fvmethods can be used to build continuous finite element or finite volume
Discretizationsfrom a given
parabolicdemo demonstrates the use of these methods [#189].
pymor.discretizers.diskmodule contains methods to create stationary and instationary affinely decomposed
Discretizationsfrom matrix data files and an
.inifile defining the given problem.
EllipticProblemscan now also contain advection and reaction terms in addition to the diffusion part.
discretize_elliptic_cghas been extended accordingly [#211].
continuous Galerkinmodule has been extended to support Robin boundary conditions [#110].
For the visualization of time-dependent data, the colorbars can now be rescaled with each new frame [#91].
state idgeneration is now based on deterministic pickling. In previous version of pyMOR, the
immutableobjects was computed from the state ids of the parameters passed to the object’s
__init__method. This approach was complicated and error-prone. Instead, we now compute the
state idas a hash of a deterministic serialization of the object’s state. While this approach is more robust, it is also slightly more expensive. However, due to the object’s immutability, the
state idonly has to be computed once, and state ids are now only required for storing results in persistent cache regions (see below). Computing such results will usually be much more expensive than the
state idcalculation [#106].
CacheRegionsnow have a
persistentattribute indicating whether the cache data will be kept between program runs. For persistent cache regions the
state idof the object for which the cached method is called has to be computed to obtain a unique persistent id for the given object. For non-persistent regions the object’s
~pymor.core.interfaces.BasicInterface.uidcan be used instead.
pymor.core.cache_regionsnow by default contains
'persistent'cache regions [#182], [#121] .
defaultscan now be marked to not affect
state idcomputation. In previous version of pyMOR, changing any
defaultvalue caused a change of the
state idpyMOR’s defaults dictionary, leading to cache misses. While this in general is desirable, as, for instance, changed linear solver default error tolerances might lead to different solutions for the same
Discretizationobject, it is clear for many I/O related defaults, that these will not affect the outcome of any computation. For these defaults, the
defaultsdecorator now accepts a
sid_ignoreparameter, to exclude these defaults from
state idcomputation, preventing changes of these defaults causing cache misses [#81].
As an alternative to using the
cached_method_callcan be used to cache the results of a function call. This is now used in
solveto enable parsing of the input parameter before it enters the cache key calculation [#231].
Additional new features¶
NumpyListVectorArrayMatrixOperatorwhich can apply
SciPymatrices to a
Operatoris mainly intended for performance testing purposes. The
thermalblockdemo now has an option
--list-vector-arrayfor using this operator instead of
- Log indentation support [#230].
pyMOR’s log output can now be indented via the
logger.block(msg)context manger to reflect the hierarchy of subalgorithms.
- Default implementation of
as_vectorfor functionals [#107].
OperatorBase.as_vectornow contains a default implementation for functionals by calling
- Default implementation of
pycontractshas been removed as a dependency of pyMOR [#127].
Test coverage has been raised to 80 percent.
Backward incompatible changes¶
dotmethod of the
VectorArrayinterface has been split into
dothas been removed, always assuming
pairwise == False. The method
pairwise_dotcorresponds to the
pairwise == Truecase. Similarly the
pariwiseparameter of the
apply2method of the
Operatorinterface has been removed and a
pairwise_apply2method has been added.
- Removal of the
apply_inversein favor of
OperatorInterface.apply_inversehas been replaced by the
solver_optionsattribute. This attribute controls which fixed (linear) solver options are used when
apply_inverseis called. See here for more details.
- Removal of the
- Renaming of reductors for coercive problems [#224].
pymor.reductors.stationary.reduce_stationary_coercivehave been renamed to
pymor.reductors.coercive.reduce_coercive_simple. The old names are deprecated and will be removed in pyMOR 0.5.
Non-parametric objects have now
- Caching of
solveis now disabled by default [#178].
solvemust now be explicitly enabled by using
- Caching of
- Changes to
The default for the
projectionparameter has been changed from
'ei'to let the default algorithm agree with literature. In addition a
copyparameter with default
Truehas been added. When
True, the input data is copied before executing the algorithm, ensuring, that the original
VectorArrayis left unchanged. When possible,
copyshould be set to
Falsein order to reduce memory consumption.
- Changes to
with_has been moved from
BasicInterface.add_attributeshas been removed [#158].
- Auto-generated names no longer contain the
~pymor.core.interfaces.BasicInterface.nameof pyMOR objects no longer contains their
~pymor.core.interfaces.BasicInterface.uid. Instead, the name is now simply set to the class name.
- Auto-generated names no longer contain the
- Python fallbacks to Cython functions have been removed [#145].
In order to use pyMOR’s discretization toolkit, building of the
relationsCython extension modules is now required.
pyMOR 0.3 (March 2, 2015)¶
Introduction of the vector space concept for even simpler integration with external solvers.
Addition of a generic Newton algorithm.
Support for Jacobian evaluation of empirically interpolated operators.
Greatly improved performance of the EI-Greedy algorithm. Addition of the DEIM algorithm.
A new algorithm for residual operator projection and a new, numerically stable a posteriori error estimator for stationary coercive problems based on this algorithm. (cf. A. Buhr, C. Engwer, M. Ohlberger, S. Rave, ‘A numerically stable a posteriori error estimator for reduced basis approximations of elliptic equations’, proceedings of WCCM 2014, Barcelona, 2014.)
A new, easy to use mechanism for setting and accessing default values.
Serialization via the pickle module is now possible for each class in pyMOR. (See the new ‘analyze_pickle’ demo.)
Addition of generic iterative linear solvers which can be used in conjunction with any operator satisfying pyMOR’s operator interface. Support for least squares solvers and PyAMG (http://www.pyamg.org/).
An improved SQLite-based cache backend.
Improvements to the built-in discretizations: support for bilinear finite elements and addition of a finite volume diffusion operator.
Test coverage has been raised from 46% to 75%.
Over 500 single commits have entered this release. A full list of all changes can be obtained under the following address: https://github.com/pymor/pymor/compare/0.2.2…0.3.0