Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check amplitude less than 1 in _fit #1096

Open
Edoardo-Pedicillo opened this issue Feb 20, 2025 · 2 comments
Open

Check amplitude less than 1 in _fit #1096

Edoardo-Pedicillo opened this issue Feb 20, 2025 · 2 comments

Comments

@Edoardo-Pedicillo
Copy link
Contributor

As the title says.

@alecandido
Copy link
Member

Would you elaborate on the motivation or the specific routines which you have in mind?

Pulses' amplitudes are always enforced to be less than 1 in Qibolab (thus in _acquire), and I guess most fits are looking for values within the scanned range. But I may be wrong.

@Edoardo-Pedicillo
Copy link
Contributor Author

Edoardo-Pedicillo commented Feb 20, 2025

I guess most fits are looking for values within the scanned range. But I may be wrong.

No, the fit has some bounds only on the normalized paramters, like in rabi

def fit_amplitude_function(
x, y, guess, sigma=None, signal=True, x_limits=(None, None), y_limits=(None, None)
):
popt, perr = curve_fit(
rabi_amplitude_function,
x,
y,
p0=guess,
maxfev=100000,
bounds=(
[0, 0, 0, 0],
[1, 1, np.inf, 2 * np.pi],
),
sigma=sigma,
)
if signal is False:
perr = np.sqrt(np.diag(perr))
if None not in y_limits and None not in x_limits:
popt = [
y_limits[0] + (y_limits[1] - y_limits[0]) * popt[0],
(y_limits[1] - y_limits[0]) * popt[1],
popt[2] * (x_limits[1] - x_limits[0]),
popt[3] - 2 * np.pi * x_limits[0] / (x_limits[1] - x_limits[0]) / popt[2],
]
pi_pulse_parameter = popt[2] / 2 * period_correction_factor(phase=popt[3])
return popt, perr, pi_pulse_parameter

because in 0.1 it was not necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants