-
Notifications
You must be signed in to change notification settings - Fork 127
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
Curve analysis with uncertainties package #551
Curve analysis with uncertainties package #551
Conversation
f2c531b
to
d9364b3
Compare
d9364b3
to
2ad7511
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Minor suggestions.
qiskit_experiments/library/characterization/analysis/drag_analysis.py
Outdated
Show resolved
Hide resolved
qiskit_experiments/library/characterization/analysis/remsey_xy_analysis.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Daniel J. Egger <[email protected]>
Co-authored-by: Daniel J. Egger <[email protected]>
Co-authored-by: Daniel J. Egger <[email protected]>
Co-authored-by: Daniel J. Egger <[email protected]>
…nazawa1989/qiskit-experiments into upgrade/curve_analysis_uncertainties
…ade/curve_analysis_uncertainties
I also added 3-sigma interval according to https://en.wikipedia.org/wiki/68–95–99.7_rule
CI with parameter correlation nicely explains relation between sampling error and fit error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost good. One minor naming concern.
…ade/curve_analysis_uncertainties
Closed since this is merged into #564 for review with full functionality |
Summary
This is followup of #481 . This PR offloads error computation currently manually coded (sometime with error) to
uncertainties
package.Details and comments
Usage of
FitVal
object is removed from experiment library / framework module and replaced withUFloat
object. BothFitVal
andUFloat
are numerical object consisting of the nominal value and standard error.UFloat
supports numerical operation with error propagation while keeping parameter correlation, so this will give us more precise estimate of error values that is computed based on fit values.We need minor code update for many analysis modules, because of property name difference:
However we can remove code that manually computes error propagation (without considering parameter correlation).
Effect of parameter correlation
In current Experiments curve fit code,
pcov
(covariance matrix) returned fromcurve_fit
is just ignored. So parameter values are (written with ufloat object in uncertainties package, but same implementation with current code)on the other hand,
uncertainties
provides a convenient function that generates parameter set with covariance matrix.I tested the difference with T1 experiment with not enough scan range (so that error is amplified).
Without correlation
With correlation
Note that non-diagonal part (correlation) is not negligible in such configuration, and seems like we have been overestimating the confidence interval.
(note)
This PR doesn't update data representation in
ExperimentData
. This means once analysis complete the outcome is converted intoFitVal
anyways and we cannot compute error propagation anymore. Same for data loaded from the database. To support error propagation with loaded entries, we need to replaceFitVal
withUFloat
in db service module. But this change will add more and more files to review, so will be done (if we want) in follow-up PR.TODO