diff --git a/nifty6/operators/linear_operator.py b/nifty6/operators/linear_operator.py index 9d10390b1d0fa94318a593c0389d98a001618779..6be9bb4557e178666c820b20a8b85148225ca9af 100644 --- a/nifty6/operators/linear_operator.py +++ b/nifty6/operators/linear_operator.py @@ -175,7 +175,7 @@ class LinearOperator(Operator): from ..linearization import Linearization if isinstance(x, Linearization): return x.new(self(x._val), self(x._jac)) - return self.__matmul__(x) + return self@x def times(self, x): """Applies the Operator to a given Field. diff --git a/nifty6/operators/operator.py b/nifty6/operators/operator.py index 31b24772b9d7fc5eafd5acf41357b2d7eaaa132a..c731c4571bc533f504c8e474a9722e5201136c19 100644 --- a/nifty6/operators/operator.py +++ b/nifty6/operators/operator.py @@ -79,6 +79,11 @@ class Operator(metaclass=NiftyMeta): return NotImplemented return _OpChain.make((self, x)) + def __rmatmul__(self, x): + if not isinstance(x, Operator): + return NotImplemented + return _OpChain.make((x, self)) + def partial_insert(self, x): from ..multi_domain import MultiDomain if not isinstance(x, Operator):