Skip to content

Commit

Permalink
Merge pull request #716 from qiboteam/flipping
Browse files Browse the repository at this point in the history
possible issues
  • Loading branch information
andrea-pasquale authored Feb 21, 2024
2 parents 55f2bbd + 7c9c04e commit b11efdd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/qibocal/protocols/characterization/flipping.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ def _fit(data: FlippingData) -> FlippingResults:
popt = popt.tolist()
except:
log.warning("flipping_fit: the fitting was not succesful")
popt = [0] * 4
perr = [1] * 4
popt = [0] * 5
perr = [1] * 5

if popt[3] > np.pi / 2 and popt[3] < 3 * np.pi / 2:
signed_correction = -popt[2] / 2
Expand Down
8 changes: 4 additions & 4 deletions src/qibocal/protocols/characterization/flipping_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def _fit(data: FlippingSignalData) -> FlippingSignalResults:
)
except:
log.warning("flipping_fit: the fitting was not succesful")
popt = [0, 0, 0, 0]
popt = [0] * 5

translated_popt = [
y_min + (y_max - y_min) * popt[0],
Expand All @@ -178,10 +178,11 @@ def _fit(data: FlippingSignalData) -> FlippingSignalResults:
popt[3] - x_min * 2 * np.pi * f / (x_max - x_min) * popt[2],
popt[4] * 2 * np.pi * f / (x_max - x_min),
]
# TODO: this might be related to the resonator type
if popt[3] > np.pi / 2 and popt[3] < 3 * np.pi / 2:
signed_correction = -translated_popt[2] / 2
else:
signed_correction = translated_popt[2] / 2
else:
signed_correction = -translated_popt[2] / 2
# The amplitude is directly proportional to the rotation angle
corrected_amplitudes[qubit] = (pi_pulse_amplitude * np.pi) / (
np.pi + signed_correction
Expand All @@ -190,7 +191,6 @@ def _fit(data: FlippingSignalData) -> FlippingSignalResults:
amplitude_correction_factors[qubit] = (
signed_correction / np.pi * pi_pulse_amplitude
)

return FlippingSignalResults(
corrected_amplitudes, amplitude_correction_factors, fitted_parameters
)
Expand Down

0 comments on commit b11efdd

Please sign in to comment.