Skip to content

Commit

Permalink
Convert acquisitions to list
Browse files Browse the repository at this point in the history
  • Loading branch information
stavros11 committed Feb 20, 2024
1 parent 5f77a71 commit 12841b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/qibolab/instruments/qm/acquisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def declare_acquisitions(ro_pulses, qubits, options):
options containing acquisition type and averaging mode.
Returns:
Dictionary containing the different :class:`qibolab.instruments.qm.acquisition.Acquisition` objects.
List of all :class:`qibolab.instruments.qm.acquisition.Acquisition` objects.
"""
acquisitions = {}
for qmpulse in ro_pulses:
Expand All @@ -261,16 +261,16 @@ def declare_acquisitions(ro_pulses, qubits, options):
if options.acquisition_type is AcquisitionType.DISCRIMINATION:
kwargs["threshold"] = qubits[qubit].threshold
kwargs["angle"] = qubits[qubit].iq_angle

acquisition = ACQUISITION_TYPES[options.acquisition_type](
name, qubit, average, **kwargs
)

acquisition.assign_element(qmpulse.element)
acquisitions[name] = acquisition

acquisitions[name].keys.append(qmpulse.pulse.serial)
qmpulse.acquisition = acquisitions[name]
return acquisitions
return list(acquisitions.values())


def fetch_results(result, acquisitions):
Expand All @@ -286,7 +286,7 @@ def fetch_results(result, acquisitions):
handles = result.result_handles
handles.wait_for_all_values() # for async replace with ``handles.is_processing()``
results = {}
for acquisition in acquisitions.values():
for acquisition in acquisitions:
data = acquisition.fetch(handles)
for serial, result in zip(acquisition.keys, data):
results[acquisition.qubit] = results[serial] = result
Expand Down
2 changes: 1 addition & 1 deletion src/qibolab/instruments/qm/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def sweep(self, qubits, couplers, sequence, options, *sweepers):
)

with qua.stream_processing():
for acquisition in acquisitions.values():
for acquisition in acquisitions:
acquisition.download(*buffer_dims)

if self.script_file_name is not None:
Expand Down

0 comments on commit 12841b3

Please sign in to comment.