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
nkanazawa1989
left a comment
There was a problem hiding this comment.
Overall the change looks good. I have a couple of concerns as written in inline comments.
|
I think this is ready for another look. |
yaelbh
left a comment
There was a problem hiding this comment.
Edit the comment in
Another comment to be edited, although it's not from this PR, but related:
And, of course, thanks a lot for doing this work 😄
yaelbh
left a comment
There was a problem hiding this comment.
Added a few small comments, although you didn't say that it's ready for another review
wshanks
left a comment
There was a problem hiding this comment.
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
Targetfor the backend. So previously anIBMBackendwith 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_gatesas the reference for which gates were available instead ofbackend.target.operation_names.Closes #2031