diff --git a/nifty5/operators/operator.py b/nifty5/operators/operator.py index dbc8cd38761bfb98875b04433b7b2527707ec0d1..efcd926d5391b07b4c96b166fa9f98fe554002a0 100644 --- a/nifty5/operators/operator.py +++ b/nifty5/operators/operator.py @@ -57,6 +57,11 @@ class Operator(NiftyMetaBase()): return NotImplemented return _OpSum(self, x) + def __sub__(self, x): + if not isinstance(x, Operator): + return NotImplemented + return _OpSum(self, -x) + def __pow__(self, power): if not np.isscalar(power): return NotImplemented