Skip to content

Commit

Permalink
fix: Cool down linter errors in emulator and qick
Browse files Browse the repository at this point in the history
  • Loading branch information
alecandido committed Aug 6, 2024
1 parent 323c6e3 commit 3dd5092
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/qibolab/instruments/emulator/pulse_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
{
Expand Down Expand Up @@ -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
6 changes: 4 additions & 2 deletions src/qibolab/instruments/rfsoc/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand 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
Expand Down

0 comments on commit 3dd5092

Please sign in to comment.