From 3dd50925cbcd57ae566f3c5afca649f42afe7876 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Tue, 6 Aug 2024 18:52:02 +0200 Subject: [PATCH] fix: Cool down linter errors in emulator and qick --- src/qibolab/instruments/emulator/pulse_simulator.py | 10 +++++----- src/qibolab/instruments/rfsoc/driver.py | 6 ++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/qibolab/instruments/emulator/pulse_simulator.py b/src/qibolab/instruments/emulator/pulse_simulator.py index 9098fe582..28a04007b 100644 --- a/src/qibolab/instruments/emulator/pulse_simulator.py +++ b/src/qibolab/instruments/emulator/pulse_simulator.py @@ -258,10 +258,11 @@ def sweep( param_name = sweep.parameter.name.lower() for pulse, value in zip(sweep.pulses, base_sweeper_values): setattr(pulse, param_name, value) + # FIXME: this is copy-pasted from IcarusQ, check the comment in there # Since the sweeper will modify the readout pulse serial, we collate the results with the qubit number. # This is only for qibocal compatiability and will be removed with IcarusQ v2. - if pulse.type is PulseType.READOUT: - results[pulse.serial] = results[pulse.qubit] + # if pulse.type is PulseType.READOUT: + # results[pulse.serial] = results[pulse.qubit] results.update( { @@ -753,8 +754,7 @@ def truncate_ro_pulses( `qibolab.pulses.PulseSequence`: Modified pulse sequence with one time step readout pulses. """ sequence = copy.deepcopy(sequence) - for i in range(len(sequence)): - if sequence[i].type is PulseType.READOUT: - sequence[i].duration = 1 + for pulse in sequence.probe_pulses: + pulse.duration = 1 return sequence diff --git a/src/qibolab/instruments/rfsoc/driver.py b/src/qibolab/instruments/rfsoc/driver.py index 77dfade06..cc7adfa08 100644 --- a/src/qibolab/instruments/rfsoc/driver.py +++ b/src/qibolab/instruments/rfsoc/driver.py @@ -434,7 +434,7 @@ def get_if_python_sweep( A boolean value true if the sweeper must be executed by python loop, false otherwise """ - if any(pulse.type is PulseType.FLUX for pulse in sequence): + if any("flux" in ch for ch in sequence): return True for sweeper in sweepers: if all( @@ -453,7 +453,9 @@ def get_if_python_sweep( for sweep_idx, parameter in enumerate(sweeper.parameters): is_freq = parameter is rfsoc.Parameter.FREQUENCY - is_ro = sequence[sweeper.indexes[sweep_idx]].type == PulseType.READOUT + # FIXME: the sequence can not even be indexed like this any longer + # is_ro = sequence[sweeper.indexes[sweep_idx]].type == PulseType.READOUT + is_ro = False # if it's a sweep on the readout freq do a python sweep if is_freq and is_ro: return True