Skip to content
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

Merged
merged 4 commits into from
Jan 17, 2024

Conversation

1ucian0
Copy link
Member

@1ucian0 1ucian0 commented Jan 9, 2024

Removal of the deprecation introduced in #11520 (port of #11055)

@1ucian0 1ucian0 added the Changelog: Removal Include in the Removed section of the changelog label Jan 9, 2024
@1ucian0 1ucian0 added this to the 1.0.0 milestone Jan 9, 2024
@1ucian0 1ucian0 requested review from ikkoham, t-imamichi and a team as code owners January 9, 2024 13:01
Comment on lines 65 to 66
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)}")
Copy link
Member

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.

Copy link
Member Author

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 ?

@1ucian0 1ucian0 requested a review from a team as a code owner January 10, 2024 10:27
@coveralls
Copy link

Pull Request Test Coverage Report for Build 7473640080

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.007%) to 87.542%

Totals Coverage Status
Change from base Build 7469929160: -0.007%
Covered Lines: 59797
Relevant Lines: 68307

💛 - Coveralls

Copy link
Member

@t-imamichi t-imamichi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ikkoham ikkoham added this pull request to the merge queue Jan 17, 2024
@ikkoham ikkoham added the mod: primitives Related to the Primitives module label Jan 17, 2024
Merged via the queue into Qiskit:main with commit de7a0b1 Jan 17, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Removal Include in the Removed section of the changelog mod: primitives Related to the Primitives module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants