-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Remove deprecated features in 0.46 in primitives #11576
Conversation
Deprecates the unnecessary base class BasePrimitiveResult so we can have a clean break in defining new ones in Qiskit 1.0. Also deprecates the common utility methods `decompose`, `experiments`, and `num_experimetns` this base class adds to SamplerResult and EstimatorResult. Add jakes suggestion
One or more of the the following people are requested to review this:
|
Pull Request Test Coverage Report for Build 7744270839
💛 - Coveralls |
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.
There seem to be a bunch more deprecations from 0.46 left, see e.g. L239 in base_sampler.py
🙂
raise ValueError("Inconsistent number of experiments across data fields.") | ||
|
||
@property # TODO: functools.cached_property when py37 is droppped |
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.
In case someone stumbles over this (like I did): these are removed w/o deprecation warning since the deprecation PR went into stable/0.46
directly -- as is the change from BasePrimitiveResult
to _BasePrimitiveResult
.
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.
yes, introduced by #11054
@@ -61,7 +61,7 @@ def init_observable(observable: BaseOperator | str) -> SparsePauliOp: | |||
if isinstance(observable, SparsePauliOp): | |||
return observable | |||
elif isinstance(observable, BaseOperator) and not isinstance(observable, BasePauli): | |||
return SparsePauliOp.from_operator(observable) | |||
raise QiskitError(f"observable type not supported: {type(observable)}") |
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.
This was directly introduced into 0.46: #11535
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.
LGTM
Summary
This PR removes the deprecations introduced by #11052, #11051, #11054 and #11535
Details and comments
I'll add reno → done