Skip to content

Commit

Permalink
chore: update rabi amplitude
Browse files Browse the repository at this point in the history
  • Loading branch information
stavros11 committed Aug 10, 2024
1 parent 8e2a370 commit 0ec0c60
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
9 changes: 5 additions & 4 deletions src/qibocal/protocols/rabi/amplitude.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
Expand Down
13 changes: 7 additions & 6 deletions src/qibocal/protocols/rabi/amplitude_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/qibocal/protocols/rabi/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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

Expand Down

0 comments on commit 0ec0c60

Please sign in to comment.