Skip to content
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

Barrier labels placed wrongly with draw(reverse_bits=True) #13609

Open
johnbhurst opened this issue Dec 29, 2024 · 0 comments
Open

Barrier labels placed wrongly with draw(reverse_bits=True) #13609

johnbhurst opened this issue Dec 29, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@johnbhurst
Copy link

johnbhurst commented Dec 29, 2024

Environment

  • Qiskit version: qiskit==1.3.1
  • Python version: Python 3.10.12
  • Operating system: Linux JohnSurface 5.15.167.4-microsoft-standard-WSL2 Setuptools Bootstrapper script is deprecated #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.5 LTS"

What is happening?

When using circuit.draw() with reverse_bits=True, labels on barriers get placed incorrectly.

circuit.draw():
Image

circuit.draw(reverse_bits=True):
Image

How can we reproduce the issue?

from qiskit.circuit import QuantumCircuit, QuantumRegister

q = [q0, q1] = QuantumRegister(2, 'q')
circuit = QuantumCircuit(q)
circuit.barrier(label='init')
circuit.h(q0)
circuit.cx(q0, q1)
circuit.barrier(label='final')
circuit.draw(output='mpl', filename='circuit.png')
circuit.draw(output='mpl', filename='circuit_reverse_bits.png', reverse_bits=True)

What should happen?

Barrier labels should display in the same position with reverse_bits=True.

Any suggestions?

No response

@johnbhurst johnbhurst added the bug Something isn't working label Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant