1
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit, execute, Aer

qreg = QuantumRegister(2)
creg = ClassicalRegister(2)
circuit = QuantumCircuit(qreg,creg)

circuit.x(qreg[0]) #10
circuit.x(qreg[1]) #11
circuit.cx(qreg[0],qreg[1]) #?

circuit.measure(qreg,creg)
job = execute(circuit,Aer.get_backend('qasm_simulator'),shots=1024)
counts = job.result().get_counts(circuit)
print(counts)

# CNOT gate: performs a NOT on the target whenever the control is in state 1.

OUTPUT: {'01': 1024} MY EXPECTATION: {'10': 1024}

1 Answers1

1

This is because Qiskit uses little-endian ordering for both classical bits and qubits.

See this answer for more details.

Egretta.Thula
  • 11,986
  • 1
  • 13
  • 34