-
Notifications
You must be signed in to change notification settings - Fork 604
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
Update counts to handle floats/NaN values from hardware #4739
Conversation
Hello. You may have forgotten to update the changelog!
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## v0.33.0-rc0 #4739 +/- ##
==============================================
Coverage ? 99.64%
==============================================
Files ? 380
Lines ? 33998
Branches ? 0
==============================================
Hits ? 33876
Misses ? 122
Partials ? 0 ☔ View full report in Codecov by Sentry. |
[sc-48588] |
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.
changelog?
Thanks for this fix 🎉
The QuEra hardware sometimes has failed measurements, which return as NaN. Because of this, all samples from the device are returned with type
float
, and some of them arenp.NaN
. These were not handled well in counts. On the_default_qubit
device, nothing was converted to integers, so it did this:We don't like that. Now they are converted into integers if there is no observable, just like in
CountsMP
.Also added a line both there and in
CountsMP
to avoid converting theNaN
values to 0 and implying they were ground state measurements - instead, any sample where at least one wire failed is disregarded when totalling the number of counts.Has been tested with the QuEra hardware, and now returns nicely:
with 13 disregarded failed measurements: