-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Use list for GoogleNoiseProperties.readout_errors values #7392
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
Use list for GoogleNoiseProperties.readout_errors values #7392
Conversation
GoogleNoiseProperties from `calibration_to_noise_properties()` cannot be serialized. Here is a test for that failure.
Problem: The values in `SuperconductingQubitsNoiseProperties.readout_errors` and `GoogleNoiseProperties.readout_errors` dictionary are declared as both `list[float]` and `np.ndarray` and can be set with either type. JSON serialization fails when assigned list type. Solution: Always convert to a `list[float]` type. This fixes serialization failure for object constructed with `noise_properties_from_calibration`.
Question @dstrain115 - The json_test_data/GoogleNoiseProperties.repr file expresses
This passes tests because Should we leave it as is or is it better to update GoogleNoiseProperties.repr? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7392 +/- ##
==========================================
- Coverage 98.68% 98.68% -0.01%
==========================================
Files 1112 1112
Lines 97737 97755 +18
==========================================
+ Hits 96454 96471 +17
- Misses 1283 1284 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…7392) Problem: The values in `SuperconductingQubitsNoiseProperties.readout_errors` and `GoogleNoiseProperties.readout_errors` dictionaries are declared as `np.ndarray` in docstrings, but annotated as`list[float]` in the code, and can be set to either type. JSON serialization fails when assigned a list. Solution: Always convert to `list[float]` following the type annotation. This fixes serialization failure for `GoogleNoiseProperties` objects created with `noise_properties_from_calibration`.
Problem: The values in
SuperconductingQubitsNoiseProperties.readout_errors
and
GoogleNoiseProperties.readout_errors
dictionaries are declared asnp.ndarray
in docstrings, but annotated aslist[float]
in the code,and can be set to either type. JSON serialization fails when assigned a list.
Solution: Always convert to
list[float]
following the type annotation.This fixes serialization failure for
GoogleNoiseProperties
objects createdwith
noise_properties_from_calibration
.