Skip to content

Commit

Permalink
[Feat] Also applied changes to rpow
Browse files Browse the repository at this point in the history
  • Loading branch information
fjosw committed Nov 20, 2024
1 parent c9f1667 commit d964d27
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pyerrors/obs.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,10 +861,7 @@ def __pow__(self, y):
return derived_observable(lambda x, **kwargs: x[0] ** y, [self], man_grad=[y * self.value ** (y - 1)])

def __rpow__(self, y):
if isinstance(y, Obs):
return derived_observable(lambda x: x[0] ** x[1], [y, self])
else:
return derived_observable(lambda x: y ** x[0], [self])
return derived_observable(lambda x, **kwargs: y ** x[0], [self], man_grad=[y ** self.value * np.log(y)])

def __abs__(self):
return derived_observable(lambda x: anp.abs(x[0]), [self])
Expand Down

0 comments on commit d964d27

Please sign in to comment.