diff --git a/pyerrors/input/hadrons.py b/pyerrors/input/hadrons.py index a9e220b9..509c0922 100644 --- a/pyerrors/input/hadrons.py +++ b/pyerrors/input/hadrons.py @@ -99,7 +99,6 @@ def read_ExternalLeg_hd5(path, filestem, ens_id, order='F'): file.close() corr_data = np.array(corr_data) - rolled_array = np.rollaxis(corr_data, 0, 5) matrix = np.empty((rolled_array.shape[:-1]), dtype=object) @@ -109,4 +108,4 @@ def read_ExternalLeg_hd5(path, filestem, ens_id, order='F'): matrix[si, sj, ci, cj] = CObs(real, imag) matrix[si, sj, ci, cj].gamma_method() - return Npr_matrix(matrix.swapaxes(1, 2).reshape((12,12), order=order), mom_in=mom) + return Npr_matrix(matrix.swapaxes(1, 2).reshape((12, 12), order=order), mom_in=mom) diff --git a/pyerrors/pyerrors.py b/pyerrors/pyerrors.py index 853809c6..fcc088bc 100644 --- a/pyerrors/pyerrors.py +++ b/pyerrors/pyerrors.py @@ -704,11 +704,11 @@ class CObs: derived_observable(lambda x, **kwargs: x[2] * x[1] + x[0] * x[3], [self.real, other.real, self.imag, other.imag], man_grad=[other.imag.value, self.imag.value, other.real.value, self.real.value])) - elif hasattr(other, 'real') and hasattr(other, 'imag'): + elif hasattr(other, 'real') and getattr(other, 'imag', 0) != 0: return CObs(self.real * other.real - self.imag * other.imag, self.imag * other.real + self.real * other.imag) else: - return CObs(self.real * other, self.imag * other) + return CObs(self.real * np.real(other), self.imag * np.real(other)) def __rmul__(self, other): return self * other