Skip to content

Commit

Permalink
fix: PulseSequence.channel_duration when Align is present
Browse files Browse the repository at this point in the history
  • Loading branch information
stavros11 committed Aug 22, 2024
1 parent d817531 commit 7a645af
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/qibolab/sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@ def channel(self, channel: ChannelId) -> Iterable[PulseLike]:

def channel_duration(self, channel: ChannelId) -> float:
"""Duration of the given channel."""
return sum(pulse.duration for pulse in self.channel(channel))
sequence = self
for _, pulse in self:
if isinstance(pulse, Align):
sequence = self.align_to_delays()
break
return sum(pulse.duration for pulse in sequence.channel(channel))

def pulse_channels(self, pulse_id: int) -> list[ChannelId]:
"""Find channels on which a pulse with a given id plays."""
Expand Down

0 comments on commit 7a645af

Please sign in to comment.