Skip to content

Commit

Permalink
Default alignment for pulses
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Ristè committed Mar 26, 2018
1 parent 8db8fe1 commit 046bb29
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion QGL/PulseSequencer.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ def __neg__(self):

def __mul__(self, other):
""" Overload multiplication of Pulses as a "tensor" operator"""
if not np.isclose(self.length, other.length):
return align_p('center', self, other)
ptype = promote_type(self, other)
return self.promote(ptype) * other.promote(ptype)

Expand Down Expand Up @@ -220,7 +222,7 @@ def __mul__(self, rhs):
else:
result.pulses[k] = v
result.length = max(self.length, rhs.length)
return align('center', result)
return result

def __eq__(self, other):
if isinstance(other, self.__class__):
Expand Down

0 comments on commit 046bb29

Please sign in to comment.