-
Notifications
You must be signed in to change notification settings - Fork 156
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
Perform fractional gate filtering on raw API dicts #2044
Conversation
This change moves the filtering of fractional gates and dynamic circuit instructions up into the processing of the raw configuration and properties dicts received through the API. Previously, the filtering was performed only during the creation of the `Target` for the backend. So previously an `IBMBackend` with fractional gates would have both fractional gates and dynamic circuit instructions in its configuration and properties data regardless of what value was used for `use_fractional_gates`. This situation led to inconsistent behavior when for example users tried to use `backend.basis_gates` as the reference for which gates were available instead of `backend.target.operation_names`. The previous changes to filter instructions during target creation are removed here, but the `use_fractional_gates` backend option is retained because `IBMBackend` loads the properties data lazily and can reload the configuration data after creation with the `refresh()` method. Closes Qiskit#2031
41ff06f
to
87ca03c
Compare
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.
Overall the change looks good. I have a couple of concerns as written in inline comments.
I think this is ready for 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.
Edit the comment in
# Set fractional gate feature before Target object is created. |
Another comment to be edited, although it's not from this PR, but related:
"""Create an IBMBackend instance from raw server data. |
And, of course, thanks a lot for doing this work 😄
qiskit_ibm_runtime/fake_provider/backends/fractional/conf_fractional.json
Show resolved
Hide resolved
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.
Added a few small comments, although you didn't say that it's ready for another 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.
Thanks, @yaelbh. I did mean to ask for another review after my last changes. I think it is ready again.
I think I have addressed all the comments, but I didn't mark anything as resolved. Feel free to mark any conversations as resolved if you want to clear up what is still outstanding.
Naoki is on leave and we don't want to make him come back early to re-review or wait for him to come back.
This change moves the filtering of fractional gates and dynamic circuit instructions up into the processing of the raw configuration and properties dicts received through the API. Previously, the filtering was performed only during the creation of the
Target
for the backend. So previously anIBMBackend
with fractional gates would have both fractional gates and dynamic circuit instructions in its configuration and properties data regardless of what value was used foruse_fractional_gates
. This situation led to inconsistent behavior when for example users tried to usebackend.basis_gates
as the reference for which gates were available instead ofbackend.target.operation_names
.The previous changes to filter instructions during target creation are removed here, but the
use_fractional_gates
backend option is retained becauseIBMBackend
loads the properties data lazily and can reload the configuration data after creation with therefresh()
method.Closes #2031