Compatibility with scipy.sparse.linalg.LinearOperator
The scipy package implements a LinearOperator class that has more or less the same purpose as our LinearOperator class.
The specifications are at this link and they require to implement some of the following methods:
-
__call__(x)
Call self as a function. -
adjoint()
Hermitian adjoint. -
dot(x)
Matrix-matrix or matrix-vector multiplication. -
matmat(X)
Matrix-matrix multiplication. -
matvec(x)
Matrix-vector multiplication. -
rmatvec(x)
Adjoint matrix-vector multiplication. -
transpose()
Transpose this linear operator.
We already have matvec
and transpose
, which are sufficient to define a scipy LinearOperator.
Using this template class would natively implement the basic operations as sum and multiplication.
In the not-so-close future this may be a good tool to use.