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

Drag analysis #732

Merged
merged 32 commits into from
Mar 16, 2022
Merged
Changes from 2 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
8211566
* Make drag analysis more robust.
eggerdj Mar 10, 2022
4052a64
Merge branch 'main' into drag_analysis_fit_guess
eggerdj Mar 10, 2022
db9ab19
* Refactored Drag experiment fitting and added tests.
eggerdj Mar 11, 2022
61b2f13
Merge branch 'drag_analysis_fit_guess' of github.com:eggerdj/qiskit-e…
eggerdj Mar 11, 2022
4375647
* Doc fix.
eggerdj Mar 11, 2022
7e93369
* Docs
eggerdj Mar 11, 2022
b98408c
* Fix lint.
eggerdj Mar 11, 2022
1113c4f
Update qiskit_experiments/library/characterization/analysis/drag_anal…
eggerdj Mar 14, 2022
c31bc76
Update qiskit_experiments/library/characterization/analysis/drag_anal…
eggerdj Mar 14, 2022
4f7fa25
Update qiskit_experiments/library/characterization/analysis/drag_anal…
eggerdj Mar 14, 2022
47e8c43
Merge branch 'main' into drag_analysis_fit_guess
eggerdj Mar 14, 2022
604dcfe
Update test/calibration/experiments/test_drag.py
eggerdj Mar 14, 2022
1bfa06e
* Doc text
eggerdj Mar 15, 2022
19b8dae
* reps indexing
eggerdj Mar 15, 2022
917de61
Merge branch 'main' into drag_analysis_fit_guess
eggerdj Mar 15, 2022
42765e2
* Beta bound
eggerdj Mar 15, 2022
ebae5a4
* Renamed error to freq in Drag mock backend.
eggerdj Mar 15, 2022
b289654
* Improve Drag tests.
eggerdj Mar 15, 2022
e11e1da
* Adjusted the tol
eggerdj Mar 15, 2022
d7611f9
* f-string and __fixed_parameters__
eggerdj Mar 15, 2022
c042e6e
* Added hook to get beta just right.
eggerdj Mar 15, 2022
946db8c
* Guesses based on ptp and max(y) - min(y)
eggerdj Mar 15, 2022
5890a5b
* Changed bounds on beta.
eggerdj Mar 15, 2022
d05b697
* USe modulo to wrap beta
eggerdj Mar 16, 2022
dfab517
* Ambiguity docstring
eggerdj Mar 16, 2022
e78ca5c
* Model description strings.
eggerdj Mar 16, 2022
12578f8
Update qiskit_experiments/library/characterization/analysis/drag_anal…
eggerdj Mar 16, 2022
1626e57
* Rescaled frequencies by 4
eggerdj Mar 16, 2022
125ba15
* Fix drag experiment option setting
eggerdj Mar 16, 2022
d9688db
Update qiskit_experiments/library/characterization/analysis/drag_anal…
eggerdj Mar 16, 2022
4870e70
* Black
eggerdj Mar 16, 2022
693491c
Update qiskit_experiments/library/characterization/analysis/drag_anal…
eggerdj Mar 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -150,25 +150,25 @@ def _generate_fit_guesses(
freq_bound = max(10 / user_opt.p0["freq0"], max(x_data))

user_opt.bounds.set_if_empty(
amp=(-2 * max_abs_y, 0),
amp=(-2 * max_abs_y, 2 * max_abs_y),
eggerdj marked this conversation as resolved.
Show resolved Hide resolved
freq0=(0, np.inf),
freq1=(0, np.inf),
freq2=(0, np.inf),
beta=(-freq_bound, freq_bound),
base=(-max_abs_y, max_abs_y),
)
user_opt.p0.set_if_empty(base=0.5)
user_opt.p0.set_if_empty(base=(user_opt.p0["amp"] or max_abs_y) / 2)

# Drag curves can sometimes be very flat, i.e. averages of y-data
# and min-max do not always make good initial guesses. We therefore add
# 0.5 to the initial guesses. Note that we also set amp=-0.5 because the cosine function
# becomes +1 at zero phase, i.e. optimal beta, in which y data should become zero
# in discriminated measurement level.
options = []
for amp_guess in (0.5, -0.5):
for beta_guess in np.linspace(min_beta, max_beta, 20):
for amp_factor in (-1, -0.5, 0.5, 1):
eggerdj marked this conversation as resolved.
Show resolved Hide resolved
for beta_guess in np.linspace(0.5 * min_beta, 0.5 * max_beta, 10):
eggerdj marked this conversation as resolved.
Show resolved Hide resolved
new_opt = user_opt.copy()
new_opt.p0.set_if_empty(amp=amp_guess, beta=beta_guess)
new_opt.p0.set_if_empty(amp=max_abs_y * amp_factor, beta=beta_guess)
options.append(new_opt)

return options
Expand Down