I have the following circuit in qiskit. It is a simple CNOT operation with the control qubit set to 1, by running the control qubit through an X-gate.

However, when I measure the 2nd qubit, I get the state $|00\rangle$, not $|11\rangle$.

If I add a measurement of the control qubit, I do see $|11\rangle$ as the final result.

I fully expected $|11\rangle$ as the outcome regardless of whether I measure a single or both qubits

from qiskit import ClassicalRegister, QuantumRegister, QuantumCircuit
from qiskit import execute
from qiskit import BasicAer
from math import *
q0 = QuantumRegister(2, "q0") # one ancilla qubit
c0 = ClassicalRegister(2, "c0") # n classical bits for output
qc = QuantumCircuit(q0,c0)
qc.cx(q0[0], q0[1])
  #qc.measure(q0[0],c0[0]) <= when commented out I measure |00>
 job = execute(qc,backend=BasicAer.get_backend('qasm_simulator'))

enter image description here

  • 1
    $\begingroup$ This is not an answer (but I'm not allowed to comment as a newbie!). I saw something similar with BasicAer and posted a bug report in the Aer provider. It seems that BasicAer might be part of Terra instead, so maybe I posted in the wrong place. In my case, I get the expected behavior with Aer, but not with BasicAer. github.com/Qiskit/qiskit-aer/issues/70 $\endgroup$
    – Greg Byrd
    Mar 3, 2019 at 20:40

1 Answer 1


Thanks for pointing this out. This is a bug that occurs when only a subset of the qubits are measured.

It's being fixed. Until then, workarounds are:

  • Use Aer instead of BasicAer (always the best thing to do when possible).

  • Use LegacySimulators instead of BasicAer (this will give a deprecation warning).

  • Install Qiskit from the master branch, where the issue has been fixed (here be dragons!).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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