Skip to content

update the RB fitting method to compensate for the standard deviation induced from the random number generator #7562

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

NoureldinYosri
Copy link
Collaborator

@NoureldinYosri NoureldinYosri commented Aug 7, 2025

changing the RB fitting method to 1) scale the estimated error to remove the effect of the std of the random number generator 2) take into account the standard deviation of the error. this means that instead of fitting a curve to $(x_i, y_i)$ it will fit a curve that passes through $(x_i, \hat{y_i})$ where $\hat{y_i} \in [y_i - \sigma_i, y_i + \sigma_i]$

@NoureldinYosri NoureldinYosri requested review from mrwojtek, vtomole and a team as code owners August 7, 2025 16:06
@github-actions github-actions bot added the size: S 10< lines changed <50 label Aug 7, 2025
@NoureldinYosri NoureldinYosri changed the title update the RB fitting method to compensate for the standard deviation induced from the random number ge update the RB fitting method to compensate for the standard deviation induced from the random number generator Aug 7, 2025
@github-actions github-actions bot added size: M 50< lines changed <250 and removed size: S 10< lines changed <50 labels Aug 7, 2025
Copy link

codecov bot commented Aug 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.50%. Comparing base (dc69fa1) to head (12ea768).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7562   +/-   ##
=======================================
  Coverage   97.50%   97.50%           
=======================================
  Files        1103     1103           
  Lines       99695    99716   +21     
=======================================
+ Hits        97209    97230   +21     
  Misses       2486     2486           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mhucka
Copy link
Contributor

mhucka commented Aug 7, 2025

@NoureldinYosri Could you please add a description to this PR? As a matter of best practices, we shouldn't leave PR descriptions empty.

@mhucka mhucka added the priority/before-1.6.1 Finish before the Cirq 1.6.1 release label Aug 7, 2025
Copy link
Contributor

@mhucka mhucka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM pending the addition of a description to this PR and double-checking whether the test function name was really intended to be as it is written.

@mhucka mhucka removed the priority/before-1.6.1 Finish before the Cirq 1.6.1 release label Aug 7, 2025
Copy link
Collaborator

@eliottrosenberg eliottrosenberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @NoureldinYosri! But I don't think this fixed the variance problem. I tested it in this colab.

@NoureldinYosri
Copy link
Collaborator Author

@eliottrosenberg the results from running the internal RB are not independent, they are correlated. if you rerun the notebook but turnoff parameter updates you will get similar std https://colab.research.google.com/drive/1U6yDZBNDU4wSqjxVukHCz1mbwvyj7PQO#scrollTo=Fwi7fjYUBpr5

Copy link
Collaborator

@eliottrosenberg eliottrosenberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving so that we can merge this, but I don't think the investigation is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: M 50< lines changed <250
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants