Commit 40996be6 authored by Philipp Arras's avatar Philipp Arras
Browse files

Make gradient of gaussian real

parent f460aea6
......@@ -61,7 +61,7 @@ class GaussianEnergy(Energy):
def gradient(self):
return self._inp.jacobian.adjoint_times(self._icovres)
return self._inp.jacobian.adjoint_times(self._icovres).real
......@@ -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
print('Warning: Assume real in PowerDistributor.')
x = x.real
return DOFDistributor.apply(self, x, mode)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment