-
Notifications
You must be signed in to change notification settings - Fork 66
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
Add error message for shot vectors for QiskitDevice #576
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #576 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 9 9
Lines 867 869 +2
=========================================
+ Hits 867 869 +2 ☔ View full report in Codecov by Sentry. |
@@ -326,3 +326,16 @@ def barrier_func(): | |||
res = barrier_func() | |||
assert barrier_func.tape.operations[0] == qml.Barrier([0, 1]) | |||
assert np.allclose(res, dev.batch_execute([barrier_func.tape]), atol=0) | |||
|
|||
|
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.
You can use @pytest.mark.parametrize.
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.
You may also need to update the setter for shots.
If you do:
dev.shots = (10,100,100)
Do you get an error? This is what is used for dynamic shots.
We should double check that bug #575 actually provides an informative error message now.
Does not raise an error for I tried using |
We may need to define a shots setter to add some validation is a shot vector is attempted to be set. |
As mentioned by @CatalinaAlbornoz in issue #575, there's a bug that's ultimately related to
qiskit.aer
not supporting shot vectors (@albi3ro). While the functionality is still not supported, in this PR, we add a more useful error message to capture this behaviour.This error message already exists in the new device API so there's no additional work on that front.