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 23, 2024
1 parent 665b381 commit 11ba3cb
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/qibolab/_core/instruments/keysight/sweep.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
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(
Expand Down Expand Up @@ -50,18 +56,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 11ba3cb

Please sign in to comment.