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