diff --git a/src/qibocal/protocols/flux_dependence/qubit_flux_dependence.py b/src/qibocal/protocols/flux_dependence/qubit_flux_dependence.py index e2a464285..1cebfaeea 100644 --- a/src/qibocal/protocols/flux_dependence/qubit_flux_dependence.py +++ b/src/qibocal/protocols/flux_dependence/qubit_flux_dependence.py @@ -218,12 +218,12 @@ def fit_function(x, w_max, normalization, offset): "charging_energy": data.charging_energy[qubit] * HZ_TO_GHZ, } frequency[qubit] = popt[0] * GHZ_TO_HZ - middle_freq = np.median(frequencies) + middle_bias = np.median(biases) # solution to x*popt[1] + popt[2] = k # such that x is close to 0 # to avoid errors due to periodicity sweetspot[qubit] = ( - np.round(popt[1] * middle_freq + popt[2]) - popt[2] + np.round(popt[1] * middle_bias + popt[2]) - popt[2] ) / popt[1] matrix_element[qubit] = popt[1] except ValueError as e: