-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 PauliList support as observable type for Estimator.run #11521
Conversation
qiskit/primitives/utils.py
Outdated
else: | ||
if isinstance(observable, PauliList): | ||
warnings.warn( | ||
"Implicit conversion from a PauliList to a SparsePauliOp with coeffs=1 in" | ||
" estimator observable arguments is deprecated as of Qiskit 0.46 and will be" | ||
" in Qiskit 1.0. You should explicitly convert to a SparsePauli op using" | ||
" SparsePauliOp(pauli_list) to avoid this warning.", | ||
DeprecationWarning, | ||
stacklevel=2, | ||
) | ||
return SparsePauliOp(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 is a behavioural change compared to the previous state - the warning only affected PauliList
, but the new action forbids anything that hit this else
path.
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.
oh. my bad. Fixed in b5a260d
I got confused because SparsePauliOp
still takes PauliList
and it seems like an unnecessary constrain not allow PauliList at this point. This new code captures the original spirit @chriseclectic ?
Pull Request Test Coverage Report for Build 7473640080
💛 - 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.
LGTM
Removal of the deprecation introduced in #11520 (port of #11055)