-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix barrier label position when bits are reversed #13780
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 following people are relevant to this code:
|
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.
This looks like the start of a solid change. The tests are showing trouble in barriers that aren't full width (e.g. the top of the barrier isn't at the top of the drawing), so I think we might need some logic a bit more along the lines of
top_qubit = min(node.qargs, key=self._wire_map.get)
for qubit in node.qargs:
if qubit in self.qubits:
label = op.label if qubit == top_qubits else ""
# ...
(completely untested) to handle those cases.
Please could you also add a test case that's a regression test of what you're fixing, and a bugfix release note?
I’ve set the default value to |
Pull Request Test Coverage Report for Build 13157633583Warning: 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
💛 - Coveralls |
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 following people are relevant to this code:
|
releasenotes/notes/barrier-label-position-reverse-bits-41819043ebb3d701.yaml
Outdated
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.
Ace, thank you!
* qa: Fix barrier label position when bits are reversed * Consider qubit with min index as top qubit * Fix lint issues * Fix typo --------- Co-authored-by: Jake Lishman <jake@binhbar.com> (cherry picked from commit 1ef0d79)
* qa: Fix barrier label position when bits are reversed * Consider qubit with min index as top qubit * Fix lint issues * Fix typo --------- Co-authored-by: Jake Lishman <jake@binhbar.com> (cherry picked from commit 1ef0d79) Co-authored-by: atharva-satpute <55058959+atharva-satpute@users.noreply.github.com>
Hmm. Using Qiskit 1.4.1, and the sample code I put in the original ticket 13609:
I am still getting the same incorrect barrier label positions as shown in the images in the original ticket. Am I missing something? |
I missed adding changes for |
Created #13971 |
Summary
Fixes: #13609
Changed the way the barrier label is applied to qubits. Previously, we used the index of the qubit in
qargs
list to decide if a label should be added here. Now, the label is applied to the qubit with the smallest index in_wire_map
, ensuring the label is based on the qubit's position in the_wire_map
rather than its position in thenode.qargs
listDetails and comments
Output: