From 0ec0c6009392d9ff824bf8eeb249e1a1fe4cd70e Mon Sep 17 00:00:00 2001 From: Stavros Efthymiou <35475381+stavros11@users.noreply.github.com> Date: Tue, 6 Aug 2024 23:57:08 +0400 Subject: [PATCH] chore: update rabi amplitude --- src/qibocal/protocols/rabi/amplitude.py | 9 +++++---- src/qibocal/protocols/rabi/amplitude_signal.py | 13 +++++++------ src/qibocal/protocols/rabi/utils.py | 12 ++++++------ 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/qibocal/protocols/rabi/amplitude.py b/src/qibocal/protocols/rabi/amplitude.py index 2ab378bfe..a663d6173 100644 --- a/src/qibocal/protocols/rabi/amplitude.py +++ b/src/qibocal/protocols/rabi/amplitude.py @@ -5,6 +5,7 @@ from qibolab import AcquisitionType, AveragingMode, ExecutionParameters from qibolab.platform import Platform from qibolab.qubits import QubitId +from qibolab.result import probability from qibolab.sweeper import Parameter, Sweeper, SweeperType from qibocal import update @@ -73,18 +74,18 @@ def _acquisition( data = RabiAmplitudeData(durations=durations) # sweep the parameter - results = platform.sweep( - sequence, + results = platform.execute( + [sequence], ExecutionParameters( nshots=params.nshots, relaxation_time=params.relaxation_time, acquisition_type=AcquisitionType.DISCRIMINATION, averaging_mode=AveragingMode.SINGLESHOT, ), - sweeper, + [[sweeper]], ) for qubit in targets: - prob = results[ro_pulses[qubit].id].probability(state=1) + prob = probability(results[ro_pulses[qubit].id][0], state=1) data.register_qubit( RabiAmpType, (qubit), diff --git a/src/qibocal/protocols/rabi/amplitude_signal.py b/src/qibocal/protocols/rabi/amplitude_signal.py index bd2fd6309..7ab02f6ba 100644 --- a/src/qibocal/protocols/rabi/amplitude_signal.py +++ b/src/qibocal/protocols/rabi/amplitude_signal.py @@ -6,6 +6,7 @@ from qibolab import AcquisitionType, AveragingMode, ExecutionParameters from qibolab.platform import Platform from qibolab.qubits import QubitId +from qibolab.result import magnitude, phase from qibolab.sweeper import Parameter, Sweeper, SweeperType from qibocal import update @@ -89,25 +90,25 @@ def _acquisition( data = RabiAmplitudeSignalData(durations=durations) # sweep the parameter - results = platform.sweep( - sequence, + results = platform.execute( + [sequence], ExecutionParameters( nshots=params.nshots, relaxation_time=params.relaxation_time, acquisition_type=AcquisitionType.INTEGRATION, averaging_mode=AveragingMode.CYCLIC, ), - sweeper, + [[sweeper]], ) for qubit in targets: - result = results[ro_pulses[qubit].id] + result = results[ro_pulses[qubit].id][0] data.register_qubit( RabiAmpSignalType, (qubit), dict( amp=qd_pulses[qubit].amplitude * qd_pulse_amplitude_range, - signal=result.magnitude, - phase=result.phase, + signal=magnitude(result), + phase=phase(result), ), ) return data diff --git a/src/qibocal/protocols/rabi/utils.py b/src/qibocal/protocols/rabi/utils.py index 4ee30845d..c2053c6d9 100644 --- a/src/qibocal/protocols/rabi/utils.py +++ b/src/qibocal/protocols/rabi/utils.py @@ -241,11 +241,11 @@ def sequence_amplitude( qd_pulses[q].duration = params.pulse_length durations[q] = qd_pulses[q].duration - ro_pulses[q] = ro_sequence[qubit.measure.name][0] + ro_pulses[q] = ro_sequence[qubit.probe.name][0] sequence[qubit.drive.name].append(qd_pulses[q]) - sequence[qubit.measure.name].append(Delay(duration=durations[q])) - sequence[qubit.measure.name].append(ro_pulses[q]) + sequence[qubit.probe.name].append(Delay(duration=durations[q])) + sequence[qubit.probe.name].append(ro_pulses[q]) return sequence, qd_pulses, ro_pulses, durations @@ -269,11 +269,11 @@ def sequence_length( amplitudes[q] = qd_pulses[q].amplitude delays[q] = Delay(duration=16) - ro_pulses[q] = ro_sequence[qubit.measure.name][0] + ro_pulses[q] = ro_sequence[qubit.probe.name][0] sequence[qubit.drive.name].append(qd_pulses[q]) - sequence[qubit.measure.name].append(delays[q]) - sequence[qubit.measure.name].append(ro_pulses[q]) + sequence[qubit.probe.name].append(delays[q]) + sequence[qubit.probe.name].append(ro_pulses[q]) return sequence, qd_pulses, delays, ro_pulses, amplitudes