Skip to content

Fix barrier label position when bits are reversed (backport #13780) #13789

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

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Feb 5, 2025

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 the node.qargs list

Details and comments

Output:

      init ┌───┐      final 
q_0: ──░───┤ H ├──■─────░───
       ░   └───┘┌─┴─┐   ░   
q_1: ──░────────┤ X ├───░───
       ░        └───┘   ░   
      init      ┌───┐ final 
q_1: ──░────────┤ X ├───░───
       ░   ┌───┐└─┬─┘   ░   
q_0: ──░───┤ H ├──■─────░───
       ░   └───┘        ░   
```<hr>This is an automatic backport of pull request #13780 done by [Mergify](https://mergify.com).

* 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)
@mergify mergify bot requested review from nonhermitian and a team as code owners February 5, 2025 14:39
@qiskit-bot
Copy link
Collaborator

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:

@github-actions github-actions bot added Changelog: Bugfix Include in the "Fixed" section of the changelog Community PR PRs from contributors that are not 'members' of the Qiskit repo mod: visualization qiskit.visualization labels Feb 5, 2025
@github-actions github-actions bot added this to the 1.3.3 milestone Feb 5, 2025
@jakelishman jakelishman enabled auto-merge February 5, 2025 14:40
@coveralls
Copy link

Pull Request Test Coverage Report for Build 13159825945

Details

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.02%) to 88.928%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 1 92.23%
crates/accelerate/src/unitary_synthesis.rs 1 93.21%
Totals Coverage Status
Change from base Build 13073751398: 0.02%
Covered Lines: 79167
Relevant Lines: 89024

💛 - Coveralls

@jakelishman jakelishman added this pull request to the merge queue Feb 5, 2025
Merged via the queue into stable/1.3 with commit b8a6c5b Feb 5, 2025
20 checks passed
@mtreinish mtreinish deleted the mergify/bp/stable/1.3/pr-13780 branch February 5, 2025 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Bugfix Include in the "Fixed" section of the changelog Community PR PRs from contributors that are not 'members' of the Qiskit repo mod: visualization qiskit.visualization
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants