Circuit incorrectly justifed
See original GitHub issueInformation
- Qiskit Terra version: master
- Python version: 3.7
- Operating system: macOS
What is the current behavior?
The following circuit is not correctly justified, the first U2 after the measure appears in its own column, rather than underneath the other U2.
Steps to reproduce the problem
qasm = """
OPENQASM 2.0;
include "qelib1.inc";
qreg q[5];
creg c1[1];
u2(0,3.14159265358979) q[0];
u2(0,3.14159265358979) q[1];
cx q[1],q[0];
u2(0,3.14159265358979) q[0];
u2(0,3.14159265358979) q[1];
u2(0,3.14159265358979) q[1];
measure q[0] -> c1[0];
u2(0,3.14159265358979) q[0];
cx q[1],q[0];
u2(0,3.14159265358979) q[0];
u2(0,3.14159265358979) q[1];
"""
from qiskit import QuantumCircuit
qc = QuantumCircuit.from_qasm_str(qasm)
print(qc)
ββββββββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββ
q_0: |0>β€ U2(0,3.1416) ββ€ X ββ€ U2(0,3.1416) ββ€Mββββββββββββββββββ€ U2(0,3.1416) ββ€ X ββ€ U2(0,3.1416) β
ββββββββββββββββ€βββ¬ββββββββββββββββββ€ββ₯ββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββ€
q_1: |0>β€ U2(0,3.1416) ββββ βββ€ U2(0,3.1416) βββ«ββ€ U2(0,3.1416) ββββββββββββββββββββ βββ€ U2(0,3.1416) β
ββββββββββββββββ ββββββββββββββββ β ββββββββββββββββ ββββββββββββββββ
q_2: |0>βββββββββββββββββββββββββββββββββββββββ«ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
q_3: |0>βββββββββββββββββββββββββββββββββββββββ«ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
q_4: |0>βββββββββββββββββββββββββββββββββββββββ«ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
c1_0: 0 βββββββββββββββββββββββββββββββββββββββ©ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
What is the expected behavior?
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
q_0: |0>β€ U2(0,3.1416) ββ€ X ββ€ U2(0,3.1416) ββ€Mββ€ U2(0,3.1416) ββ€ X ββ€ U2(0,3.1416) β
ββββββββββββββββ€βββ¬ββββββββββββββββββ€ββ₯βββββββββββββββββ€βββ¬ββββββββββββββββββ€
q_1: |0>β€ U2(0,3.1416) ββββ βββ€ U2(0,3.1416) βββ«ββ€ U2(0,3.1416) ββββ βββ€ U2(0,3.1416) β
ββββββββββββββββ ββββββββββββββββ β ββββββββββββββββ ββββββββββββββββ
q_2: |0>βββββββββββββββββββββββββββββββββββββββ«ββββββββββββββββββββββββββββββββββββββ
β
q_3: |0>βββββββββββββββββββββββββββββββββββββββ«ββββββββββββββββββββββββββββββββββββββ
β
q_4: |0>βββββββββββββββββββββββββββββββββββββββ«ββββββββββββββββββββββββββββββββββββββ
β
c1_0: 0 βββββββββββββββββββββββββββββββββββββββ©ββββββββββββββββββββββββββββββββββββββ
Issue Analytics
- State:
- Created 4 years ago
- Comments:27 (27 by maintainers)
Top Results From Across the Web
When can a project's wrong estimates be justified?
[Are] there any cases...when wrong estimates can be justified? Estimates are not guarantees. They are "educated guesses" based on experience, historical data,Β ...
Read more >Rule 60. Relief from a Judgment or Order - Law.Cornell.Edu
(a) Corrections Based on Clerical Mistakes; Oversights and Omissions. The court may correct a clerical mistake or a mistake arising from oversight orΒ ......
Read more >CIS 4930 Digital System Testing Testing for Single Stuck-at ...
Determine PI values that force value on line l to Μ
". This is known as the line-justification problem. 6. 6.2 ATG for SSFs...
Read more >Plain Sentencing Guidelines errors "ordinarily" justify relief
When a federal district court sentences a defendant under an incorrect Sentencing Guidelines range, the defendant ordinarily is entitled toΒ ...
Read more >The neural correlates of justified and unjustified killing - NCBI
One example is warfare, where killing enemy soldiers is seen as morally justified. Yet, the neural underpinnings distinguishing between justified andΒ ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@1ucian0 , I recreate qasm for the circuit you illustrated above and test draw
left,right, andnonewith this code:The resulting output is show below. Am I correct that both
leftandrightare incorrect (leftfor the reason you pointed out above, andrightfor the positioning of the lasth q[3]) whilenoneis correct?I think the error is likely to be in

qiskit-terra/qiskit/visualization/utils.pyin the method_get_layered_instructions()as I am seeing the bug in both the mpl and the latex outputs too. It is probably an error with the way the layers are being generated rather than drawn.