2
$\begingroup$

Two representations of the same circuit

So I am wondering why this "Quantum Teleportation Algorithm" from Qiskit - Programming on Quantum Computers Ep 5 is represented differently when I draw it (on the left in the image above) compared to when they draw it (on the right in the image above), i.e. my result has only one $c$ line and the result from the video has separate lines for $c_0$, $c_1$, and $c_2$.

I would assume that this is something that was simply changed in development of Qiskit, but then I am wondering why they would make this change.
Again, my assumption would be that there are no controlled gates on classical bits but only links from the quantum register to the classical register, hence, it is not needed to display separate lines.

$\endgroup$
3
  • 1
    $\begingroup$ In the image on the left the 3 classical register lines are bundled together (notice a slash with 3 written above it). It's just notation. $\endgroup$ Dec 7, 2019 at 16:53
  • $\begingroup$ @SanchayanDutta I reckoned that, but do you know why or if there is an option in Qiskit to represent them separately? I could not find anything on it. $\endgroup$ Dec 7, 2019 at 16:55
  • 1
    $\begingroup$ Oh, I misinterpreted your question. They might be using a different environment. Anyway, I don't know much about Qiskit and I rarely use it. Let's wait for an answer from the Qiskit team (they check this site regularly). $\endgroup$ Dec 7, 2019 at 17:03

1 Answer 1

4
$\begingroup$

This can be done by passing a style to the drawer, setting the cregbundle to be False as the default is True. For example, given the circuit qc we can draw all the classical registers as follows :

qc.draw(output='mpl', filename='no_bundle.png', style={'cregbundle': False})

However, it is worth noting that only the mpl drawer supports setting things using a style dictionary like this.

$\endgroup$
2
  • 1
    $\begingroup$ Thank you, that information is very useful! $\endgroup$ Dec 7, 2019 at 17:12
  • $\begingroup$ No worries, I'm glad it has helped :) if this answered your question, would you mind clicking the tick by the votes to mark the answer as accepted? $\endgroup$
    – met927
    Dec 7, 2019 at 17:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.