diff --git a/nifty5/library/gaussian_energy.py b/nifty5/library/gaussian_energy.py index 8fb32e54c2fee8dcd877f4788d10891491a81b31..3c9b4ac609ace47069a0dcd1085e4beaad007979 100644 --- a/nifty5/library/gaussian_energy.py +++ b/nifty5/library/gaussian_energy.py @@ -61,7 +61,7 @@ class GaussianEnergy(Energy): @property @memo def gradient(self): - return self._inp.jacobian.adjoint_times(self._icovres) + return self._inp.jacobian.adjoint_times(self._icovres).real @property @memo diff --git a/nifty5/operators/power_distributor.py b/nifty5/operators/power_distributor.py index ad5014826cdaff0848b100077cd6eb4684deb4dc..68f4a8b7f79f6c3992e32d06f39b6541380d19af 100644 --- a/nifty5/operators/power_distributor.py +++ b/nifty5/operators/power_distributor.py @@ -62,10 +62,4 @@ class PowerDistributor(DOFDistributor): def apply(self, x, mode): self._check_input(x, mode) - if x.dtype == np.complex: - if x.imag.sum() == 0: - x = x.real - else: - print('Warning: Assume real in PowerDistributor.') - x = x.real return DOFDistributor.apply(self, x, mode)