Skip to content

Commit

Permalink
Add __radd__ method to ParameterExpression class
Browse files Browse the repository at this point in the history
  • Loading branch information
YuChenSSR committed Mar 25, 2024
1 parent 9f63dd6 commit 56bc781
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions quafu/elements/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ def __add__(self, r):

return ParameterExpression(self.pivot, v, operands, funcs)

def __radd__(self, r):
return self + r

def __mul__(self, r):
operands = [opr for opr in self.operands]
funcs = copy.deepcopy(self.funcs)
Expand Down

0 comments on commit 56bc781

Please sign in to comment.