Skip to content

Commit

Permalink
Merge pull request #914 from qiboteam/fix_mask
Browse files Browse the repository at this point in the history
Improve mask on flux fit
  • Loading branch information
andrea-pasquale authored Jul 31, 2024
2 parents f8c04db + 9ea76d4 commit 6961ed1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +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
# sweetspot obtain by solving transmon_frequency == w_max
sweetspot[qubit] = -popt[2] / popt[1]
# solution to x*popt[1] + popt[2] = k pi
# such that x is close to 0
# to avoid errors due to periodicity
k = np.round(popt[2] / np.pi)

sweetspot[qubit] = (k * np.pi + popt[2]) / popt[1]
matrix_element[qubit] = popt[1]
except ValueError as e:
log.error(
Expand Down
2 changes: 1 addition & 1 deletion src/qibocal/protocols/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ def extract_feature(
z[first_mask],
[100 - ci_second_mask, ci_second_mask],
)
second_mask = z[first_mask] < max if feat == "min" else z[first_mask] > min
second_mask = z[first_mask] < min if feat == "min" else z[first_mask] > max
return x[first_mask][second_mask], y[first_mask][second_mask]


Expand Down

0 comments on commit 6961ed1

Please sign in to comment.