-
Notifications
You must be signed in to change notification settings - Fork 35
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
Convert to samples/counts based on available MPs #1148
Conversation
Hello. You may have forgotten to update the changelog!
|
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.
Thanks for the quick change!
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1148 +/- ##
==========================================
- Coverage 97.89% 97.88% -0.01%
==========================================
Files 76 76
Lines 10858 10863 +5
Branches 1281 1283 +2
==========================================
+ Hits 10629 10633 +4
Misses 179 179
- Partials 50 51 +1 ☔ View full report in Codecov by Sentry. |
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.
Thanks for the quick fix 👍
Context:
In #1123 we changed the criteria for applying
measurements_from_samples
andmeasurements_from_counts
to be based on whether or not there are supportedobservables
. Previously the decision in preprocess had been based on supported measurement processes instead of supported observables. The reason for this change is that those transforms don't only change the measurement type - they also go a step further and diagonalize the observables to the readout basis. This is potentially a separate functionality from modifying measurement types.There was discussion of this being handled by a future transform that is more specific to selectively transforming unsupported MPs without changing the observables. However, that isn't implemented yet, and the QRack plugin in analytic mode only supports Counts and Samples, so its needed now.
Description of the Change:
This PR reintroduces the check for supported measurement types being limited to a subset of {"Counts", "Samples"} in when adding measurement transforms to the device TransformProgram.
Benefits:
The QRack device keeps working.
Possible Drawbacks:
Depending what the backend supports, arguably the TOML file loading is what should change here - if the observables are only supported in
analytic
mode, then theqjit_capabilities
in finite-shots mode should have an empty list ofobservables
, and then this change would be unnecessary. So maybe I'm not fixing this in the most logical place? But I'm not sure about that, and I'm sure this will work.