From 046bb2970bc4ea2527ab30d9621f7166a909a9a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Rist=C3=A8?= Date: Mon, 26 Mar 2018 17:50:10 -0400 Subject: [PATCH] Default alignment for pulses --- QGL/PulseSequencer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/QGL/PulseSequencer.py b/QGL/PulseSequencer.py index 22a0f8d5..8bada3d8 100644 --- a/QGL/PulseSequencer.py +++ b/QGL/PulseSequencer.py @@ -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) @@ -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__):