-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Enhance Primitives' interface #8065
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
Conversation
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the the following people are requested to review this:
|
Pull Request Test Coverage Report for Build 2425813167
💛 - Coveralls |
I think we should have someone (e.g. @rathishcholarajan ) from the runtime provider team to review to get their perspectives. |
I would like to summarize the difference between meta-programming and explicitly passing a name/id in this implementation. Meta-programming Passing names/ids |
I found that by using |
Co-authored-by: Rathish Cholarajan <rathishc24@gmail.com>
@rathishcholarajan Thank you for your review comments. Just to be clear, this PR changes the abstract method from |
Thanks @ikkoham. I can understand it and have made the changes in this PR Qiskit/qiskit-ibm-runtime#331. But have you considered not forcing this validation/conversion in base class |
@rathishcholarajan Thank you. Your PR looks good. Yes, the reason why we can't use |
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! Thanks a lot @ikkoham! (I pulled in this code to provider and all tests are passing Qiskit/qiskit-ibm-runtime#331)
(Approving and hoping it won't auto merge without the label and since I am not a code owner here, thereby others get enough time to review)
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.
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, but I'll keep the automerge label off in case someone else (like @levbishop or @ajavadia?) want to have another look 🙂
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.
I can't comment on the technicality of the implementation but I left some comments about the documentation. One major point I want to ask if whether we should also rename parameter_values
to parameters
now that we are renaming circuit_indices
and observable_indices
to circuits
and observables
. I am not sure why the current implementation has parameter_values
as argument in __call__
method but parameters
in the __init__
method. I think it would be good to unify among the methods.
Co-authored-by: Junye Huang <h.jun.ye@gmail.com> Co-authored-by: Rathish Cholarajan <rathishc24@gmail.com>
bb0918d
Co-authored-by: Rathish Cholarajan <rathishc24@gmail.com>
Co-authored-by: Rathish Cholarajan <rathishc24@gmail.com>
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.
Looks great! Thanks for adopting the suggestions.
… observables (Qiskit#165) * Adapt to base class changes Qiskit/qiskit#8065 * Adapt sampler to base class changes in terra * Fix black * Fix lint * Fix parameter names * Use Ikko's branch from terra temporarily for testing base class changes * Fix some failing tests * Fix couple more tests * Fix all test failures * Install rust * Install rust compiler * Fix disabling prompt when installing rust * Run cargo * Fix parameter name * Fix black * Update requirements.txt * Apply suggestions from code review Co-authored-by: IKKO HAMAMURA <Ikko.Hamamura1@ibm.com> * Match _call signature with base classes and remove unnecessary casts * Try with terra pre pre-release * Double equals needed * Fix lint * qiskit-terra 0.21.0 released, so use that no longer need to install rust since we are not installing terra from source anymore qiskit-aer is really a dev dependency for this repo and use the main branch code for now since PR Qiskit/qiskit-aer#1521 is not released yet * Stop inheriting QiskitTestCase so tests do not fail on deprecation warnings Co-authored-by: IKKO HAMAMURA <Ikko.Hamamura1@ibm.com>
Summary
This PR enhances Primitives (Sampler and Estimator) and provide a more flexible interface.
This comes from the discussion #8035.
The major difference is that the previous PR provided a function to extend the interface, but this one does so by default.
Details and comments
As discussed offline, this PR is API breaking but only for internals.
If needed, I will add a DeprecationWarning, please point it out in the review comments.
TODO: