Skip to content

Commit

Permalink
style: simplify loop over readout pulse in sweep
Browse files Browse the repository at this point in the history
  • Loading branch information
stavros11 committed Dec 5, 2023
1 parent f4ec356 commit adf8a73
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/qibolab/instruments/zhinst.py
Original file line number Diff line number Diff line change
Expand Up @@ -1062,15 +1062,15 @@ def sweep(self, qubits, couplers, sequence: PulseSequence, options, *sweepers):
for qubit in qubits.values():
q = qubit.name # pylint: disable=C0103
if len(self.sequence[f"readout{q}"]) != 0:
for i in range(len(self.sequence[f"readout{q}"])):
for i, ropulse in enumerate(self.sequence[f"readout{q}"]):
exp_res = self.results.get_data(f"sequence{q}_{i}")
# Reorder dimensions
data = np.moveaxis(exp_res, rearranging_axes[0], rearranging_axes[1])
if options.acquisition_type is AcquisitionType.DISCRIMINATION:
data = np.ones(data.shape) - data.real # Probability inversion patch

serial = self.sequence[f"readout{q}"][i].pulse.serial
qubit = self.sequence[f"readout{q}"][i].pulse.qubit
serial = ropulse.pulse.serial
qubit = ropulse.pulse.qubit
results[serial] = results[qubit] = options.results_type(data)

self.offsets_off()
Expand Down

0 comments on commit adf8a73

Please sign in to comment.