diff --git a/nifty4/operators/sandwich_operator.py b/nifty4/operators/sandwich_operator.py index 6dd77647d96edaeb05c42a833303047daa80939f..55d96d29f9f93d4bf99af667c438689798300f9e 100644 --- a/nifty4/operators/sandwich_operator.py +++ b/nifty4/operators/sandwich_operator.py @@ -76,6 +76,12 @@ class SandwichOperator(EndomorphicOperator): def draw_sample(self, from_inverse=False, dtype=np.float64): # Inverse samples from general sandwiches is not possible if from_inverse: + if self._bun.capabilities & self._bun.INVERSE_TIMES: + try: + s = self._cheese.draw_sample(from_inverse, dtype) + return self._bun.inverse_times(s) + except: + pass raise NotImplementedError( "cannot draw from inverse of this operator")