1
$\begingroup$

Screenshot of my notebook

Why do we have just one line here in c0 and not 2?

$\endgroup$
1
  • $\begingroup$ You have correctly 2 classical bits! Qiskit visualizes the classical bits always in bundle. The number "2" written on the classical line refers to the number of classical bits you have. You may ask why? Just for the sake of tidiness! Otherwise your visualization would get huge! $\endgroup$ – user9318 Oct 1 '20 at 7:10
1
$\begingroup$

By default, Qiskit visualization bundles together classical bits of the same register. If you would like to draw them separately, do

qr = QuantumRegister(2)
cr = ClassicalRegister(2)

circ = QuantumCircuit(qr, cr)
circ.draw('mpl', 
          cregbundle=False)

enter image description here

$\endgroup$

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.