-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix target error and duration lookup in UnitarySynthesis #9617
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
Fix target error and duration lookup in UnitarySynthesis #9617
Conversation
This commit fixes an issue introduced into the UnitarySynthesis pass as part of Qiskit#9175. In Qiskit#9715 the UnitarySynthesis pass was updated to consider multiple different target bases and select the best performing synthesis output found. When UnitarySynthesis is provided a Target object this involves querying the target for the error rates and duration of the instructions used. However, currently this lookup doesn't handle a couple of edge cases in the target data model resulting from variable width operations and ideal gates (i.e. from a simulator that don't have error or durations). In those cases some fields in the internal dictionaries used to store data can be None or the gate object stored in the target can be a class not an instance of a class. If a target with either of these properties were used as an input to UnitarySynthesis the pass would error. Fixes Qiskit#9592
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:
|
This reminds me I need to refresh #9158 as having those APIs would have made this easier to deal with since we'd have a single entry point to do the lookup and this wouldn't need to worry about the internal state of the |
Pull Request Test Coverage Report for Build 4227200893
💛 - Coveralls |
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 for fixing this issue. This PR looks good to me.
* Fix target error and duration lookup in UnitarySynthesis This commit fixes an issue introduced into the UnitarySynthesis pass as part of Qiskit#9175. In Qiskit#9715 the UnitarySynthesis pass was updated to consider multiple different target bases and select the best performing synthesis output found. When UnitarySynthesis is provided a Target object this involves querying the target for the error rates and duration of the instructions used. However, currently this lookup doesn't handle a couple of edge cases in the target data model resulting from variable width operations and ideal gates (i.e. from a simulator that don't have error or durations). In those cases some fields in the internal dictionaries used to store data can be None or the gate object stored in the target can be a class not an instance of a class. If a target with either of these properties were used as an input to UnitarySynthesis the pass would error. Fixes Qiskit#9592 * Remove superfluous pylint suppression --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Summary
This commit fixes an issue introduced into the UnitarySynthesis pass as part of #9175. In #9715 the UnitarySynthesis pass was updated to consider multiple different target bases and select the best performing synthesis output found. When UnitarySynthesis is provided a Target object this involves querying the target for the error rates and duration of the instructions used. However, currently this lookup doesn't handle a couple of edge cases in the target data model resulting from variable width operations and ideal gates (i.e. from a simulator that don't have error or durations). In those cases some fields in the internal dictionaries used to store data can be None or the gate object stored in the target can be a class not an instance of a class. If a target with either of these properties were used as an input to UnitarySynthesis the pass would error.
Details and comments
Fixes #9592