-
Notifications
You must be signed in to change notification settings - Fork 167
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
EstimatorV2 updates #1321
EstimatorV2 updates #1321
Conversation
Pull Request Test Coverage Report for Build 7835592117
💛 - Coveralls |
BaseEstimatorV2 (and all supportive container classes) has now been merged into qiskit's main branch |
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.
Generally LGTM. I believe we should have more tests, and my main concern is the large amount of copy-pasting of container data from qiskit, even if we believe it's not subject to change. However, if we have no way around it I have no objections to merging this PR.
@@ -254,8 +253,14 @@ def default(self, obj: Any) -> Any: # pylint: disable=arguments-differ | |||
serializer=lambda buff, data: dump(data, buff), # type: ignore[no-untyped-call] | |||
) | |||
return {"__type__": "Instruction", "__value__": value} | |||
if isinstance(obj, BasePub): | |||
return asdict(obj) | |||
# TODO proper way to do this? |
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.
I suggest we treat this similarly to other complex data types, e.g. pass a the following dict:
if isinstance(obj, EstimatorPub):
return {
"__type__": "EstimatorPub",
"__value__": {
"circuit": obj.circuit,
"observables": obj.observables,
"parameter_values": obj.parameter_values,
"precision": obj.precision,
},
}
However, I think we should delay that until we start using the EstimatorPub
from qiskit itself.
from ..ibm_test_case import IBMIntegrationTestCase | ||
|
||
|
||
class TestEstimatorV2(IBMIntegrationTestCase): |
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.
The test suite is currently relatively small; perhaps we can use the test suite in qiskit:
https://github.com/Qiskit/qiskit/blob/main/test/python/primitives/test_estimator.py
See the SamplerV2 PR where I do something similar for Sampler:
Now that BaseEstimatorV2 and container classes are all merged into Qiskit main, I think it'd make more sense to just include qiskit main (then rc1 when it's released) in this branch |
Removed all of the copied files and using the main branch of qiskit now. I believe the build is failing because the CI is not using the main branch and the qiskit version is being overwritten by another dependency. |
This looks like |
Lint is now failing because qiskit.test was removed from qiskit 1.0 (Have a separate PR to take care of that #1292, too many moving parts 🫠) Ran unit tests locally - tests are passing except |
This can be a separate PR, but v2 primitives |
@kt474 Now that the 2 blockers have been merged, can you update this PR so we can get it merged? We'll need more tests, but that can go into a separate PR. |
…bm-runtime into estimatorv2-updates
…bm-runtime into estimatorv2-updates
…-ibm-runtime into estimatorv2-updates
Summary
There are a lot of files copied over from qiskit, they should be replaced after the next qiskit release.Simple job example:
Details and comments
Fixes #1314