Skip to content

Commit

Permalink
fix: Correct non-zero amplitude case
Browse files Browse the repository at this point in the history
  • Loading branch information
andrea-pasquale committed Jan 15, 2025
1 parent f52c521 commit fa7cb84
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/qibocal/protocols/flux_amplitude_frequency.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,19 @@ def _acquisition(
targets: list[QubitId],
) -> FluxAmplitudeFrequencyData:

detuning = {
qubit: (
0
if params.crosstalk_qubit is None
else platform.calibration.single_qubits[qubit].qubit.detuning(
detuning = {}
for qubit in targets:
if params.crosstalk_qubit is None and params.amplitude_min == 0:
detuning[qubit] = 0
elif params.crosstalk_qubit is not None:
detuning[qubit] = platform.calibration.single_qubits[qubit].qubit.detuning(
params.flux_pulse_amplitude
)
)
for qubit in targets
}
else:
detuning[qubit] = platform.calibration.single_qubits[qubit].qubit.detuning(
params.amplitude_min
)

qubit_frequency = {
qubit: platform.calibration.single_qubits[qubit].qubit.frequency_01 * HZ_TO_GHZ
for qubit in targets
Expand Down Expand Up @@ -272,6 +275,7 @@ def _fit(data: FluxAmplitudeFrequencyData) -> FluxAmplitudeFrequencyResults:
other_det = data.detuning[qubit]
f = data.qubit_frequency[qubit]
det = phase / data.flux_pulse_duration / 2 / np.pi + other_det
det[np.abs(det) < 1e-3] = 0
derived_flux = 1 / np.pi * np.arccos(((f + det) / f) ** 2)
flux[qubit] = derived_flux.tolist()
fitted_parameters_detuning[qubit] = np.polyfit(amplitudes, det, 2).tolist()
Expand Down
9 changes: 9 additions & 0 deletions tests/runcards/protocols.yml
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,15 @@ actions:
duration: 50
relaxation_time: 50_000

- id: flux_amplitude_dep 0 amp
operation: flux_amplitude_frequency
parameters:
amplitude_min: 0
amplitude_max: 1
amplitude_step: 0.1
duration: 50
relaxation_time: 50_000

- id: flux_amplitude_dep_crosstalk
operation: flux_amplitude_frequency
targets: [0]
Expand Down

0 comments on commit fa7cb84

Please sign in to comment.