Skip to content

Commit

Permalink
fix: missing kind and conversions to str
Browse files Browse the repository at this point in the history
  • Loading branch information
stavros11 committed Aug 22, 2024
1 parent 2fffca7 commit 433a2c2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/qibolab/instruments/qm/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from qibolab.execution_parameters import ExecutionParameters
from qibolab.identifier import ChannelId
from qibolab.instruments.abstract import Controller
from qibolab.pulses.pulse import Acquisition, Delay, Pulse, VirtualZ, _Readout
from qibolab.pulses.pulse import Acquisition, Align, Delay, Pulse, _Readout
from qibolab.sequence import PulseSequence
from qibolab.sweeper import ParallelSweepers, Parameter, Sweeper
from qibolab.unrolling import Bounds
Expand Down Expand Up @@ -322,7 +322,7 @@ def register_pulses(self, configs: dict[str, Config], sequence: PulseSequence):
acquisitions (dict): Map from measurement instructions to acquisition objects.
"""
for channel_id, pulse in sequence:
if not isinstance(pulse, (Acquisition, Delay, VirtualZ)):
if isinstance(pulse, Pulse):
channel = self.channels[str(channel_id)].logical_channel
self.register_pulse(channel, pulse)

Expand All @@ -332,7 +332,7 @@ def register_duration_sweeper_pulses(
"""Register pulse with many different durations, in order to sweep
duration."""
for pulse in sweeper.pulses:
if isinstance(pulse, Delay):
if isinstance(pulse, (Align, Delay)):
continue

op = operation(pulse)
Expand Down
4 changes: 2 additions & 2 deletions src/qibolab/instruments/qm/program/instructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ def play(args: ExecutionArguments):
elif isinstance(pulse, VirtualZ):
qua.frame_rotation_2pi(normalize_phase(pulse.phase), element)
elif isinstance(pulse, Align) and pulse.id not in processed_aligns:
elements = args.sequence.pulse_channels(pulse.id)
qua.align(*elements)
channel_ids = args.sequence.pulse_channels(pulse.id)
qua.align(*(str(ch) for ch in channel_ids))
processed_aligns.add(pulse.id)

if args.relaxation_time > 0:
Expand Down
2 changes: 2 additions & 0 deletions src/qibolab/pulses/pulse.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ def id(self) -> int:
class Align(_PulseLike):
"""Brings different channels at the same point in time."""

kind: Literal["align"] = "align"


PulseLike = Annotated[
Union[Align, Pulse, Delay, VirtualZ, Acquisition, _Readout],
Expand Down

0 comments on commit 433a2c2

Please sign in to comment.