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 deprecated features in 0.46 in primitives #11576

Merged
merged 10 commits into from
Feb 1, 2024

Conversation

ikkoham
Copy link
Contributor

@ikkoham ikkoham commented Jan 17, 2024

Summary

This PR removes the deprecations introduced by #11052, #11051, #11054 and #11535

Details and comments

I'll add reno → done

chriseclectic and others added 2 commits January 17, 2024 10:58
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
@ikkoham ikkoham added Changelog: Removal Include in the Removed section of the changelog mod: primitives Related to the Primitives module labels Jan 17, 2024
@ikkoham ikkoham added this to the 1.0.0 milestone Jan 17, 2024
@ikkoham ikkoham requested review from a team as code owners January 17, 2024 02:12
@qiskit-bot
Copy link
Collaborator

One or more of the the following people are requested to review this:

  • @Qiskit/terra-core
  • @ajavadia
  • @ikkoham
  • @levbishop
  • @t-imamichi

@coveralls
Copy link

coveralls commented Jan 17, 2024

Pull Request Test Coverage Report for Build 7744270839

  • -1 of 20 (95.0%) changed or added relevant lines in 7 files are covered.
  • 23 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.02%) to 89.364%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/primitives/utils.py 2 3 66.67%
Files with Coverage Reduction New Missed Lines %
qiskit/primitives/utils.py 1 87.32%
crates/qasm2/src/lex.rs 4 91.69%
crates/qasm2/src/parse.rs 18 96.69%
Totals Coverage Status
Change from base Build 7744260861: 0.02%
Covered Lines: 60082
Relevant Lines: 67233

💛 - Coveralls

Copy link
Contributor

@Cryoris Cryoris left a 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
Copy link
Contributor

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.

Copy link
Contributor Author

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)}")
Copy link
Contributor Author

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

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

@t-imamichi
Copy link
Member

Could you update the description to mention PRs which this is based on.
I guess #11054 and #11535. Do I miss anything else?

@chriseclectic chriseclectic added this pull request to the merge queue Feb 1, 2024
Merged via the queue into Qiskit:main with commit 6141d74 Feb 1, 2024
12 checks passed
@ikkoham ikkoham deleted the primitives/remove-for-1 branch February 1, 2024 22:23
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.

8 participants