Skip to content

Commit

Permalink
chore: update resonator spectroscopy
Browse files Browse the repository at this point in the history
  • Loading branch information
stavros11 committed Aug 10, 2024
1 parent 0ec0c60 commit 5cec168
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
25 changes: 13 additions & 12 deletions src/qibocal/protocols/resonator_spectroscopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from qibolab.platform import Platform
from qibolab.pulses import PulseSequence
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 @@ -132,7 +133,7 @@ def _acquisition(
for q in targets:
qubit = platform.qubits[q]
ro_sequence = qubit.native_gates.MZ.create_sequence()
ro_pulses[q] = ro_sequence[qubit.measure.name][0]
ro_pulses[q] = ro_sequence[qubit.probe.name][0]

if params.amplitude is not None:
ro_pulses[q].amplitude = params.amplitude
Expand All @@ -148,7 +149,7 @@ def _acquisition(
attenuation = None

attenuations[q] = attenuation
sequence[qubit.measure.name].append(ro_pulses[q])
sequence[qubit.probe.name].append(ro_pulses[q])

# define the parameter to sweep and its range:
delta_frequency_range = np.arange(
Expand All @@ -157,7 +158,7 @@ def _acquisition(
sweeper = Sweeper(
Parameter.frequency,
delta_frequency_range,
channels=[platform.qubits[q].measure for q in targets],
channels=[platform.qubits[q].probe for q in targets],
type=SweeperType.OFFSET,
)
data = ResonatorSpectroscopyData(
Expand All @@ -167,26 +168,26 @@ def _acquisition(
attenuations=attenuations,
)

results = platform.sweep(
sequence,
results = platform.execute(
[sequence],
params.execution_parameters,
sweeper,
[[sweeper]],
)

# retrieve the results for every qubit
for qubit in targets:
result = results[ro_pulses[qubit].id]
result = results[ro_pulses[qubit].id][0]
# store the results
ro_frequency = platform.config(platform.qubits[qubit].measure.name).frequency
ro_frequency = platform.config(platform.qubits[qubit].probe.name).frequency
data.register_qubit(
ResSpecType,
(qubit),
dict(
signal=result.average.magnitude,
phase=result.average.phase,
signal=magnitude(result),
phase=phase(result),
freq=delta_frequency_range + ro_frequency,
error_signal=result.average.std,
error_phase=result.phase_std,
# error_signal=error_signal,
# error_phase=error_phase,
),
)
return data
Expand Down
4 changes: 2 additions & 2 deletions src/qibocal/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def readout_frequency(freq: float, platform: Platform, qubit: QubitId):
mz = platform.qubits[qubit].native_gates.MZ
freq_hz = int(freq)
mz.frequency = freq_hz
if mz.if_frequency is not None:
mz.if_frequency = freq_hz - platform.qubits[qubit].readout.lo_frequency
# if mz.if_frequency is not None:
# mz.if_frequency = freq_hz - platform.qubits[qubit].readout.lo_frequency
platform.qubits[qubit].readout_frequency = freq_hz


Expand Down

0 comments on commit 5cec168

Please sign in to comment.