Skip to content

Commit

Permalink
fix: use pulse.id instead of hash in pulse parameters to avoid unwant…
Browse files Browse the repository at this point in the history
…ed duplications
  • Loading branch information
stavros11 committed Sep 17, 2024
1 parent 69457a2 commit b357789
Show file tree
Hide file tree
Showing 2 changed files with 5 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 @@ -27,7 +27,7 @@
from qibolab.sweeper import ParallelSweepers, Parameter, Sweeper
from qibolab.unrolling import Bounds, unroll_sequences

from .config import SAMPLING_RATE, Configuration, operation
from .config import SAMPLING_RATE, Configuration
from .program import ExecutionArguments, create_acquisition, program
from .program.sweepers import find_lo_frequencies, sweeper_amplitude

Expand Down Expand Up @@ -335,7 +335,7 @@ def register_duration_sweeper_pulses(
if isinstance(pulse, (Align, Delay)):
continue

params = args.parameters[operation(pulse)]
params = args.parameters[pulse.id]
ids = args.sequence.pulse_channels(pulse.id)
original_pulse = (
pulse if params.amplitude_pulse is None else params.amplitude_pulse
Expand All @@ -357,7 +357,7 @@ def register_amplitude_sweeper_pulses(
for pulse in sweeper.pulses:
sweep_pulse = pulse.model_copy(update={"amplitude": amplitude})
ids = args.sequence.pulse_channels(pulse.id)
params = args.parameters[operation(pulse)]
params = args.parameters[pulse.id]
params.amplitude_pulse = sweep_pulse
params.amplitude_op = self.register_pulse(ids[0], sweep_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 @@ -87,7 +87,7 @@ def play(args: ExecutionArguments):
for channel_id, pulse in args.sequence:
element = str(channel_id)
op = operation(pulse)
params = args.parameters[op]
params = args.parameters[pulse.id]
if isinstance(pulse, Delay):
_delay(pulse, element, params)
elif isinstance(pulse, Pulse):
Expand Down Expand Up @@ -153,7 +153,7 @@ def sweep(
method = SWEEPER_METHODS[sweeper.parameter]
if sweeper.pulses is not None:
for pulse in sweeper.pulses:
params = args.parameters[operation(pulse)]
params = args.parameters[pulse.id]
method(variable, params)
else:
for channel in sweeper.channels:
Expand Down

0 comments on commit b357789

Please sign in to comment.