Skip to content

Commit

Permalink
refactor: define supported sweepers as top level constant
Browse files Browse the repository at this point in the history
  • Loading branch information
sorewachigauyo committed Oct 22, 2024
1 parent 665b381 commit 9b5f6f8
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/qibolab/_core/instruments/keysight/sweep.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@
from qibolab._core.sweeper import ParallelSweepers, Parameter

NS_TO_S = 1e-9

SUPPORTED_CHANNEL_SWEEPERS = [
Parameter.frequency
]
SUPPORTED_PULSE_SWEEPERS = [
Parameter.amplitude,
Parameter.duration,
Parameter.relative_phase
]

def process_sweepers(
sweepers: list[ParallelSweepers], probe_channel_ids: set[ChannelId]
Expand Down Expand Up @@ -50,18 +57,14 @@ def process_sweepers(
name=f"V{idx}_{idx2}", value=sweeper.values[0], dtype=float
)

if sweeper.parameter is Parameter.frequency:
if sweeper.parameter in SUPPORTED_CHANNEL_SWEEPERS:
sweeper_channel_map.update(
{channel_id: qcs_variable for channel_id in sweeper.channels}
)
# Readout frequency is not supported with hardware sweeping
if not probe_channel_ids.isdisjoint(sweeper.channels):
hardware_sweeping = False
elif sweeper.parameter in [
Parameter.amplitude,
Parameter.duration,
Parameter.relative_phase,
]:
elif sweeper.parameter in SUPPORTED_PULSE_SWEEPERS:
# Duration is not supported with hardware sweeping
if sweeper.parameter is Parameter.duration:
hardware_sweeping = False
Expand Down

0 comments on commit 9b5f6f8

Please sign in to comment.