-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Environment
- Qiskit version: 2.0.0
- Python version: 3.11
- Operating system: mac
What is happening?
If we add a box
to a circuit, then apply a layout to the circuit (via transpile
), the new circuit may not draw
the right end of the box correctly (with the default, text-based draw
output).
How can we reproduce the issue?
qc = QuantumCircuit(4)
with qc.box():
qc.cx(0,1)
qc.cx(0,3)
print('before transpile:')
print(qc.draw())
qc_ = transpile(qc, initial_layout=[2,3,1,0])
print('after transpile:')
print(qc_.draw())
print('after transpile, showing idles:')
print(qc_.draw(idle_wires=True))
What should happen?
The right end of the box should be rendered correctly, as roughly shown below.
This next thing should probably be a separate feature request, but since we're on the topic of box
drawing: can/should we number the pinout of the box
? I did this in pink for visibility below. This would match the behavior when draw
ing an append
ed subcircuit. The pinout might seem unimportant since the box contents are already drawn explicitly, but it could still be helpful when reasoning about annotations or other metadata associated with the box.
Any suggestions?
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working