Skip to content

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

@johnbhurst

Description

@johnbhurst

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

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions