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

Primitive V1 deprecation follow-up #12824

Merged
merged 7 commits into from
Jul 29, 2024

Conversation

ElePT
Copy link
Contributor

@ElePT ElePT commented Jul 26, 2024

Summary

This PR applies a series of fixes to the messaging introduced in #11490 to further clarify:

  • difference between V1 and V2
  • difference between abstract interface and implementation
  • migration path for deprecated classes

It supersedes #12818 after an offline discussion with @1ucian0.

Details and comments

I am open to suggestions, this is a bit of an intricate message to convey to users.

@ElePT ElePT requested review from a team as code owners July 26, 2024 13:37
@qiskit-bot
Copy link
Collaborator

One or more of the following people are relevant to this code:

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

@ElePT ElePT added this to the 1.2.0 milestone Jul 26, 2024
@ElePT ElePT added mod: primitives Related to the Primitives module Changelog: None Do not include in changelog labels Jul 26, 2024
@coveralls
Copy link

coveralls commented Jul 26, 2024

Pull Request Test Coverage Report for Build 10140985638

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 21 of 21 (100.0%) changed or added relevant lines in 6 files are covered.
  • 74 unchanged lines in 20 files lost coverage.
  • Overall coverage increased (+0.003%) to 89.742%

Files with Coverage Reduction New Missed Lines %
qiskit/circuit/library/standard_gates/swap.py 1 98.21%
qiskit/circuit/library/standard_gates/rxx.py 1 97.87%
qiskit/primitives/base/base_estimator.py 1 94.59%
qiskit/primitives/base/base_sampler.py 1 96.97%
qiskit/circuit/library/standard_gates/rzx.py 1 97.87%
qiskit/circuit/library/standard_gates/ryy.py 2 95.74%
qiskit/circuit/library/standard_gates/xx_plus_yy.py 2 96.23%
qiskit/circuit/library/standard_gates/xx_minus_yy.py 2 96.23%
qiskit/circuit/library/standard_gates/rzz.py 2 95.45%
qiskit/circuit/library/standard_gates/rz.py 3 96.0%
Totals Coverage Status
Change from base Build 10111859581: 0.003%
Covered Lines: 66779
Relevant Lines: 74412

💛 - Coveralls

1ucian0
1ucian0 previously approved these changes Jul 26, 2024
Copy link
Member

@1ucian0 1ucian0 left a comment

Choose a reason for hiding this comment

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

Great explanations! Thank you! Some few small non-blocking comments

qiskit/primitives/backend_estimator.py Outdated Show resolved Hide resolved
qiskit/primitives/backend_sampler.py Outdated Show resolved Hide resolved
qiskit/primitives/backend_sampler.py Outdated Show resolved Hide resolved
qiskit/primitives/estimator.py Outdated Show resolved Hide resolved
qiskit/primitives/sampler.py Outdated Show resolved Hide resolved
qiskit/primitives/statevector_estimator.py Outdated Show resolved Hide resolved
qiskit/primitives/statevector_sampler.py Outdated Show resolved Hide resolved
releasenotes/notes/deprecate-primitives-v1.yaml Outdated Show resolved Hide resolved
@t-imamichi
Copy link
Member

t-imamichi commented Jul 29, 2024

Thank you for following up #12575. It looks good overall and Luciano's suggestions make sense to me too.

Co-authored-by: Luciano Bello <bel@zurich.ibm.com>
ElePT and others added 2 commits July 29, 2024 09:45
Co-authored-by: Luciano Bello <bel@zurich.ibm.com>
Co-authored-by: Luciano Bello <bel@zurich.ibm.com>
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.

I added a few minor comments.

1ucian0 and others added 2 commits July 29, 2024 10:39
Co-authored-by: Takashi Imamichi <31178928+t-imamichi@users.noreply.github.com>
Co-authored-by: Takashi Imamichi <31178928+t-imamichi@users.noreply.github.com>
@1ucian0 1ucian0 enabled auto-merge July 29, 2024 08:55
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

@ElePT ElePT added the stable backport potential The bug might be minimal and/or import enough to be port to stable label Jul 29, 2024
@1ucian0 1ucian0 added this pull request to the merge queue Jul 29, 2024
Merged via the queue into Qiskit:main with commit b7d0a97 Jul 29, 2024
14 of 15 checks passed
mergify bot pushed a commit that referenced this pull request Jul 29, 2024
* Apply tweaks to deprecation messages, docstrings and release notes.

* Fix missing backtick

* Apply suggestions from Luciano's code review

Co-authored-by: Luciano Bello <bel@zurich.ibm.com>

* Update qiskit/primitives/statevector_sampler.py

Co-authored-by: Luciano Bello <bel@zurich.ibm.com>

* Update qiskit/primitives/backend_sampler.py

Co-authored-by: Luciano Bello <bel@zurich.ibm.com>

* Update qiskit/primitives/primitive_job.py

Co-authored-by: Takashi Imamichi <31178928+t-imamichi@users.noreply.github.com>

* Update qiskit/primitives/base/base_estimator.py

Co-authored-by: Takashi Imamichi <31178928+t-imamichi@users.noreply.github.com>

---------

Co-authored-by: Luciano Bello <bel@zurich.ibm.com>
Co-authored-by: Takashi Imamichi <31178928+t-imamichi@users.noreply.github.com>
(cherry picked from commit b7d0a97)
github-merge-queue bot pushed a commit that referenced this pull request Jul 29, 2024
* Apply tweaks to deprecation messages, docstrings and release notes.

* Fix missing backtick

* Apply suggestions from Luciano's code review

Co-authored-by: Luciano Bello <bel@zurich.ibm.com>

* Update qiskit/primitives/statevector_sampler.py

Co-authored-by: Luciano Bello <bel@zurich.ibm.com>

* Update qiskit/primitives/backend_sampler.py

Co-authored-by: Luciano Bello <bel@zurich.ibm.com>

* Update qiskit/primitives/primitive_job.py

Co-authored-by: Takashi Imamichi <31178928+t-imamichi@users.noreply.github.com>

* Update qiskit/primitives/base/base_estimator.py

Co-authored-by: Takashi Imamichi <31178928+t-imamichi@users.noreply.github.com>

---------

Co-authored-by: Luciano Bello <bel@zurich.ibm.com>
Co-authored-by: Takashi Imamichi <31178928+t-imamichi@users.noreply.github.com>
(cherry picked from commit b7d0a97)

Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
Procatv pushed a commit to Procatv/qiskit-terra-catherines that referenced this pull request Aug 1, 2024
* Apply tweaks to deprecation messages, docstrings and release notes.

* Fix missing backtick

* Apply suggestions from Luciano's code review

Co-authored-by: Luciano Bello <bel@zurich.ibm.com>

* Update qiskit/primitives/statevector_sampler.py

Co-authored-by: Luciano Bello <bel@zurich.ibm.com>

* Update qiskit/primitives/backend_sampler.py

Co-authored-by: Luciano Bello <bel@zurich.ibm.com>

* Update qiskit/primitives/primitive_job.py

Co-authored-by: Takashi Imamichi <31178928+t-imamichi@users.noreply.github.com>

* Update qiskit/primitives/base/base_estimator.py

Co-authored-by: Takashi Imamichi <31178928+t-imamichi@users.noreply.github.com>

---------

Co-authored-by: Luciano Bello <bel@zurich.ibm.com>
Co-authored-by: Takashi Imamichi <31178928+t-imamichi@users.noreply.github.com>
@kalvdans
Copy link

README.md is still suggesting to use from qiskit.primitives.sampler import Sampler, please update the example as well to not use deprecated classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog mod: primitives Related to the Primitives module stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants