Skip to content

Commit

Permalink
Patch for triggers with CompoundGates
Browse files Browse the repository at this point in the history
General alignment of CompoundGates remains to be fixed
  • Loading branch information
Diego Ristè committed Apr 10, 2018
1 parent 0f80c7a commit 901dcbe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions QGL/PulseSequencer.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ def __neg__(self):
def __mul__(self, other):
""" Overload multiplication of Pulses as a "tensor" operator"""
if not np.isclose(self.length, other.length, atol=1e-10):
return align_p('center', self, other)
if self.length == 0 or other.length == 0:
return align_p('left', self, other)
else:
return align_p('center', self, other)
ptype = promote_type(self, other)
return self.promote(ptype) * other.promote(ptype)

Expand Down Expand Up @@ -355,7 +358,8 @@ def promote(self, ptype):

@property
def length(self):
return sum(p.length for p in self)
return self.seq[0].length #hack to support left-alignment e.g. for triggers). General alignment of CompoundGates not yet implemented
#sum(p.length for p in self.seq)

def promote_type(lhs, rhs):
'''
Expand Down

0 comments on commit 901dcbe

Please sign in to comment.