Skip to content

Conversation

@gadial
Copy link
Contributor

@gadial gadial commented Apr 6, 2021

Summary

This PR build upon Chris' RB proposal, slightly modifying it to enable easy extension to other types of RB (interleaved, purity, CNOT-dihedral).

Details and comments

@gadial gadial changed the title RB experiment [WIP] RB experiment Apr 13, 2021
gadial and others added 9 commits April 19, 2021 18:53
* Add CurveFitAnalysis class

* Get outcome label from metadata

* Fix import error message if no matplotlib

* Add option for fitting means of batched data sets

* Reorganize helper functions into separate file

* Add curve_fit, multi_curve_fit, and plotting functions for xy data

* Refactor example CurveFitAnalysis class to use library functions

* Add curve fitting data

* Remove CurveFitAnalysis class and leave as library functions

* Linting

* Clean up curve_fit_data

* Remove unneeded check for meas level now that data processor function is an arg
* Add optional kwargs for x and series metadata keys for extracting data

* Run black

* Add filters to curve fit data

* Reorganize files

* Move curve_fit_data and mutli_curve_fit_data to curve_fitting.py
* Move other processing functions to `data_processing.py`

* Remove unneeded init import

* Initial review edits

* Separate x and series data for multi curve fit

Rename curve_fit_data to process_curve_data
Rename multi_curve_fit_data to process_multi_curve_data

* Allow passing p0, and bounds as dict to curve fit

* Add sigma to mean_xy_data

If sigma is provided the mean and variance is computed using inverse-variance weighting, otherwise it is computed as the sample mean and biased sample variance.

* Set default absolute_sigma = True

* Fix logical check on np array

* Use reduced chi-squared calculation

* fixup data processing

* Fix error in level2_probabilities multiplying by shots instead of dividing
* Add explicit method kwarg for mean_xy_data

* Add basic tests for curve fitting

* More review edits

* Change chisq -> reduced_chisq in result and docs
* add dof (degrees of freedom) to returned results
* add documentation about sigma by default being absolute sigma.

Co-authored-by: Helena Zhang <helena@astbb.com>
@gadial gadial changed the title [WIP] RB experiment RB experiment Apr 20, 2021
@ShellyGarion ShellyGarion requested a review from yaelbh April 20, 2021 06:21
@coruscating coruscating merged commit eb170af into qiskit-community:main Apr 20, 2021
@coruscating coruscating added this to the Release 0.1 milestone Jun 16, 2021
paco-ri pushed a commit to paco-ri/qiskit-experiments that referenced this pull request Jul 11, 2022
* RB experiment class based on Chris' draft

* Unifying sampling procedures

* Some more unification

* Style

* Style fixes

* Analysis now works directly with curve_fit functions

* Added plotting (ad-hoc solution for now)

* Linting

* Adding error bars to plots

* fixed link in readme (qiskit-community#15)

* Curve fitting analysis helper functions (qiskit-community#19)

* Add CurveFitAnalysis class

* Get outcome label from metadata

* Fix import error message if no matplotlib

* Add option for fitting means of batched data sets

* Reorganize helper functions into separate file

* Add curve_fit, multi_curve_fit, and plotting functions for xy data

* Refactor example CurveFitAnalysis class to use library functions

* Add curve fitting data

* Remove CurveFitAnalysis class and leave as library functions

* Linting

* Clean up curve_fit_data

* Remove unneeded check for meas level now that data processor function is an arg
* Add optional kwargs for x and series metadata keys for extracting data

* Run black

* Add filters to curve fit data

* Reorganize files

* Move curve_fit_data and mutli_curve_fit_data to curve_fitting.py
* Move other processing functions to `data_processing.py`

* Remove unneeded init import

* Initial review edits

* Separate x and series data for multi curve fit

Rename curve_fit_data to process_curve_data
Rename multi_curve_fit_data to process_multi_curve_data

* Allow passing p0, and bounds as dict to curve fit

* Add sigma to mean_xy_data

If sigma is provided the mean and variance is computed using inverse-variance weighting, otherwise it is computed as the sample mean and biased sample variance.

* Set default absolute_sigma = True

* Fix logical check on np array

* Use reduced chi-squared calculation

* fixup data processing

* Fix error in level2_probabilities multiplying by shots instead of dividing
* Add explicit method kwarg for mean_xy_data

* Add basic tests for curve fitting

* More review edits

* Change chisq -> reduced_chisq in result and docs
* add dof (degrees of freedom) to returned results
* add documentation about sigma by default being absolute sigma.

Co-authored-by: Helena Zhang <helena@astbb.com>

* Example notebook

* Linting and documentation

* Some more linting

* Small change

* Linting

Co-authored-by: Yael Ben-Haim <yaelbh@il.ibm.com>
Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com>
Co-authored-by: Helena Zhang <helena@astbb.com>
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

Successfully merging this pull request may close these issues.

6 participants