DAG.width needs to be updated to match QuantumCircuit definition
See original GitHub issueInformation
- Qiskit Terra version: master
- Python version:
- Operating system:
What is the current behavior?
qr = QuantumRegister(5,'qr')
cr = ClassicalRegister(5, 'cr')
ghz = QuantumCircuit(qr, cr, name='ghz')
ghz.h(qr[2])
ghz.cx(qr[2], qr[1])
ghz.cx(qr[1], qr[0])
ghz.cx(qr[2], qr[3])
ghz.cx(qr[3], qr[4])
ghz.draw()
ghz_dag = circuit_to_dag(ghz)
print(ghz.width(), ghz_dag.width())
gives: (10, 5).
Steps to reproduce the problem
What is the expected behavior?
Suggested solutions
DAG width needs to count both qubits and cbits for self-consistency.
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (10 by maintainers)
Top Results From Across the Web
qiskit.dagcircuit.dagcircuit — Qiskit 0.19.6 documentation
Object to represent a quantum circuit as a directed acyclic graph (DAG). ... Operation nodes have equal in- and out-degrees and carry #...
Read more >Q-circuit Tutorial - UNM Physics & Astronomy
Q-circuit is a list of macros that greatly simplifies the construction of quantum circuit diagrams. (QCDs) in LATEX with the help of the...
Read more >Release notes — PennyLane 0.28.0 documentation
A new transform has been added to construct the pairwise-commutation directed acyclic graph (DAG) representation of a quantum circuit.
Read more >The Parallel Reversible Pebbling Game: Analyzing the Post ...
(2) We show that any (e, d)-reducible DAG has reversible space-time complexity ... If we instantiate fG,H with a quantum circuit of width...
Read more >Detecting crosstalk errors in quantum information processors
ous definition of crosstalk errors that captures the ef- fects of crosstalk, while avoiding the need ... circuit, Markovian quantum circuit, and Markovian,....
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

Per @ajavadia 's comments after merge of #2708 I’ll proceed to
DAGCircuit.num_cbits()and change toDAGCircuit.num_clbits()DAGCircuit.num_cbits()DAGCircuit.width()and replace withDAGCircuit.num_qbits()DAGCircuit.width()can be changed to return the total number of bits (qubits + clbits) fulfilling the intent of this issue.It probably breaks several things which is why it has not been implemented yet.